Jump to content
Sign in to follow this  
Cato Larsen

How to set Fast travel , teleport.

Recommended Posts

As the title says.

I am not in any way advanced in scripting , but I do know how to use the editor in and out. I also know how to use the search function in this forum, but I cannot seem to find what I want.

I am looking for a way to set up fast travel.

I want it to be enabeled at all time from anywhere to a marker that I set, well actually I want all players to be able to choose fast travel to 3-4 markers that I set.

No conditions needs to be met.

Anyone that can help me or point me to a template script or whatever it is that I need?

Thanks.

Maybe I should be clear to say that it is the "warfare type teleport" that I am after

Edited by Cato Larsen

Share this post


Link to post
Share on other sites
In the waypoint menu set speed to 'full' :)

You bugger :)

Not exactly what I am after. And I am talking all CLIENTS that joins server. Not AI Fast travel.

Share this post


Link to post
Share on other sites

I suspect that it fast travel is just a teleport script in disguise with some markers on th e map to simulate the actual travelling.

Look into the setpos and createmarker commands.

Failing that, depbo the superpowers mission or warfare module and see what you can find - there might already be a BIS function.

Share this post


Link to post
Share on other sites
I suspect that it fast travel is just a teleport script in disguise with some markers on th e map to simulate the actual travelling.

Look into the setpos and createmarker commands.

Failing that, depbo the superpowers mission or warfare module and see what you can find - there might already be a BIS function.

Cheers. i have depbo`ed those some time ago, but the complication of the scriptwriting makes my head ace. I was not ment to understand this :)

I will however look into setpos and createmarker combo. I would think the fast travel is a drag quenn in act as you so gentl did not put it.

Thanks.

Oh and if someone would still put up what I must do. a code or anything, while I search for a solution, that would be superb.

---------- Post added at 12:57 AM ---------- Previous post was at 12:47 AM ----------

Ok.

Well. The easiets way I found to do it, and it might just work for me in the simple way i want it.

player setPos (getPos someobject)

then create someobject

and use a trigger with radio alpha.

the use it again with radio bravo to get to another place and so on.

Not at all complex, but works for me anyway.

Share this post


Link to post
Share on other sites

so simple.... "player"... been trying to find out how to make only the player who used "radio alpha" perform the action that radioalpha is set to. THANKS!

Share this post


Link to post
Share on other sites

Hello. I'm using the radio trigger as described above on a multiplayer map, the code looks like this...

player1 setPos (getPos location1);

Now, I want anyone who uses that radio trigger to be able to teleport to the location1 position independently. Right now, if I use that code above and add player2, player3, and so on, if player1 hits the radio they all teleport to location1 at the same time.

Does anyone know how I can set up the radio trigger so that only the person who pushes the button teleports? Also, is there a way to make them teleport to an area, but appear at a random radius away? As it is now, all teleport on top of each other. Thanks!

EDIT: Let me rephrase that a little differently. How can I set a command via the radio where only the unit pressing the radio command teleports?

Edited by Durka-Durka

Share this post


Link to post
Share on other sites

I'm not up on radio commands, I use addaction placed in a trigger if I only want to teleport to and from a specific place. If I want the actions all the time I place them in the units Init box. I don't know how this works multiplayer wise.

Share this post


Link to post
Share on other sites

player setPos (getPos location1);

Who ever calls the radio call gets moved to that location.

I've implemented an onMapSingleClick that moves the player wherever you click on the map, it moves the player. Tested in Multiplayer, and works perfectly.

Share this post


Link to post
Share on other sites

Gents, how do I make so that when your transported to a position, you are actually transported 2 or 3 metres away from that position?

I have a mobile respawn and if you teleport to it you teleport 'inside' the vehicle. I need to be teleported outside the vehicle.

Cheers

Dale

Share this post


Link to post
Share on other sites

player setPos [(getpos location1 select 0)+3,(getpos location1 select 1)+3,(getpos location1 select 2)+0];

that would put you three meters away in both x,y direction but leave your height at 0, you can also use negative numbers.

Share this post


Link to post
Share on other sites

Cool F2k, I was using the extra variables inside the brackets, thanks dude!

Share this post


Link to post
Share on other sites

I use two vehicles as mobile respawns/ ammo trucks, and when you use the radio, you are moved to the cargo position of the vehicle, by using the player moveincargo ____ command. Radio Alpha is vehicle 1, and radio bravo is vehicle 2. Each vehicle has a marker on the map, that updates its location as the vehicle is moved. When you use the radio and are moved into the cargo position, you just get out of the vehicle, so no one is popping up on the map anywhere as they use the radio. Works perfectly, till I try to do it from the other team. They teleport to the cargo position of the first team's mobile spawn instead of their own.

What I really need to do is learn how to script, so that I can make the mobile spawn vehicles and their associated markers, on the map local to each team, and also the radio commands local to each team. But, I do NOT have the time for that right now. Anyone know of a mobile respawn script? I can provide more detail on what I am trying to do, if need be.

Share this post


Link to post
Share on other sites

anyone knows how to do this with flags? you go there and scroll to a lication then teleport ?

Share this post


Link to post
Share on other sites
anyone knows how to do this with flags? you go there and scroll to a lication then teleport ?

This may work, just save the two scripts as loadaction.sqf

//////////////////////////////////////////////////////////////////
// you can put the following line of code into the player or an object.
// the actions will be placed in the action menu.
// nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "loadaction.sqf"
// simply place the locations you want to visit into the the correct arrays.
// [gl1,gl2,gl3] is where you place game logic, objects or unit names that you want to visit
// [trig1,trig2] are the names of triggers you may wish to visit, leave empty if niot usesd.
//////////////////////////////////////////////////////////////////

_unit = _this select 0;// unit teleporting
_port = _this select 1;// game logic or unit name
_trig = _this select 2;// trigger, uses text not trigger name. 


// Game Logic Actions
for [{_i=0},{_i < count _port},{_i = _i+1}] do
{
 _pad = _port select _i;
     _unit addAction ["Location "+str _pad,"teleport.sqf",_pad,1,false,true,""];
};

// Trigger Actions
for [{_i=0},{_i < count _trig},{_i = _i+1}] do
{
 _pad = _trig select _i; 
    _padname = triggertext (_trig select _i);
       _unit addAction ["Location "+str _padname,"teleport.sqf",_pad,1,false,true,""];
};

and teleport.sqf

// Perform teleport called from loadaction by use of addaction. 

player setPos (getPos (_this select 3));
player setpos [getpos player select 0,getpos player select 1, ((getpos player select 2)+0)];
player removeAction act; 

The instructions or in the first script.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Small correction here :

//////////////////////////////////////////////////////////////////
// you can put the following line of code into the player or an object.
// the actions will be placed in the action menu.
[s]// nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "teleport.sqf"[/s]
// nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "[color="Red"]loadaction.sqf[/color]"
// simply place the locations you want to visit into the the correct arrays.
// [gl1,gl2,gl3] is where you place game logic, objects or unit names that you want to visit
// [trig1,trig2] are the names of triggers you may wish to visit, leave empty if niot usesd.
//////////////////////////////////////////////////////////////////

Share this post


Link to post
Share on other sites
Small correction here :

//////////////////////////////////////////////////////////////////
// you can put the following line of code into the player or an object.
// the actions will be placed in the action menu.
[s]// nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "teleport.sqf"[/s]
// nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "[color="Red"]loadaction.sqf[/color]"
// simply place the locations you want to visit into the the correct arrays.
// [gl1,gl2,gl3] is where you place game logic, objects or unit names that you want to visit
// [trig1,trig2] are the names of triggers you may wish to visit, leave empty if niot usesd.
//////////////////////////////////////////////////////////////////

Thanks corrected now, it caught me out the other day.

Share this post


Link to post
Share on other sites
Thanks corrected now, it caught me out the other day.

Hello.

I'm try to see how you script works. I understand whats in each of the two files and whats going to happen when active. But i can't seem to get the command line that you say to use:

nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "loadaction.sqf"

or

nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "teleport.sqf"

If i understand right i should just be able to add the nul=[this,[gl1,gl2,gl3],[trigg1,trigg2]] execVM "teleport.sqf" in the init field for a flag pole. But when i do that nothen comes up to click on or in my command window. So if you can tell me what i'm doing roungh that would be great.

Thanks

darkone

Share this post


Link to post
Share on other sites

Place two flagpoles on the map and two game logics for testing.

name the flagpoles f1 and f2, then name the two logics gl1 and gl1. We won't use any triggers.

Place this line in all four objects.

nul=[this,[f1,f2,gl1,gl2],[]] execVM "loadaction.sqf" 

to operate walk up to one of the object where you placed the code, you may have to look around a bit like when you try to open a door or climb a ladder.

You can also put that line of code into your init box and that will give you instant teleport options without having to walk up to the object.

You can add more logics or flagpoles and name them what you like but the names must also be in the call code.

The empty [] brackets at the end are for trigger locations and require a trigger to be named and that name placed in the brackets, this is mostly for mission testing.

Edited by F2k Sel

Share this post


Link to post
Share on other sites
Place two flagpoles on the map and two game logics for testing.

name the flagpoles f1 and f2, then name the two logics gl1 and gl1. We won't use any triggers.

Place this line in all four objects.

nul=[this,[f1,f2,gl1,gl2],[]] execVM "loadaction.sqf" 

to operate walk up to one of the object where you placed the code, you may have to look around a bit like when you try to open a door or climb a ladder.

You can also put that line of code into your init box and that will give you instant teleport options without having to walk up to the object.

You can add more logics or flagpoles and name them what you like but the names must also be in the call code.

The empty [] brackets at the end are for trigger locations and require a trigger to be named and that name placed in the brackets, this is mostly for mission testing.

Hello.

Thanks you for explaining what to do. Your script works perfect for setting up a mobile HQ. I just have to make it so you spawn a few meters away from the spawn vehicle, but that shouldn't be hard.

Thanks you once again, if a mod is watch this post this should be sticky.

Darkone.

Share this post


Link to post
Share on other sites

Your welcome.

The line you need to change is

player setpos [getpos player select 0,getpos player select 1, ((getpos player select 2)+0)];

change it to

player setpos [(getpos player select 0)+3,(getpos player select 1)+3, ((getpos player select 2)+0)];

you need to adjust the +3's for the exact position.

Better still would be use the direction of the gamelogic and put you a meter or two away in that direction.

I don't have the time right now to see if it's possible, but I think I did something like that for someone.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×