RS.Quick Fighter Launch System[07/02/05]

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

RS.Quick Fighter Launch System[07/02/05]

Post by Red Spot » Sun, 1. May 05, 15:49

[07/02/05] --> redid the "launch-amount" script for the regular and the AI version .. also fixed some booboo's in the AI-launch-script .. (I still had the check for docked M4s checking for player-owned ships .. :oops: )

-launch-amount script tweak --> removed the M1s and M2s as target to engage .. instead you get a message .. (AI offcourse will still engage them)
also I more or less forgot about things like nav. sats .. :roll:


[06/24/05] --> RS.AI.QFLS (check the last bit off this post)

Code: Select all

Added 06/27/05
-QFLS Auto for M2's and TL's
for M2's .. it will launch (regular way) all docked M3's when an enemy comes within the set range (max. range is 10km)
for TL's .. it will right away launch x wings .. that will patrol around the TL .. engaging all enemies that enter a 10km radius off the TL 

-QFLS Fighter Screen
1 special command .. 'QFLS Fighter Screen' this will launch 1 wing and sends them to the designated position .. 
the lead-ship is added to a list .. now repeat and build a screen how you like (for instance in front off a gate leading to a xenon-sector)

1 additional command .. 'QFLS Screen Engage' this will order all 'Leaders' that are stored in list to attack the designated target .. after destruction the wings continue killing evrything within 20km range.. returning home if there isnt anything within 20km range off them ..
selecting the Carrier itself will clear the list off fighters (a must do after having fighters docked ..etc.. not needed when you add ships .. this does however mean that you can only have 1 'active screen' /carrier ..

Code: Select all

 
QFLS --> Quick Fighter Launch System

*Important: You will need to DL the RS.Tools package as well*

In short -- it enables you to use your Carriers (mainly M1's but also M2's, M6's and TL's) as real Carriers


The Commands
-QFLS Auto-
This is the main command of the QFLS-script and only works for M1's ..
it will ask you to input a range (from 0 to quit the command to max. 30 ..(the script does the range *1000 .. so you only have to enter the range in whole km's)
than a number that represents the number off "early warning scouts" you want to have air-born (the max number off scouts is limited at 5..)
now after activating the command .. the Carrier starts scanning for enemies .. and stores any newly found enemies in a list ..
than checking how much off your fighters should be airborn to take on all enemies..
if the carrier finds there are no or to little fighters airborn it will launch fighters ..
fighters will be formed up in wings off max. 4 M3's .. but also could be send out alone (no use in sending more than 1 M3 to take on a single M5 )
do note!! .. here I left a gap (on purpose) the carrier does not "re-launch" fighters .. so if fighters get destroyed the Carrier wil NOT send new fighters out ..
The fighters go straight for their targets .. they do however check for enemies close to them selves (so they wont run past an other enemy) .. and also they do a minimum-range enemy check on the carrier (should enemies be close to the carrier .. the main-target off fighter than becomes its secondary target .. and the target close the carrier its primary ..)
fighters get quick-launched close to carrier (3.2km) in a line towards the primairy-target ..

if the primairy target off the fighter is destroyed or leaves the carriers max-range+10km .. the fighters return home .. but start scanning at max-carrier range for any hostilles in range off the carrier ..

the carrier tries to use ships designated as Leader or Wingman .. but if none are available .. it will pick a random docked M3 as leader ..
the carrier doesnt launch any ships with a hull off 85% and lower (it puts them on 'non-active' and they are taken out off the 'loop')

Scouts
the scouts that are launched will patrol around the carrier .. at carrier max. scan range+20km .. and check for enemies within 15km range .. if they find any .. they will 'signal' the homebase to send fighters to intercept .. the scout will even try to buy some time by launching Drones ..
the fighters will attack in the same way as if they where launched by the carrier .. only now they will only return home .. if the target is killed or if they or the target leaves max carrier scan range+35km ..

*I'm prob missing some features ..*


-QFLS Set Leader/Wingman-
Command for M3's .. enter 1 to designate the ship as Leader .. 2 for Wingman .. anything else to remove the designation ..


-QFLS Recall Fighter-
if a ship is launched by the carrier .. this is often the only way to return the command off the ship back to you .. (it will quit all running tasks .. and set the ship to return home) (requirments -> a 'big ship' as homebase .. Nav Com and Fight Com 1)


-M6 QFLS Auto-
will launch the docked fighter at an M6 .. to 'attack same' .. the ship will redock if there are no more enemies in range ..(no quick launch involved)


-QFLS Launch X-
this is a nice feature .. its been split up in 4 parts .. you first have to select a target .. and an amount off wings (wings will hold 4*M3's and an M4 if available)
if the target is..
-the carrier .. than x-wings go an patrol close around the carrier .. engaging anything hostille that comes close .. but they wont chase ships .. (nice command to keep fighters in the air .. but keep your fire-power concentrated)
-an enemy .. than x-wings will get launched to attack and return .. always scanning for enemies close to them ..
-a station .. than x-wings will dock there
-a non-hostille ship .. than x-wings will patrol close around it .. like with the carrier ..


-QFLS Repair-
finds the nearest shipyard/warf for you and sends all ships with a hull-percentage lower than set by you to that warf/yard ..
(also available on M2/TL's)

-QFLS Equip-
equip docked ships off 'type' with 'max.number' off 'ware' ..
(also available on M2/TL's)

-QFLS Recall-
recall all fighters in sector with the carrier as home exept for M5's..
(also available on M2/TL's)

about the carriers target-list..
-the carrier stores all found enemies in range in a list..
and sends out fighters to all enemies ..
-than any next time.. the carrier scans for enemies ..
checks if those enemies are in the list .. if they are do nothing ..
if they are not .. return all newly found enemies and launch fighters at them .. and storing the newly found enemies in the list ..
if an enemy in the list doesnt exist any-more .. the get removed from the list ..
what this means is .. the carrier will always send no more than an x-amount off fighters to any newly found enemy ..
if the target is something big .. like lets say an M6 .. than 12 fighters should get launched .. but wings are no larger than 4 M3's .. so 3 wings are being launched ..(if they are not available .. the carrier will launch what it has .. if the minimum off M3's available is 4 (1 complete wing) or higher)

when enemies have been added to the list .. no more fighters are being send out .. so lets say you find a single M3 .. than the carrier launches a wing off 3 M3's .. might the freak-chance occur that that 1 M3 takes out your 3 M3's .. than the carrier doesnt relaunch any ships (but when ships are destroyed you can be sure that you will hear some "one off your ships is under attack" messages)



-> RS.AI.QFLS
(diff. script/package)

Code: Select all


QFLS for non-player M1's ..


check the "RS.AI.QFLS.Starter"-script .. it has now got 2 ships in it ..(you will have to alter these yourself)
these ships are the ones the script looks for .. and activates the RS.AI.QFLS.Main-script on them in task '508' 
(if you decide on using this .. make sure the M1 has enough M3's docked .. 
and the starter-script is a loop that runs the script every hour .. and re-activates the main-script on all found ships .. meaning in this 'format' its designed for M1's that or on the map .. else there is no use in looping it )

is more or less a really 'light' version off my RS.QFLS-script .. 
there is no input .. just make sure the 'main'-script runs on 'task 508' 

the carrier checks for enemies in 20km range (big ships --> 25km)
and launches fighters at any newly found enemies .. always seeing the 'playership' as a new ship if its in range ..
no checks for ships with hull-damage .. or any other non-needed checks .. 


NOTE: this does need my RS.Tools-package ..
	this is no 'stand-alone' script .. so dont think that by spawning a M1 and installing this 	script will do anything .. you will "have" to make this fit your game .. (the stock map has 	M1's that do not have enough M3's docked for this to work properly .. and you will have to 	run the 'starter'-script manually or make a setup-script..)
just uploaded a modded version off the 'attackenemiesrange'-script (the default command for all ships on the map)
so it will start this task on any M1 thats not playerowned (this way the task is always launched if a ship is (re-)spawned (no more need for the 'starter'-script with this .. still I packed it in a diff. .zip in case you dont want to mess with the 'stock'-scripts)



download at This Location ..


G
Last edited by Red Spot on Sat, 2. Jul 05, 21:05, edited 34 times in total.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sun, 1. May 05, 18:25

just remade an extra version to use on AI ships ..

but I cant seem to get the command to run on the ship (as an add. command that is)

when I try to have an other command to run it shows something like this under running scripts
QFLS.Pir.Main (the QFLS.Main script)
!ship.cmd.attackenemies
!fight.attack.object
and when that happens .. the ship goes on "attack enemies" but no more "QFLS" .. how could I get two scripts to run with on an other ..??

Ghalador
Posts: 3929
Joined: Sat, 9. Nov 02, 19:33
x4

Post by Ghalador » Sun, 1. May 05, 21:53

Your script is interrupted by scripts with higher priority.
Increase the script priority ...say to 100.
Have fun: Gala Do.

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Sun, 1. May 05, 22:11

what you need to do it run the QLFS script on a different task.

a ship's main task is task id = 0. this slot is for things like you using the menu to select "attack target" for one of your ships, or when you use the start script command on a ship.

if you use the "start task" command you can choose a different task id and run the task silently in the background. for example, in one of my carrier scripts i have the following line:

Code: Select all

[THIS] -> start task 1080 with script 'mhordes.carrier.ship.behave' and prio 0: arg1=$behavior arg2=null arg3=null arg4=null arg5=null
it starts the ship's main behavior script in task id = 1080. that launch script then calls things like:

Code: Select all

START [THIS] -> command COMMAND_PROTECT : arg1=$homebase, arg2=null, arg3=null, arg4=null
or any other method of starting a command on the ship (call the attack script, start the script as a task in task id = 0, etc) to tell the ship to attack.

i'm guessing if you start the task on task id = 512, 650, 1070, or something like that (you want to choose a number that someone else is unlikely to also want to start a command on, kind of like making your /t text file), the carrier's launch behavior will run in the background while the carrier is then free to move around and fight using its normal command slot. you can start the task on that slot by having the carrier's command menu call use the first sort of call above, which will start a new script on that new task, then the main task can end which frees up the carrier for additional commands.

yes, i repeated myself like four times writing this, but i'm trying to get the point across.
//----------------------------------
--the milling_hordesman

Me Mods

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sun, 1. May 05, 22:13

dont really know how to do that .. :oops:

tried it with an other script .. couldnt get it donne then .. so worked a way around it ..

could you point me in the right direction ??.. :roll:

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Sun, 1. May 05, 22:23

first off, does this script run on your other carriers by using the command menu, or are you trying to get it to run on all AI carriers? if by command menu, just do the following:

you need a new script called "QFLS.Command" or something. link that script to the QFLS command menu item.

in the QFLS.Command script, do the following:

Code: Select all

001   [THIS] -> start task 550 with script 'QFLS.Main1' and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
002   return null
that should call the launch script in task 550 and quit, which frees up your ship to do other things.

to make it a little more fancy and have the ship use the command to toggle the launch behavior, do the following:

Code: Select all

001   $command = [THIS] -> get local var: name = "QFLS.command"
002   if $command == null or $command == 0
003      [THIS] -> start task 550 with script 'QFLS.Main1' and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
004      [THIS] -> set local var: name = "QFLS.command" value = "1"
005   else
006      [THIS] -> start task 550 with script 'QFLS.Blank' and prio 0: arg1=null arg2=null arg3=null arg4=null arg5=null
007      [THIS] -> set local var: name = "QFLS.command" value = "0"
008   else
009   
010   return null
then make a second script called "QFLS.blank" or something that quite simply returns null. this script is used to stop the launch command running by running a new task in task 550.

and if you're trying to make all AI carriers run the command, you have a much larger problem than that.
//----------------------------------
--the milling_hordesman

Me Mods

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sun, 1. May 05, 23:19

sry didnt see the first post M_H .. but what it is .. this is a slightly modded script .. its itended to run on AI ships that I spawn vs me .. to make it a real warzone .. :oops:

but I cant seem to get the "attack_enemies" command to run without stopping the "QFLS.'pir'.Main1" script .. but like you showed .. I'll try that priority thing ..

I allready noticed that usually fly/trade/combat commands have a prio. of 0

and than on big ships of ai .. G-Crew on prio. of 1 ..

this means (if I'm understanding correct) that actually the lower the number the higher the prio. ?? ..

so if I would give the QFLS script a prio of 1 .. it would prob mess around with the G-crew script ..??


(ps: just to make sure no-one is confused about this .. this is not about the reg QFLS-script .. that works as it should ..:P)

Ghalador
Posts: 3929
Joined: Sat, 9. Nov 02, 19:33
x4

Post by Ghalador » Sun, 1. May 05, 23:44

Afaik Egosoft's original combat scripts run with prioritiy 99. They are called on "Signal.Attacked" and such things. If they are called, they will take over the action until the status of the ship has changed (in this case: until it isn't attacked anymore). After that, the script on stack continues (in this case: your script).
If you want to stop the interrupt and let your own script handle this situation, your script needs a higher priority than the script that is interrupting.
So you should be fine with priority 100.

No problems with other scripts. The priority counts only, if scripts are "battling for dominance".
Have fun: Gala Do.

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Mon, 2. May 05, 01:13

the "start task" command up top will do just fine, except rather than attaching that "start task" call to a menu command, have the spawning script make the "start task" call so that it starts the task running. there's really no need to mess with priorities, since what this script is going to do is just launch fighters. if you did run it in task 0 (default task), the carrier would never do anything else besides sit in one spot and launch fighters when you get close to it. the carrier needs to have task 0 free to do it's normal wandering around and engaging, so you need to start the script on another free task (like 10 or 11, which are the secondary ship tasks, or something up in the hundreds).
//----------------------------------
--the milling_hordesman

Me Mods

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Mon, 2. May 05, 13:37

I'm starting to get it now ..

if (wich it isnt) the QFLS would be general command than I would have to use prioritys to make them work and not something stock

and if (wich it is)the QFLS is an add. command than I would have to give it a 'high' task number


'high' -> smart to be higher than at least 9 (knowing now that 10 and 11 ar for the add. commands)


so by putting that "start task with script"(lets say task 511) thing in the script that spawns .. and than just in the "not 'while true'" part of the QFLS .. start the "attack_enemies" command ..?

EDIT: tnx guys .. I have donne what I said here above .. and it works .. just a bit more testing and I'll put it up here as well .. just tried it a couple times with a Condor filled with 40 Orinocos .. took them about 30sec to get me killed .. but it does look nice .. having 40 orinocos on your back .. that can outrun you as well .. (my game has all ships modded .. orinocos have BHEPTS and 3*25MW shields going at a max off 218 .. my Nova can only do 200 .. :shock: )

User avatar
milling_hordesman
Posts: 372
Joined: Mon, 1. Mar 04, 06:16
x3

Post by milling_hordesman » Mon, 2. May 05, 19:11

come to think of it, you probably should give the launching task a priority of at least 100, anyways, so that it won't be interrupted by other fight scripts and it will complete its launch. just at thought, and not one you necessarily need to pay attention to unless you notice adverse behavior at some point because of it.
//----------------------------------
--the milling_hordesman

Me Mods

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Mon, 2. May 05, 20:16

I easily gave it task 511 (G5-11)

and it works .. have been messing with it all day .. spawning Carriers in Loomanstrats Legacy and going there with my new Sentinal (the mini-carrier) to do some battle .. now AI can really launch a massive attack ..

tnx for all the help M_H .. :)

User avatar
Burianek
Posts: 2981
Joined: Mon, 29. Dec 03, 03:29
x3tc

Post by Burianek » Tue, 3. May 05, 01:07

As far as task numbers, to avoid bumping up against turrets and additional commands etc. use 21 and higher. There could potentially be task conflicts between scripts just like there are command slot conflicts, but only if you're trying to run both scripts at the same time on the same ship. Probably unlikely.
Cheers.
"Nature's first green is gold" . . . stay golden.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Tue, 3. May 05, 13:24

*making note off that*

:)

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Fri, 20. May 05, 19:57

I've made a 3th version of the script .. 1 for M6's

it simply checks for enemies within 6k .. and if so .. launches the docked fighter .. sets it on "attack same" .. and if there are no more enemies in range (10k) .. the fighter gets the command to return home .. (it gets sucked in the bay at about 1.5k .. so the M6 doesnt get bothered with the (un)docking proces)
(it checks for fighters .. not for M5's .. so its also usable with the modded ability to dock M4/3's at a M6..)

I havent put it up for DL .. if there are people interested .. just let me know here or via PM ..;)

EDIT: Also I'm going to redo the original script so that its split up in 3 parts

-QFLS Auto -as it is now
-QFLS Attack -form up wings and set em on "attack same" (more or less the same as the first .. only more usable by the user io AI)
-QFLS Protect -form up a couple a wings and coupla a M5's on miss. def. (easy to create/launch 3 (or 4.. 5)wings of fighters .. and let em do what you want or leave em to give the carrier some good protection)

Harlock776
Posts: 2261
Joined: Wed, 9. Mar 05, 21:53
x2

Some ideas

Post by Harlock776 » Sat, 21. May 05, 07:05

Here is a better name for your script I remembered it from an fmv sequence from wing commander3 something that Admiral Tolwyn said to Captain Eisen... "Magnum Launch" hehe it sounds so kool:-)

Also can you do this with your scripts? Have a way to arm one ship and the carrier arms all other ships of the same type and class the same way. You can set up 50 bombers with the setup from only one bomber this way and also when they return home the carrier will re arm the bombers. Infact it should re arm any carrier owned ships whenever they return. After a fight with 150 ships floating around and they all re dock, some of them are bound to be missing some guns and will most definitely be out of missiles.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Fri, 27. May 05, 11:53

new update .. :D

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sun, 29. May 05, 20:08

I'm in the process of completelly redoing this script .. and boy is it becoming deadly now .. a bit to deadly ..

I changed the range for the auto-launch script so it was set by the player..
I've allready set it so you cant go over a 40k scan ..

but now I would like to know if people would like/use the idea off the carrier being able to launch scouts wich only serve to increase the scanner-radius (like scout-planes on a real carrier) .. and if they spot an enemy .. signal the carrier to launch fighters at the designated target .. but not like with the auto-launch (launching all fighters) .. but launching 1 wing (size off the wing set by the player) to engage the enemy .. also it will not do any scans on its own .. it will engage, kill/or be killed and return home ..

G

AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw » Sun, 29. May 05, 20:29

Sounds like an AWACS.

Trouble is, in space, there's technically no range limits on scanners. We use AWACS because on earth, a carrer's radar can't scan much further than the horizon.

User avatar
Red Spot
Posts: 3461
Joined: Fri, 4. Feb 05, 13:44
x3

Post by Red Spot » Sun, 29. May 05, 22:42

yeah .. but still its a bit easy to set the scan range to 50k .. and never even have the "danger-music" playing cause nothing ever gets close ..

it would however be kinda cool to see how there seems to be some comunication between ships (wich I seem to have been able to do with the wings .. pretty sweet to watch a Carrier decides wich fighters are launch ready (no hull-damage) launch them in wings .. the leader being completely automated (engages/docks/re-engages when necessery) and the wingmen checking the leaders actions .. and basing there own actions on that (small ships even try to flee if the leader gets killed .. :D ))

and taking this to a next level .. by having a seperate scout increasing the scanrange .. I already decided I'm going for it ..(put the max-scan range of the carrier at 25k)

but I'm not yet sure about how to ?!? ..

-should the scout send out a mess. .. and let you decide what to do at such a range
-should the scout inform the carrier .. and have the carrier launch 1(or 2 maybe 3) wings
-should the scout inform the carrier .. and have the carrier launch every full wing

??????

I guess it be something like .. launch 1 scout (carrier command) let it patrol 4 waypoints around the carrier (constantly shifting these waypoints in relation to the carrier)..
as soon as the scout gets a enemy in scanner range it will allert the carrier and retreat (return to the carrier) .. you get a simple warning-sound .. the carrier sends out 2 wings (wich could perhaps check each other .. to make sure they arrive at the same time)..
attack .. kill .. return home .. the scout undocks and returns to its scanning duties ..


while writing this .. I got an other idea .. I think I might add this bit to the "auto-com" so when it has a M5 docked it gets send out to scan and increase the scanrange (triggering this by entering a scan-range that is above 25 or 30k ..) .. but that will mean I will remove the M5's from the auto-launching (there worthless in battle anyway ..)

also doing the same for the station auto-launch as well .. this way you have a scout patrolling the sector .. but the rest off the ships can stay docked .. and also its abit more fun than just setting the scanrange for fabs at 50 or 60k ..

well now my fingers hurt .. so bye bye .. :shock:

G

Return to “X²: The Threat - Scripts and Modding”