Page 1 of 1

a variable for setsize?

Posted: Tue Nov 01, 2005 11:36 pm
by kkcahdcakcyt
I've been trying to have the setsize of a trigger change depending on the out come of a switch. I have a thread spawning the trigger and it calls to the thread "get_origin" for a random origin, by the use of the switch. I was hoping to have a different set size for different origins.

I've tried various ways but it hasn't work. I was trying this type of set up where level.size1 and level.size2 are defined differently in the switch.

get_origin:

switch (randomint(5)+1)
{
case 1:
level.origin = ( 200 500 10 )
level.size1 = "1 -1 -1"
level.size2 = "500 300 180"
break
...(same thing repeated for diff cases)
}
end level.origin //sent back to the thread asking for origin

//---------------------------------- skipping to trigger
spawn trigger_mulitple "targetname" "hill"
$hill.origin = thread get_origin
$hill setsize (level.size1) (level.size2)
$hill setthread trigger

post

Posted: Wed Nov 02, 2005 1:28 am
by tltrude
I can't see anything wrong with what you posted, but you might try putting the whole thing in each case.

case 1:
spawn trigger_mulitple targetname "hill"
$hill.origin = ( 200 500 10 )
$hill setsize ( 1 -1 -1 ) ( 500 300 180 )
$hill setthread trigger
break

I do see one flaw, There is a bug in scripting negitive numbers. There has to be a space between them and a bracket "( )".

So, this is wrong:

(1 -1 -1)

And this is right:

(1 -1 -1 )

It does not hert to use a space for positive numbers, so what I do is just put spaces for all bracketed numbers.

$hill setsize ( level.size1 ) ( level.size2 )

Posted: Wed Nov 02, 2005 3:05 am
by kkcahdcakcyt
thanks! I got it working sadly not by using
$hill setsize ( level.size1 ) ( level.size2 )
But by repeating the spawing....looks ugly but it works :D