Jump to content
Sign in to follow this  
virtualinfantry

AddAction Teleport Script breaks all instances after one use.

Recommended Posts

I setup a few flagpoles with an addaction to teleport player to different locations, and at that location flagpoles to get back to main base.

After I use a teleporter.... No more of the flagpole actions on any flagpole work.

here is my code..

Object

NAME: rangepole

Initialization:

_rpAct = rangepole addAction ["Teleport", "teleport_switch.sqf", getMarkerPos "RangeTP1" ];

then to get back i have another pole

NAME: basepole

Initialization:

_bpAct = basepole addAction ["Teleport", "teleport_switch.sqf", getMarkerPos "BaseTP1" ];

Script teleport_switch.sqf

_tp = _this select 0;

_caller = _this select 1;

_id = _this select 2;

_pos = _this select 3;

_tp = _caller setPos(_pos);

So any of the teleports work, until I use one, then no more teleporting works..

Any clue what I have to do to re-init this stuff for the player?

Edited by virtualinfantry

Share this post


Link to post
Share on other sites

Multiplayer or SinglePlayer as it works fine in SP.

Share this post


Link to post
Share on other sites

its a multiplayer map, but currently running it in editor preview where it does not work.

So you know I am not in [DEV] build, i am in beta stable.. maybe a bug?

Edited by virtualinfantry

Share this post


Link to post
Share on other sites

Hrmph, I moved everything close together, and rebooted, and it all seems to be working now.. just one of those things I guess... Thanks for your time.

---------- Post added at 18:03 ---------- Previous post was at 16:52 ----------

You might not believe this, but I moved the poles apart from each other (across the map where they belong), and now they are not working again....

But its more than that.... Because after many minutes I seen the teleport thing appear 3 times on one flagpole. But I only was able to see this once, never again.

Share this post


Link to post
Share on other sites

Here's the teleport script I always use, maybe try this?

// Teleports a person to the marker "teleportDestination". You can place this marker anywhere on the map.
// The marker can also be moved (see associated script: Teleport To Vehicle Location).
//
// To use: Add this script as an action on an item. EG:
//
//this addAction ["Teleport - Talon","teleport.sqf",["FOB_Talon"]];
//this addAction ["Teleport - Base","teleport.sqf",["Base"]];
//this addAction ["Teleport - Airfield","teleport.sqf",["Airstrip"]];

// Get the destination.
_dest = (_this select 3) select 0;

// Get a random direction
_dir = random 359;

// Move the person 15 meters away from the destination (in the direction of _dir)
player SetPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir)];

Share this post


Link to post
Share on other sites

Also if you teleport that way somethings need time to initialize for you like other scripted addActions.

Share this post


Link to post
Share on other sites

Yeah it is a delay, like this part of the map ain't processing anything, after a minute or so it seems to appear and start working...

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  

×