Nerd-Rage Modders

Nerd-Rage Modders

Nerd-Rage Modders
 
HomeHomeFAQSearchMemberlistUsergroupsRegisterLog in

Share | 
 

 Mapping/Scripting: Teleporters.

Go down 
AuthorMessage
Firemission

avatar

Posts : 28
Points : 1053
Join date : 2010-03-03
Age : 28
Location : Tunbridge Wells,Kent

PostSubject: Mapping/Scripting: Teleporters.   Mon Mar 08, 2010 7:53 pm

Teleporters

By: FireMission




i am going to show you how to make a teleporter in your map.. this is quite a simple method there are other ways but this is by far the most simplistic. ok.. so.


firstly select your trigger texture. do this by going to textures -> usage -> tools Look for gray texture that says "trig" all over it.
Okay, now draw a brush making sure that the box your drawing is more that 16 units each direction on the axis. x,y,z. (otherwise the trigger wont work*). also note that if the trigger in overlapping inside something it also wont work**.
Eight now there are several types of teleporter you can use. this is defined in the trigger entity box and in your maps .GSC file. now when i said there are different versions of teleports its differed by a few things. whether you just want to walk into the trigger and it teleports you, or if you want to press a button then you can or if you have a damage trigger that you can do damage to and hey presto you are magically teleported.
So 3 ways i will show you very simple to do.
For the walk into and teleport its simply a case of right clicking on your 2d view select trigger multiple. select the brush opening up your entity box by pressing N twice then entering the values.


See below
Code:

Key: classname
Value: trigger_multiple

Key: targetname
Value: teleport

and for a teleport that you can press a button for its a follows
Code:

Key: classname
Value: trigger_use

Key: targetname
Value: teleport

and for a teleport that makes you teleport when u do damage for it is like this

Code:

Key: classname
Value: trigger_damage

Key: targetname
Value: teleport

there are certain ways you can customise the damage you will notice there are little boxes that show up now you have a trigger damage box. like below...



Now Right Click on the 2D Grid and go to Script -> Origin
Add one of these to wherever you want to teleport too, if you rotate this origin, you will get rotated in to the direction it's facing.



if you need help just ask ofc. right.. now the boring part the script. its quite simplistic copy and paste this in to your maps .gsc file.. if you dont have one make a .txt file on your desktop rename it to your map. eg mp_yourmapname.gsc then open it up..

paste this inside:

Code:

main()
{
        //EVERYTHING YOU HAVE IN MAIN THREAD GOES HERE
   thread teleportenter();
}

teleportenter()
{
   teleporters = getentarray("enter","targetname");
   for(i=0;i < teleporters.size; i++)
      teleporters[i] thread teleport();
}
teleport()
{
   gotos = getentarray(self.target,"targetname");
   while(true)
   {
      self waittill("trigger", player);
      self thread teleportnow(player,gotos);
   }
}
teleportnow(player,gotos)
{
   go = gotos[randomInt(gotos.size)];
   player setorigin(go.origin);
   player setPlayerangles(go.angles);
}

then compile your map when this is all done hope its works for ya

any problems you can contact me on this site plenty of links ill try get back to you asap cheers

Added by Fixz:
With this script you can also connect the trigger with many more script_origins and you will get teleported to one of the nodes, and voila, you've got a random teleports Smile

*well it will firemission, i made one 0.25x0.25x0.25 - both use and multiple
**it will indeed, just remember make sure it's not inside another brush.


Last edited by Firemission on Mon Mar 08, 2010 8:34 pm; edited 1 time in total
Back to top Go down
View user profile http://www.southernits.co.uk/
Waffles



Posts : 12
Points : 46
Join date : 2010-03-05

PostSubject: Re: Mapping/Scripting: Teleporters.   Mon Mar 08, 2010 8:05 pm

Nice tutorial. Good work Firemission. Very Happy
Back to top Go down
View user profile
snake



Posts : 2
Points : 6
Join date : 2010-10-18

PostSubject: Re: Mapping/Scripting: Teleporters.   Sun Feb 13, 2011 7:33 pm

hey guys could create a tutorial on how to put soda machines in a zombiex map, please!
Back to top Go down
View user profile
irishstorm
Admin
avatar

Posts : 62
Points : 1229
Join date : 2010-03-03
Age : 26
Location : Ireland

PostSubject: Re: Mapping/Scripting: Teleporters.   Fri Feb 25, 2011 7:47 am

snake wrote:
hey guys could create a tutorial on how to put soda machines in a zombiex map, please!
Hey there snake! we have moved sites http://www.modbyte.se/forum
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Mapping/Scripting: Teleporters.   

Back to top Go down
 
Mapping/Scripting: Teleporters.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Nerd-Rage Modders :: User Tutorial's :: Mapping tutorial's-
Jump to: