Syntax help please...
by Jesse Hall · in Torque Game Builder · 06/28/2005 (12:56 pm) · 4 replies
I am putting a world limit to the projectiles for 2 tank turrets and am having a hard time with some code.. im am still learning scripting.
$tankShell:cannon1.setWorldLimit( kill, ( ($player.getpositionX() - $rangePlayer)
($player.getpositiony() - $rangePlayer ) ( $player.getpositionX() + $rangePlayer )
( $player.getpositiony() + $rangePlayer ) ) );
basicly im trying to create a world limit and then restrict the shells range by the variable $rangePlayer.
thank you for any help.. the help so far has been very appreciated!
- Jesse
$tankShell:cannon1.setWorldLimit( kill, ( ($player.getpositionX() - $rangePlayer)
($player.getpositiony() - $rangePlayer ) ( $player.getpositionX() + $rangePlayer )
( $player.getpositiony() + $rangePlayer ) ) );
basicly im trying to create a world limit and then restrict the shells range by the variable $rangePlayer.
thank you for any help.. the help so far has been very appreciated!
- Jesse
About the author
#2
So in your case you'd want something like:
I havn't had chance to look at the ref docs so take my advice with a pinch of salt and check the docs yourself to be sure.
06/28/2005 (4:38 pm)
In addition to Philips point about using :: check what setWorldLimit is expecting as the second parameter. I can't remember but I'd guess its either a set of parameters seperated by commas, or a single string seperated by spaces eg "1 20 10 100"So in your case you'd want something like:
$tankShell::cannon1.setWorldLimit( kill,
($player.getpositionX() - $rangePlayer) SPC
($player.getpositiony() - $rangePlayer ) SPC
( $player.getpositionX() + $rangePlayer ) SPC
( $player.getpositiony() + $rangePlayer )
);I havn't had chance to look at the ref docs so take my advice with a pinch of salt and check the docs yourself to be sure.
#3
everything else was working with a single : but ill add the second : so i dont run into some other problems. The part that was throwing me was the spaces. I backed up and tried some more experiments and couldnt get it to work. I even tried adding in the spc's but found out the hard way it needs to be in caps SPC.
06/28/2005 (4:56 pm)
Thanks both of you!everything else was working with a single : but ill add the second : so i dont run into some other problems. The part that was throwing me was the spaces. I backed up and tried some more experiments and couldnt get it to work. I even tried adding in the spc's but found out the hard way it needs to be in caps SPC.
Torque Owner Philip Mansfield
Default Studio Name