Jump to content

Recommended Posts

Can anybody give me a link to a script i can use for exploring altis, I just want to be able to click on the map and jump around to different places? hopefully this isn't a frowned upon request. I'm running the DEV branch

Share this post


Link to post
Share on other sites

Create a radio trigger and set to repeatedly then in the init place this code:

[b]onMapSingleClick "player setPos _pos; onMapSingleClick ''; true;"[/b]

Share this post


Link to post
Share on other sites

Thanks very much, time explore!

---------- Post added at 01:54 ---------- Previous post was at 01:49 ----------

Do you know how to add that trigger to the menu when i middle mouse scroll by chance??

Share this post


Link to post
Share on other sites

Yea sure, its a little more work but not too much.

Firstly on the player's init line add this:

this addAction ["Teleport", teleport.sqf];

Then in the mission folder create a "teleport.sqf" file and open with notepad/ ArmA Edit and enter the following code:

openMap true;
sleep 1;
hint "Click on map to teleport."
onMapSingleClick "player setPos _pos; onMapSingleClick ' '; true;"
sleep 1;
openMap false;

That should work fine. Let me know if there is any problems.

Share this post


Link to post
Share on other sites

No i cannot get it to work it says error line 5 missing teleport.sqf but its there in the same folder. it opens the map and shows the hint but when i click it just brings that error up

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

The name of the function given in the addAction must be a string if it refers to a script file. The path to a script file is relative to the mission directory. The addAction line is:

this addAction ["Teleport", "teleport.sqf"];

If you want to take teleporting a step further, you can teleport to where the center of your screen is using this:

(findDisplay 46) displayAddEventHandler ["KeyDown","if (_this select 1 == 21) then {player setPosATL (screenToWorld [0.5,0.5]);}"];

This will instantly teleport the player to a position on the terrain and ignores objects. You may get odd behavior trying to move into buildings using this. This is best used in conjunction with map teleporting, as it is possible to teleport very far off the map and into the ocean if you look at the sky and use this. The '21' in the eventhandler means the Y key (it is unassigned for me). Other key numbers can be found here:

http://community.bistudio.com/wiki/ListOfKeyCodes

Share this post


Link to post
Share on other sites

That's because Flax_ forgot to put the quotation marks around teleport.sqf.

this addAction ["Teleport", "teleport.sqf"];

Share this post


Link to post
Share on other sites

Cheers guys, getting tired at 3am XD

Share this post


Link to post
Share on other sites

You don't need any script. When running them game from editor, simply hold Alt and click LMB on the map to teleport there.

Share this post


Link to post
Share on other sites
You don't need any script. When running them game from editor, simply hold Alt and click LMB on the map to teleport there.

Holy mother of God....

Share this post


Link to post
Share on other sites
You don't need any script. When running them game from editor, simply hold Alt and click LMB on the map to teleport there.

WAT? How long has this been a thing?

Share this post


Link to post
Share on other sites
You don't need any script. When running them game from editor, simply hold Alt and click LMB on the map to teleport there.

Wow guys I have known this for like forever... ok only joking!! And to quote Kylania, "Fuck me!!!", well that's what he meant say lol.

Share this post


Link to post
Share on other sites
WAT? How long has this been a thing?
Been in stable for at least 2 or 3 updates.

Share this post


Link to post
Share on other sites

Wow I guess when you get used to scripting everything you forgot to look at the shortcuts...

Share this post


Link to post
Share on other sites

You're missing ; at the ends of your hint and onMapSingleClick lines.

Share this post


Link to post
Share on other sites

Thanks thats working perfectly now, for anyone else that may want to use this heres what worked.

teleport.sqf

openMap true;
sleep 1;
hint "Click on map to teleport.";
onMapSingleClick "player setPos _pos; onMapSingleClick ' '; true;";
sleep 1;
openMap false;

And in the player initialization

this addAction["Teleport", "teleport.sqf"];

Thanks again for your help much appreciated.

---------- Post added at 15:58 ---------- Previous post was at 15:09 ----------

How do I stop the teleport action showing up in the middle of my screen all the time? I just want to see it when I roll my mouse wheel.

Share this post


Link to post
Share on other sites
How do I stop the teleport action showing up in the middle of my screen all the time? I just want to see it when I roll my mouse wheel.
Check out the addaction options in the wiki.
showWindow (optional): Boolean - If set to true, players see "Titletext" at mid-lower screen, as they approach the object. Only the title text for the action with highest priority and 'showWindow true' will be shown. Setting it to false disables the feature. Default value: true

Share this post


Link to post
Share on other sites

Theres one more thing kind of wrong with this in that, if I don't click before 1 second is up, it just closes the map. I tried extending the "sleep 1;" to more but it just doesn't close the map unless i press M or wait out the duration of the sleep. Want to be able to look around the map and when i click it teleports and closes the map. right now it teleports if i click but closes the map after 1 second whether or not i click.

I think i understand i need to set showwindow to false to hide it on my screen but have no idea where to put that. I thought this teleport business was going to be a lot simpler than this :confused:

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

teleport.sqf

openMap true;
sleep 1;
hint "Click on map to teleport.";
onMapSingleClick "player setPos _pos; onMapSingleClick ''; openMap false; true;";
waitUntil{!(visibleMap)};

player addAction ["Teleport","teleport.sqf",[],1,false,true];

Edited by Larrow

Share this post


Link to post
Share on other sites

@Moricky

It doesn't work from the MP editor through.

If you want it to work in the MP Editor you can do this:

onMapSingleClick "if(_alt) then {vehicle player setPos _pos};";

That is also another neat trick, apparently the alt key is passed to onMapSingleClick through _alt now as well.

The alt click thing has actually been in since Alpha

Share this post


Link to post
Share on other sites
teleport.sqf
openMap true;
sleep 1;
hint "Click on map to teleport.";
onMapSingleClick "player setPos _pos; onMapSingleClick ''; openMap false; true;";
waitUntil{!(visibleMap)};

player addAction ["Teleport","teleport.sqf",[],1,false,true];

Thats exactly it, works like a charm, thank you for your help.

Share this post


Link to post
Share on other sites

Is

onMapSingleClick "player setpos _pos";

written in the init.sqf not working anymore on DedicatedServer?

Tried and didn't do it for me... is there a similar command for Arma3 online teleport?

Alt+LMB in Editor is still nice but useless for testing missions online.

Edited by killshot

Share this post


Link to post
Share on other sites

alt lmb .. you've been keeping that quite... lol, please tell me thats an arma 3 thing.

Share this post


Link to post
Share on other sites

I've seen a teleportation method on a server and it was very good. There was a map object where we were spawn, and when we approached it, the "fast travel" option appeared. When we selected it, the map opened and teleported us to the place we chose on the map. Do you guys know anything about that?

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

×