Need help with TELEPORT !

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
GR3KO
Lance Corporal
Posts: 22
Joined: Fri Aug 16, 2013 1:59 pm

Need help with TELEPORT !

Post by GR3KO »

I tryed to add teleport point in remagen map (mohaa sh server) one for axe and one for allies.
I use " viewpos " for coord and use this script :

Code: Select all

tele_test1:

 local.lights1 = spawn script_model "model" "fx/corona_red.tik" 
 local.lights1.origin = ( 5013 -3343 339 )

 local.trig1 = spawn trigger_multiple 
 local.trig1.origin = ( local.lights1.origin )
 local.trig1 setsize ( -20 -20 0 ) ( 20 20 80 )
 local.trig1 waittill trigger
 parm.other tele ( 2501 -2019 209 )
 parm.other.viewangles = ( 0 -55 0 )
 local.lights1 remove
 local.trig1 remove
 wait 5

thread tele_test1


end  


tele_test2:

 local.lights2 = spawn script_model "model" "fx/corona_red.tik" 
 local.lights2.origin = ( 621 203 247 )

 local.trig2 = spawn trigger_multiple 
 local.trig2.origin = ( local.lights2.origin )
 local.trig2 setsize ( -20 -20 0 ) ( 20 20 80 )
 local.trig2 waittill trigger
 parm.other tele ( 2305 -1794 21 )
 parm.other.viewangles = ( 0 -130 0 )
 local.lights2 remove
 local.trig2 remove
 wait 5

thread tele_test2


end
the first one is in house axe spawn (washroom place) and teleport to center house 2floor after kitchen near balcony (this one works well )
the sec one is in the pub in allies spawn and supose to teleport to the center house first floor Under kitchen (but the corona doesnt appear and not working)

can someone help me with this and explain me why the first one work and not the second one?
And does the viewangle is important ?

Thanks a lot !!

Gr3ko.
BatteryAziz
Moderator
Posts: 82
Joined: Tue Jun 15, 2010 4:44 pm

Re: Need help with TELEPORT !

Post by BatteryAziz »

don't forget "thread tele_test2" in your main: thread after level waittill spawn.
GR3KO
Lance Corporal
Posts: 22
Joined: Fri Aug 16, 2013 1:59 pm

Re: Need help with TELEPORT !

Post by GR3KO »

what you mean ?

i dont understand .

:D
GR3KO
Lance Corporal
Posts: 22
Joined: Fri Aug 16, 2013 1:59 pm

Re: Need help with TELEPORT !

Post by GR3KO »

do you mean i have to put all the teleport script after " level waittill spawn " ?
BatteryAziz
Moderator
Posts: 82
Joined: Tue Jun 15, 2010 4:44 pm

Re: Need help with TELEPORT !

Post by BatteryAziz »

when a map is loaded, the main thread of the map's script is started.

main:
...
...
...
end

if you add stuff in your script you put them in new threads, so first you have main: ........ end and after that my_thread: ........ end. you have to start these threads with "thread my_thread" after level waittill spawn.

remagen should be this:

Code: Select all

// REMAGEN
// ARCHITECTURE: STAGGER
// SCRIPTING: POWZER

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm3"

	// call additional stuff for playing this map round based is needed
	if(level.roundbased)
		thread roundbasedthread

	level waittill prespawn
	
	//*** Precache Dm Stuff
	exec global/DMprecache.scr
	
	level.script = maps/dm/mohdm3.scr
	exec global/ambient.scr mohdm3
	
thread global/door_locked.scr::lock

	level waittill spawn
	$world farclipoverride -1
	
	thread tele_test1				// <-----------------
	thread tele_test2				// <-----------------

end

//-----------------------------------------------------------------------------

roundbasedthread:

	// Can specify different scoreboard messages for round based games here.

	level waitTill prespawn

	level waittill spawn

	// set the parameters for this round based match
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = kills // set to axis, allies, kills, or draw

	level waittill roundstart

end

///////////// YOUR STUFF //////////////////////

tele_test1:

local.lights1 = spawn script_model "model" "fx/corona_red.tik" 
local.lights1.origin = ( 5013 -3343 339 )

local.trig1 = spawn trigger_multiple 
local.trig1.origin = ( local.lights1.origin )
local.trig1 setsize ( -20 -20 0 ) ( 20 20 80 )
local.trig1 waittill trigger
parm.other tele ( 2501 -2019 209 )
parm.other.viewangles = ( 0 -55 0 )
local.lights1 remove
local.trig1 remove
wait 5

thread tele_test1

end  


tele_test2:

local.lights2 = spawn script_model "model" "fx/corona_red.tik" 
local.lights2.origin = ( 621 203 247 )

local.trig2 = spawn trigger_multiple 
local.trig2.origin = ( local.lights2.origin )
local.trig2 setsize ( -20 -20 0 ) ( 20 20 80 )
local.trig2 waittill trigger
parm.other tele ( 2305 -1794 21 )
parm.other.viewangles = ( 0 -130 0 )
local.lights2 remove
local.trig2 remove
wait 5

thread tele_test2

end
hope this helps. it's really basic stuff, before you have any more question it would help a lot if you read up on some guides so you have a better understanding about the fundamentals
GR3KO
Lance Corporal
Posts: 22
Joined: Fri Aug 16, 2013 1:59 pm

Re: Need help with TELEPORT !

Post by GR3KO »

cool work well thanks my friend :D

your the best !!

Gr3ko
Post Reply