Hi All
Struggling with this one a little, looking for a way to programatically set a turrets command to missile defence.
There's the whole $turret -> set command: TURRET_MISSLE_DEFENCE but I'm struggling to find a command that will allow me to set $turret to be assigned to the turret in question.
Can someone help a scripting newbie out?
Programatically setting turret command
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Turret scripts use tasks 1-6 on the ship.
You
START SCRIPT on task 1-6, supplying the same number as "argument 1".
(the argument is some nonsensical legacy issue that my turret scripts don't have)
With setting turret COMMANDS you're probably referring to the default scripts that are assigned to turret commands at setup time.
That doesn't matter if you want to start a turret script when you want to.
But to be honest, I'm not entirely sure what your question is...
You
START SCRIPT on task 1-6, supplying the same number as "argument 1".
(the argument is some nonsensical legacy issue that my turret scripts don't have)
With setting turret COMMANDS you're probably referring to the default scripts that are assigned to turret commands at setup time.
That doesn't matter if you want to start a turret script when you want to.
But to be honest, I'm not entirely sure what your question is...
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
Somthing along the lines ofHornet108 wrote:Hmm, my question boils down to I have a script creating ships, and I would like to automatically set the turrets on those ships to missile defence as their created without the need to go through all of them manually.
Code: Select all
$turrets = $object->get number of turrets
while $turrets
* always dec after the begin command in this situation, as 0 is the cockpit/autopilot
$object->begin task $turrets with script 'TurretScript' and priority 0: arg1=$turrets arg2=null arg3=null arg4=null arg5=null
dec $turrets
end
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire