Help needed. Trying to arm multiple ships...

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

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

Thraxwhirl
Posts: 683
Joined: Fri, 17. Feb 06, 20:54
x3ap

Help needed. Trying to arm multiple ships...

Post by Thraxwhirl »

...WITHOUT doing it manually, one by one.

Hello. I'm trying to write a script that will install weapons into MULTIPLE ships and then install the armament, ready for use. In particular, I've centred upon Argon Novas, which are my Wingmen of choice.

Now, it's easy enough to create a Find.Multiple loop that identifies all Novas aboard a given station. No problem there...

...and of course, weapons and shields are easy enough. Install a weapon in a ship, and it automatically puts it into an available bay or turret. Similarly the game will auto-install your shields into available bays.

However, it doesn't do the same with missiles. Put, say, twenty Hornet Missiles into fifty Novas, and you've then got to go to the Comm Console for EACH SHIP individually and load them into the missile bays yourself. Otherwise, the Missiles will just sit pretty in the ships' cargo holds. Pretty, that is, but useless.

Can anyone tell me if there's a way to script a line which will tell the ship(s) to select the Hornet Missiles?


The other problem I have is with Turrets. Try as I might, I cannot seem to script the Commands for either "Attack all Enemies"(for those Novas with too few Millitary Personnel), nor "Gunnery Crews: Action Stations"(for those with enough). Without being able to do this, the Novas will never use their turrets unless I instruct them manually, one by one.

They have only one turret each(Rear), but I can't seem to find the correct values to identify it. I figured either Turret 1, Slot 1(since it's the Nova's ONLY turret) or possibly 2, 1(if Rear is 2 by default)...

...This was in a test I ran, when I asked the Computer to determine whether or not to the Nova(s) should be loaded up with Mass Driver Ammo. IF the Weapon in Turret x, x etc. But whatever numbers I tried, (1,1, 2,1, 3,1 even 4,1), it didn't work.

Can anyone help me with this? I'll go mad if I have to select Missiles and activate Gunnery Crews for about 200 Novas individually.

Thanks.
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

have you tried:

Code: Select all

<RetVar/IF> <RefObj> is missile <Var/Ware> ready to fire

or

<RetVar/IF> <RefObj> find best missile for target <Value>
for selecting missiles? I've never tried this so I don't know whether it works or not. In X3 we don't need to set the correct missile to use. I don't recall if it's the same in X2.

finding weapons in turrets. Turret 0 is the main guns, the first turret is 1. Weapon slots are numbered from 0 upwards. So the nova's rear turrest should be turret 1, slot 0

to start turret commands from a script you need to use

Code: Select all

<RefObj> start task <Var/Number> with script <Script Name> and prio <Var/Number>: arg1=<Value> arg2=<Value> arg3=<Value> arg4=<value> arg5=<Value>
where RefObj is the ship and the Task is the turret number, in the case of the Nova, task 1

I think the turret command scripts are !turret.cmd.attack or something like that.
Thraxwhirl
Posts: 683
Joined: Fri, 17. Feb 06, 20:54
x3ap

Post by Thraxwhirl »

Hello, Moggy.

Good of you to help. Thank you very much.

Well, seems that this has helped me make some progress, at least on the Turrets. Thanks to your input, I can now easily instruct my Novas en masse to "Attack All Enemies", and even to perform the Gunnery Crews actions, so thank you so much for your help there. :)

Unfortunately those suggestions aren't helping with the missiles. :( So I'm having to do that manually. However, I HAVE been able to alter the Missile Firing Probability.

But a thought occurs to me. There MAY be a clue in the "Gunnery Crews Missile Assault" script, as I THINK that running that one auto-loads your best missile into the bay, but I'll have to check.

In order to run THAT one though, I need to know how to run a script - not for Turrets, but Additional Ship Slots(the one below Turrets)...

...Are you able to help with that? I tried it just a moment ago by running the same "Tasks" instruction(as shown above in your post), with "Electronic Counter Measures" instead of "Attack All Enemies", but(perhaps unsurprisingly) it ran that script in the Turret Slot, instead of Additional.

So...

...Are you able to tell me how to run a Script(like ECM and Gunnery Assault) from the Additional Command Slots?

I'd be grateful, and thanks so much for your help thus far. :)
User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 »

the extra ship command slots are tasks 10 and 11. You start scripts on them in the same way you start turret scripts.
Thraxwhirl
Posts: 683
Joined: Fri, 17. Feb 06, 20:54
x3ap

Post by Thraxwhirl »

Ah, thanks ever so much. That's a big help.

So, if 1 to 6 are Turrets, and 10 and 11 are Additional Commands, what are 7 through 9? Do you know?

Sorry to be flinging so many questions at you... but thank you for helping out.

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