press use to teleport on an item

Post your scripting questions / solutions here

Moderator: Moderators

User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

press use to teleport on an item

Post by Darksoul »

Code: Select all

//Script File Created By AlienX Softwares Map To Script Converter! 
card:
local.alienx = spawn script_model
local.alienx model "miscobj/singlecard.tik"
local.alienx.origin = (  -103.61 -32.70  328.32 )
local.alienx.scale = 1.0
local.alienx.angle = 0

end

teletrig:

local.trig = spawn trigger_multiple
local.trig.origin = ( -103.61 -32.70  328.32 )
local.trig setsize ( -40 -40 -15 ) ( 40 40 15 )
local.trig targetname port
$port setthread teleport

end

teleport:

self waittill trigger
local.player = parm.other
local.player tele ( -386.62 3431.10 414.57 )

end
i know im missing stuff but this was to test .
in crossroads the card should be infront of the sand bag (middle of bridge)

the coords for the teleport is the same as the card (in case if its just walk into and you teleport)

the card didn't show up and no teleport

am i missing something very obivious?
Last edited by Darksoul on Sun Feb 12, 2006 7:20 am, edited 1 time in total.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

card

Post by tltrude »

The card is kind of small, but it should show up, if the coordinates are correct. Try setting the last number, of the three, a little higher, say about 332.

Also, you don't need this line, "self waittill trigger" because that thread is not run until the a player walks into the trigger_multiple.
Tom Trude,

Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

no dice still didn't see it.
i'm going to try and make the card something bigger
hopefully that works
--------------------------
my game must be screwed up - still didn't see it
and i exec'd it the map just like elgans spin.scr
Last edited by Darksoul on Sun Feb 12, 2006 7:18 am, edited 1 time in total.
Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

just tried it - the put in map script way -
still nothing

Code: Select all

// THE BRIDGE
// ARCHITECTURE: POWZER
// SCRIPTING: POWZER

main:

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

setcvar "g_scoreboardpic" "mohdm4"

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

	level waittill prespawn

               exec maps/dm/spin.scr
	exec maps/dm/weap_mode.scr
	exec global/sticky_bombs.scr
//	exec maps/dm/card.scr
	teletrig.

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	exec global/door_locked.scr::lock
	level.script = maps/dm/mohdm4.scr
	exec global/ambient.scr mohdm4
	
	thread global/minefield.scr::minefield_setup

	exec maps/dm/fix4.scr

	level waittill spawn
card:
local.alienx = spawn script_model
local.alienx model "items/gasmask_pulse.tik"
local.alienx.origin = (  -103.61 -32.70  332.32 )
local.alienx.scale = 1.0
local.alienx.angle = 0

end

teletrig:

local.trig = spawn trigger_multiple
local.trig.origin = ( -103.61 -32.70  332.32 )
local.trig setsize ( -40 -40 -15 ) ( 40 40 15 )
local.trig targetname port
$port setthread teleport

end

teleport:

local.player = parm.other
local.player tele ( 12.17 2987.01 300.13 )

end

thread hello // 


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
nothing shows up just looks like the ordinary stock map
Last edited by Darksoul on Sun Feb 12, 2006 7:21 am, edited 1 time in total.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

threads

Post by tltrude »

Try this:

Code: Select all

// THE BRIDGE 
// ARCHITECTURE: POWZER 
// SCRIPTING: POWZER 

main: 

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

setcvar "g_scoreboardpic" "mohdm4" 

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

   level waittill prespawn 

   exec maps/dm/spin.scr 
   exec maps/dm/weap_mode.scr 
   exec global/sticky_bombs.scr 

   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/mohdm4.scr 
   exec global/ambient.scr mohdm4 
    
   thread global/minefield.scr::minefield_setup 

   exec maps/dm/fix4.scr 

   level waittill spawn 

   thread marker
   thread teletrig


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

marker:
 
   local.alienx = spawn script_model 
   local.alienx model "static/corona_orange.tik" 
   local.alienx.origin = ( -103.61 -32.70 332.32 ) 
   local.alienx.scale = 1.0 
   local.alienx.angle = 0 

end 

teletrig: 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( -103.61 -32.70 332.32 ) 
   local.trig setsize ( -40 -40 -15 ) ( 40 40 15 ) 
   local.trig targetname port 
   $port setthread teleport 

end 

teleport: 

   local.player = parm.other 
   local.player tele ( 12.17 2987.01 300.13 ) 

end 

Last edited by tltrude on Thu Sep 16, 2004 1:28 am, edited 2 times in total.
Tom Trude,

Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

still didn't work
i see this in my qconsole log

Code: Select all

-------------------- Actual Spawning Entities -----------------------
-------------------- Actual Spawning Entities Done ------------------ 5 ms
^~^~^ Game (Event: 'light', Object: 'World') : Couldn't convert string to vector - malformed string '85'
0 teams with 0 entities
bad token:
TOKEN_MINUS:
-

   local.alienx.origin = (  -103.61 -32.70  332.32 )  (maps/dm/mohdm4.scr, 68)
   local.alienx.origin = (  ^

^~^~^ Script file compile error:  Couldn't parse 'maps/dm/mohdm4.scr'
ScriptMaster::GetScript: Script 'maps/dm/mohdm4.scr' was not properly loaded

68 entities spawned
134 simple entities spawned
0 entities inhibited
-------------------- Spawning Entities Done ------------------ 46 ms
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

Thanks tltrude
i somehow kept paking it wrong
it works :D
--------------
but i don't see what im doing till i load it on the server
no idea why either - used to work right
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bad token

Post by tltrude »

That line has an extra space in it. There should be only one space between the bracket and the negitive sign.

local.alienx.origin = ( -103.61 -32.70 332.32 )

By the way, those fractions of a uint are not really needed. It is better to round them off to the nearest unit, like this.

local.alienx.origin = ( -104 -33 332 )
Last edited by tltrude on Thu Sep 16, 2004 1:26 am, edited 1 time in total.
Tom Trude,

Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

yup its workin
trying to add more teleports right now
will post back here if i can't get it
~thanks for the help
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

adding more teleports doesn't work just by doing this

Code: Select all

   thread marker2
   thread teletrig2

marker: 
  
   local.alienx = spawn script_model 
   local.alienx model "static/corona_orange.tik" 
   local.alienx.origin = ( -103.61 -32.70 332.32 ) 
   local.alienx.scale = 1.0 
   local.alienx.angle = 0 

end 

teletrig: 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( -103.61 -32.70 332.32 ) 
   local.trig setsize ( -40 -40 -15 ) ( 40 40 15 ) 
   local.trig targetname port2 
   $port setthread teleport2

end 

teleport2: 

   local.player = parm.other 
   local.player tele ( 12.17 2987.01 300.13 ) 

end 
i have looked at other ppl's teleports but they have stuff in it that i don't have in here
^- used that same tele as a example cause i acidently deleted the other one i did
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

nicer

Post by tltrude »

Here is a nicer script. You only have to add one line to make a new teleporter. Like this:

thread trigger_maker ( 120 828 240 ) ( 341 3900 324 ) // trigger & destination

Code: Select all

// THE BRIDGE 
// ARCHITECTURE: POWZER 
// SCRIPTING: POWZER 

main: 

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

setcvar "g_scoreboardpic" "mohdm4" 

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

   level waittill prespawn 

   exec maps/dm/spin.scr 
   exec maps/dm/weap_mode.scr 
   exec global/sticky_bombs.scr 

   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/mohdm4.scr 
   exec global/ambient.scr mohdm4 
    
   thread global/minefield.scr::minefield_setup 

   exec maps/dm/fix4.scr 

   level waittill spawn 

   thread trigger_maker ( -104 -32 332 ) ( 12 2987 300 ) // trigger & destination
   thread trigger_maker ( 120 828 240 ) ( 341 3900 324 ) // trigger & destination

end 

trigger_maker local.location local.dest: 
  
   local.marker = spawn script_model 
   local.marker model "static/corona_orange.tik" 
   local.marker.origin = (local.location) 

   local.trig = spawn trigger_multiple 
   local.trig.origin = (local.location) 
   local.trig setsize ( -20 -20 -20 ) ( 20 20 20 ) 

   thread teleport local.trig local.dest

end

teleport local.trig local.dest:

   local.trig waittill trigger
   local.player = parm.other 
   local.player tele (local.dest)
   thread teleport local.trig local.dest

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 
Tom Trude,

Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

ok i tried that instead - nothing works
no pic on the tab screen.. nothing
the only one that will work is the 1st one

Code: Select all

// THE BRIDGE 
// ARCHITECTURE: POWZER 
// SCRIPTING: POWZER 

main: 

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

setcvar "g_scoreboardpic" "mohdm4" 

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

   level waittill prespawn 

   exec maps/dm/spin.scr 
   exec maps/dm/weap_mode.scr 
   exec global/sticky_bombs.scr 

   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/mohdm4.scr 
   exec global/ambient.scr mohdm4 
    
   thread global/minefield.scr::minefield_setup 

   exec maps/dm/fix4.scr 

   level waittill spawn 

   thread marker 
   thread teletrig 


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 

marker: 
  
   local.alienx = spawn script_model 
   local.alienx model "static/corona_orange.tik" 
   local.alienx.origin = ( -103.61 -32.70 332.32 ) 
   local.alienx.scale = 1.0 
   local.alienx.angle = 0 

end 

teletrig: 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( -103.61 -32.70 332.32 ) 
   local.trig setsize ( -40 -40 -15 ) ( 40 40 15 ) 
   local.trig targetname port 
   $port setthread teleport 

end 

teleport: 

   local.player = parm.other 
   local.player tele ( 12.17 2987.01 300.13 ) 

end 
and tried repacking it and everything
with this

Code: Select all

// THE BRIDGE 
// ARCHITECTURE: POWZER 
// SCRIPTING: POWZER 

main: 

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

setcvar "g_scoreboardpic" "mohdm4" 

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

   level waittill prespawn 

   exec maps/dm/spin.scr 
   exec maps/dm/weap_mode.scr 
   exec global/sticky_bombs.scr 

   //*** Precache Dm Stuff 
   exec global/DMprecache.scr 

   exec global/door_locked.scr::lock 
   level.script = maps/dm/mohdm4.scr 
   exec global/ambient.scr mohdm4 
    
   thread global/minefield.scr::minefield_setup 

   exec maps/dm/fix4.scr 

   level waittill spawn 

   thread hello //
   thread trigger_maker ( 839.32 -1328.87  250.32 ) ( 12 2987 300 ) // trigger & destination 
   thread trigger_maker ( -109 4248 20.76 ) ( -91.99 -6.23 374 ) // trigger & destination 

end 
trigger_maker local.location local.dest: 
  
   local.marker = spawn script_model 
   local.marker model "static/corona_orange.tik" 
   local.marker.origin = ( 839.32 -1328.87  250.32 ) 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( 839.32 -1328.87  250.32 ) 
   local.trig setsize ( -20 -20 -20 ) ( 20 20 20 ) 

   thread teleport local.trig local.dest 

end 

teleport local.trig local.dest: 

   local.trig waittill trigger 
   local.player = parm.other 
   local.player tele ( 12 2987 300 ) 
   thread teleport local.trig local.dest 

end 

trigger_maker local.location local.dest: 
  
   local.marker = spawn script_model 
   local.marker model "emitters/adamspark.tik" 
   local.marker.origin = ( -109 4248 20.76 ) 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( -109 4248 20.76 ) 
   local.trig setsize ( -20 -20 -20 ) ( 20 20 20 ) 

   thread teleport local.trig local.dest 

end 

teleport local.trig local.dest: 

   local.trig waittill trigger 
   local.player = parm.other 
   local.player tele ( -91.99 -6.23 374 ) 
   thread teleport local.trig local.dest 

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 
==============================================
now its

Code: Select all

-------------------- Actual Spawning Entities -----------------------
-------------------- Actual Spawning Entities Done ------------------ 64 ms
^~^~^ Game (Event: 'light', Object: 'World') : Couldn't convert string to vector - malformed string '85'
0 teams with 0 entities
Duplicate label 'trigger_maker'
trigger_maker local.location local.dest:  (maps/dm/mohdm4.scr, 68)
^

Duplicate label 'teleport'
teleport local.trig local.dest:  (maps/dm/mohdm4.scr, 82)
^

^~^~^ Script file compile error:  Couldn't compile 'maps/dm/mohdm4.scr'
ScriptMaster::GetScript: Script 'maps/dm/mohdm4.scr' was not properly loaded

68 entities spawned
134 simple entities spawned
0 entities inhibited
-------------------- Spawning Entities Done ------------------ 321 ms
says duplicate so adding a 2 ---going to try that hold on
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

woooo hooo i got it lol
(sry but after this annoying problem - finaly fixed it im in a good mood again
----
however now that i got 2 teleports the 2nd teleport onely worked once

so for some reason now there both teleporting to the same place (the 1st teleport destination)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

pack

Post by tltrude »

You don't need to make a pk3 just to test it. If you put the script (mohdm4.scr) file in main/maps/dm, it will override the original script in pak5.

The last script I made worked great. If you want, you can spawn a second marker at origin (local.dest) to see where they are. But, as I said, you only need to add a "thread trigger_maker ...." line under level waittill spawn, if you want another one.
Tom Trude,

Image
User avatar
Darksoul
Lance Corporal
Posts: 19
Joined: Thu May 27, 2004 7:08 pm

Post by Darksoul »

this is what i changed and it works kinda

Code: Select all

thread hello //
   thread trigger_maker ( 839.32 -1328.87  250.32 ) ( 12 2987 300 ) // trigger & destination 
   thread trigger_maker2 ( -109 4248 20.76 ) ( -91.99 -6.23 374 ) // trigger & destination 

end 
trigger_maker local.location local.dest: 
  
   local.marker = spawn script_model 
   local.marker model "static/corona_orange.tik" 
   local.marker.origin = ( 839.32 -1328.87  250.32 ) 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( 839.32 -1328.87  250.32 ) 
   local.trig setsize ( -20 -20 -20 ) ( 20 20 20 ) 

   thread teleport local.trig local.dest 

end 

teleport local.trig local.dest: 

   local.trig waittill trigger 
   local.player = parm.other 
   local.player tele ( 12 2987 300 ) 
   thread teleport local.trig local.dest 

end 

trigger_maker2 local.location local.dest2: 
  
   local.marker = spawn script_model 
   local.marker model "emitters/adamspark.tik" 
   local.marker.origin = ( -109 4248 20.76 ) 

   local.trig = spawn trigger_multiple 
   local.trig.origin = ( -109 4248 20.76 ) 
   local.trig setsize ( -20 -20 -20 ) ( 20 20 20 ) 

   thread teleport2 local.trig local.dest2 

end 

teleport2 local.trig local.dest2: 

   local.trig waittill trigger 
   local.player = parm.other 
   local.player tele ( -91.99 -6.23 374 ) 
   thread teleport2 local.trig local.dest

end 
it works to a point. the 1st teleport works perfect
the 2nd one works right the 1st time you go threw it then after that it telepots to the 1'st teleports destination

me adding thread teleport2 local.trig local.dest2
to that last part will fix it i think
Post Reply