moving spawn?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

moving spawn?

Post by ViPER »

can you bind a spawn to a moving object?
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

anybody know ? is it possible to script this?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I don't know anyone who has tried that .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

simple bind doesn't work, thought there might be a way to move local.origin around.
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

how can i get the origin of a moving thing?

targetname movingthing
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

movingthing.origin

but... why would you bother binding a spawn to another object? you can move spawns normally.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

You cannot, spawnpoints are determined before prespawn, you cannot move them later on.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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)
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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
Post Reply