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
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
jace [Today]
kals [Forum]
joemax [Downl]
batistablr [Today]
Strid3r [Forum]

5 Members and 8 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 30.12%
Multiplayer 61.45%
WHAT!? The tools are out? 8.43%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
FX help
CoD:WW Scripting.. Posts: (9) Views: (127) by COLMAC
A message from foyleman
In The News.. Posts: (8) Views: (83) by COLMAC
Weird texture problem
HL2 Level Design.. Posts: (5) Views: (30) by cz_squishy
Elevator Help
CoD 2 Level Desi.. Posts: (2) Views: (21) by luke0777
Art of War Central Half-Life 2 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 © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline can be found News.php.
Intergi
Partners
Battle for Europe COD2
XoXide
Frag Universe
Call of Duty Headquarters
CODAddicts - Call of Duty News & Downloads
modbase.be
The Firing Box
Ask About
Advertising
Friends
Volcano
The Clan Database
Great Gamer
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.
MODSonair Releases
MODSonair Episode 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware