Jump to content
Sign in to follow this  
BittleRyan

Teleporting for one side only

Recommended Posts

I am a real newbie when it comes to scripting. But i want something to be in the action menu that says teleport. But i want it so only the CIVs can teleport in my mission.

Does anyone have a script i can use?

Share this post


Link to post
Share on other sites

1. Make a trigger with the following statements:

Condition:

side player == civilian

On Activation:

player addAction ["Teleport","teleport.sqf"]

2. Create a script called "teleport.sqf":

_id = _this select 2;

hint "Click on the map to teleport to that location";
player removeAction _id;
onMapSingleClick "player setPos _pos;player addAction [""Teleport"",""teleport.sqf""];onMapSingleClick ''";

Edited by ST_Dux

Share this post


Link to post
Share on other sites

Hey, I tried copying the code you wrote for the teleport.sqf into a notepad and saving it as such in the mission folder. When I try to teleport during the preview it comes up with an error saying "Can not find teleport.sqf file." What am I doing wrong?

Share this post


Link to post
Share on other sites

@fro:

You're probably saving the file as text by accident. Windows will do this by default when using notepad. To fix (for xp), go into any window and navigate to tools > folder options. From there, find the option for "Hide known File Extensions" and turn it off.

Share this post


Link to post
Share on other sites

Thanks, but I run Vista ultimate 64bit. I will let you know if I find where the equivalent is.

Share this post


Link to post
Share on other sites

Control Panel > Folder Options > View > Hide extensions for known file types

Share this post


Link to post
Share on other sites

Thanks for the help guys! That did the trick. I am playing with the teleport right now. However I ended up changing the teleport.sqf. I was able to fix the error message but in the game it wouldn't teleport when I clicked on the map. I ended up changing it to:

_id = _this select 2;

hint "Click on the map to teleport to that location";

player removeAction _id;

onMapSingleClick "player setPos _pos";

I got it to do what I wanted to do. I can teleport all over the map, but once you activate the teleport command it doesn't go away and any time you click on the map it WILL teleport you. For me that is no big problem as I am using this to help make my single player missions.

I don't know what one would have to do in order for you to comand each teleport and end it once you teleported. That may come in handy for someone elses mission later.

Oh well, Thanks again!

Share this post


Link to post
Share on other sites
I don't know what one would have to do in order for you to comand each teleport and end it once you teleported. That may come in handy for someone elses mission later.

Whoops. Change the "" at the end of the onMapSingleClick command to ''; that should do the trick. Original post updated.

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  

×