Page 1 of 1
moving spawn?
Posted: Tue Aug 16, 2005 7:14 pm
by ViPER
can you bind a spawn to a moving object?
Posted: Wed Aug 17, 2005 6:22 pm
by ViPER
anybody know ? is it possible to script this?
Posted: Wed Aug 17, 2005 9:10 pm
by bdbodger
I don't know anyone who has tried that .
Posted: Wed Aug 17, 2005 9:48 pm
by ViPER
simple bind doesn't work, thought there might be a way to move local.origin around.
Posted: Thu Aug 18, 2005 8:13 pm
by ViPER
how can i get the origin of a moving thing?
targetname movingthing
Posted: Thu Aug 18, 2005 9:47 pm
by lizardkid
movingthing.origin
but... why would you bother binding a spawn to another object? you can move spawns normally.
Posted: Thu Aug 18, 2005 11:31 pm
by Rookie One.pl
You cannot, spawnpoints are determined before prespawn, you cannot move them later on.
Posted: Fri Aug 19, 2005 5:34 am
by ViPER
Well, maybe he means you can move them by switching one off then the next on. I could do that but -
Can you get a return origin on a moving object????????????
Maybe i can tele the spawn point to a moving destination, Huh?
Posted: Fri Aug 19, 2005 7:57 am
by lizardkid
nope. judging from what Rookie said spawnpoints are deleted and their origins recorded before the map is even fully loaded.
your best bet is to make a lot of spawns around your map and enable/disable as needed.
.origin is the coordinates of an entity at whatever time you ask for it. for instance:
Code: Select all
playerTracker:
// tracks the player through the virtual space
while(isAlive $player)
{
iprintln $player.origin
wait .1
}
end
that would spam your screen with messages on the player's coordinates. (note it'd be cleaner to use huddraw but this was an example)
Posted: Fri Aug 19, 2005 8:20 am
by ViPER
Yea but teleport destinations can be added at any time.
the spawn is the same. the tele start is the same. the tele destination -
moves.
So maybe something like -
Code: Select all
movingdest.origin = (($movingthing.origin) + ( 0 0 140))
wont that just return the spawn origin of movingthing?
Posted: Fri Aug 19, 2005 8:51 am
by bdbodger
So put a trigger where the spawnpoint is and bind a script_object to the moveing thing so when the trigger is triggered you can tele the player to the script_objects origin .
Posted: Fri Aug 19, 2005 9:03 am
by ViPER
this works -
the trigger is set over a series of background spawns - player spawns on top of a moving box.
Code: Select all
test_moving_origin:
spawn script_origin "targetname" "nodetest1"
$nodetest1.origin = ( 4365 -5213 -485 )
spawn script_origin "targetname" "nodetest2"
$nodetest2.origin = ( 4365 -6355 -485 )
local.static = spawn script_model targetname testbox
$testbox model "static/indycrate.tik"
$testbox.origin = ( 4365 -6355 -485 )
thread teleport1
thread movetest
end
teleport1:
local.trig1 = spawn trigger_multiple
local.trig1.origin = ( 1133 -2902 -12 )
local.trig1 setsize ( -200 -200 -20 ) ( 200 200 20 )
local.trig1 setthread court1
wait 1
local.trig1 delay 0
end
court1:
self waittill trigger
local.player=parm.other
if (local.player.iscourt==1)
end
local.origin = $testbox.origin
local.player.iscourt=1
local.player tele ((local.origin) + ( 0 0 100))
local.player.iscourt=0
end
movetest:
while(1)
{
wait 2
$testbox moveto $nodetest1
$testbox speed 20
$testbox waitmove
wait 2
$testbox moveto $nodetest2
$testbox speed 20
$testbox waitmove
}
end