Hey, just trying to get my feet weet here with scripting. Its not as easy as it would seem if you haven't had much xp with codeing caue there are lots of little rules you have to follow that would be second nature or common sence to a xped coder. What I am trying to do is create a simple script that will tell a ship to head home and unload its ware and then wait for my orders. This is what I have come up with so far but it doesn't work..I am missing something... any help would be great..
001 @ = [THIS] -> call script '!move.returntohomebase' :
002 [THIS] -> set destination to null
003
004 $load = [THIS] -> get true amount of ware $ware in cargo bay
005
006 if [DOCKEDAT] == [HOMEBASE] AND $load
007 = [THIS] -> unload $load units of $ware
008 end
009 [THIS] -> set destination to null
010
011 return null
A little help with a script please.........
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 985
- Joined: Sun, 7. Dec 03, 05:15
thanks to Dr. Xavia I got a working code..
Arguments
1: ware , Var/Ware of Ship , 'select ware'
Source Text
001 @ = [THIS] -> call script '!move.returntohomebase' :
002
003 $ware = $ware[0]
004 * note the [0], means last in an array (Var/Ware of Ship is an array) of 2, ship being [1], that is first in the array, and ware being last [0]
005 $wareincargo = [THIS] -> get true amount of ware $ware in cargo bay
006 if [DOCKEDAT] == [HOMEBASE] AND $wareincargo
007 = [THIS] -> unload $wareincargo units of $ware
008 end
009 return null
For use when you want your ship to unload a certain cargo and then wait for your orders
Arguments
1: ware , Var/Ware of Ship , 'select ware'
Source Text
001 @ = [THIS] -> call script '!move.returntohomebase' :
002
003 $ware = $ware[0]
004 * note the [0], means last in an array (Var/Ware of Ship is an array) of 2, ship being [1], that is first in the array, and ware being last [0]
005 $wareincargo = [THIS] -> get true amount of ware $ware in cargo bay
006 if [DOCKEDAT] == [HOMEBASE] AND $wareincargo
007 = [THIS] -> unload $wareincargo units of $ware
008 end
009 return null
For use when you want your ship to unload a certain cargo and then wait for your orders
