MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Rules
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
CoD Wiki

HL2 Mapping
L4D Mapping
HL2 FAQs

SoF1 Mapping
SoF2 Mapping
SoF2 FAQs

Crysis Mapping

Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs

UT2K3 Mapping

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
darkcod5 [Today]
StrYdeR [Today]
Morphisnb [Today]
chrbos [Forum]
vT-Ownage [Forum]
NokiX [Forum]
Welshy [Today]

7 Members and 13 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Saturday, Jul. 4th
CustomCOD : What Happened An explanation
Friday, Jul. 3rd
MODSonair Episode 186
Sunday, Jun. 28th
MODSonair 186 LIVE
Friday, Jun. 26th
MODSonair Episode 185
Monday, Jun. 22nd
Through The Fire and Flames on Drums
Latest Poll
Will you be switching to Windows 7?
I already pre-ordered my copy. 4.41%
Looking forward to 32 bit. 8.82%
Looking forward to 64 bit. 25%
Waiting for the everyone else to beta the new OS. 8.82%
I'm sticking with my trusted copy of XP. 51.47%
Screw Windows, I'm on [insert other OS here]. 1.47%
Read More...
8 comments

Your Membership
User Name:
Password:
Register.
In The Forums
CustomCOD : What Happened An explanation
CoD:WW General G.. Posts: (20) Views: (195) by StrYdeR
Model lights are overriding!
HL2 Level Design.. Posts: (2) Views: (9) by Welshy
dawnville
CoD:WW Custom Ma.. Posts: (19) Views: (402) by COLMAC
electro shock defenses
CoD:WW Zombie/Co.. Posts: (6) Views: (69) by techno2sl
Art of War Central Quake 4 Mods for Dummies
CoDWW Download
Tutorials: SOF1 Mapping
Mapping and modding for Soldier of Fortune.
Add your tutorial (registered users)

Rating:
Awful Rating Poor Rating Average Rating Good Rating Excellent Rating
Versions: You must be logged in to view history.
Teleporting
2006-10-20 15:57:01
Here is a quick and easy script to teleport the player to another location in your map.
For this example, in the map you will need a trigger_multiple pointing to a script runner that has a key of script and a value of tport/tporta

ie

key=script
value=tport/tporta

You may want to adjust the delay or wait value for the trigger_multiple according to what is needed in the map

You will need to put a folder called tport in your base/ds folder - we will save the script as tporta.ds and compile it into tporta.os and put it in the base/ds/tport folder later

The main script command you need for the teleporter is...

get entity activator

This identifies the player who touched the trigger for your script and can be used for many other things in your scripts which I will go through in future tutorials

So, let us begin our teleport script with the usual...

#include "../common/header.ds"
output "C:/sample/ds/test"


We have to give the "activator" a name in the script - in this one I will call him "player1"

So we need the following line in the script ...

local entity player1

Now we tell the script who player1 is....

player1=get entity activator

So the complete script so far is...


--------------------------------------------------


#include "../common/header.ds"
output "C:/sample/ds/test"

local entity player1

player1=get entity activator


--------------------------------------------------


Now we need a destination - using co-ordinates that can be found by moving your mouse to the location in Radiant or Quark

Bear in mind that the player may arrive at the destination with his feet in the floor and will not be able to move - to prevent this, make the player appear 5 or 10 units above the floor at the destination (change the z value = the third number in the co-ordinates)

Imagine that I have found the destination co-ordinates in my map and it is [128,450,32]

The next line is simply...

move entity player1 to [128,450,32]

Now - if the teleport was to be used once, we would just write...

exit

But we almost certainly want to use the teleport many times in the map - for this we create a "loop"

After the player has been teleported we need to stop the script but not exit it - for this we use the "suspend" command. The script will continue if it is triggered again (by another player touching the trigger_multiple)

We now need to make the script return to the beginning - for this we need a "label" which we can call anything - I will call the label "xxx" and put it at the beginning of the script - it needs to be placed before the "player1=get entity activator" so that any player who touches the trigger will also be identified as the "activator"

To go to the label I would simply write ...

goto xxx

So, now our complete script looks like this....

----------------------------------------------------

#include "../common/header.ds"
output "C:/sample/ds/test"

local entity player1

label xxx

player1=get entity activator

move entity player1 to [128,450,32]

suspend

goto xxx

------------------------------------------------------



That's it!

Note the "suspend", "label" and "goto" commands - we will be using them in many future scripts together with the "get entity activator" command

Only one problem may arise with a teleporter - possibly a player will be standing at the destination when the other player appears in the same place - to prevent this you need to put a "push" brush at the destination - give it a low value of say....10
When the player arrives at the destination he will also be pushed out of the way in case there is a player immediately behind him who would also use the teleporter - You may not wish this push brush to be "on" all the time - in future tutorials I will explain how you can switch off the push brush and also switch other triggers on and off in your map using a script
It is also possible, if necessary, to change the direction a player is facing when he appears at the destination

For the best example of a teleporter with push brush see RDAM_Missile_Base map

Hope this helps...

Demise RDAM

All logos and trademarks and information in this site are property of MODSonline LLC © 2009.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Art of War Central
Partners
modbase.be
Frag Universe
CODAddicts - Call of Duty News & Downloads
CoD World Task Force
Bash and Slash Podcast
The Firing Box
Battle for Europe COD2
XoXide
Call of Duty Headquarters
Ask About
Advertising
Friends
After Life Gaming
Volcano
Call of Duty Maps
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
Next Show
The next MODSonair show will air LIVE on:
07/05/2009 12:07 EDT

Time remaining:
We Dontated to PixelEquity
Copyright © 2009 MODSonline
Tresware Content Management System Copyright © 2009 Tresware
Website Designed and Hosted   Tresware