I'm trying to understand the logic in the scripts...
When I create two different ships (M1+M2) I want to set the M2 to protect the M1.
The script creating the M1 is calling a 2nd script creating the M2.
Here's my code:
Code: Select all
001 $Carrier = create ship: type=Colossus owner=Player addto=$CurentSector x=0 y=0 z=0
002 $Carrier -> command COMMAND_KILL_ENEMIES : arg1=$CurentSector, arg2=null, arg3=null, arg4=null
003 = [THIS] -> call script A.CreateDestroyer4Fleet1 : Ship2Protect=$Carrier
its code is:
Code: Select all
001 $Protector = create ship: type=Titan owner=Player addto=$CurentSector x=0 y=0 z=0
002 START $Protector -> command COMMAND_PROTECT : arg1=$Ship2Protect, arg2=null, arg3=null, arg4=null
The M1 is running on its command (KILL ENEMIES) perfectly but the M2 is without any command at all.
However, if I change '$Ship2Protect' to 'PLAYERSHIP' in the second script, the M2 will instantly start protecting me...
It seems like the script creating the M1 cannot handover the Info to the second script... But I don't see why...
Why is my script not working - i.e. why is the M2 without any command?
Any ideas?
Thanks for your help