Jump to content
Sign in to follow this  
evil_brownie

Adding a "teleport to location" useraction

Recommended Posts

Hello everyone,

While playing a bit with the frigate in the Anzac mod, i thought i'd try and give it a useraction so it let's you go directly to the rear deck (much like it happens in Gnat's frigates by default), because if you disembark, you end up in the ocean. So, i wrote a small config and script pbo to change it's useractions, like so:

(...)
class UserActions
{
class Heloland // The one that comes by default on the ship, so as to not lose it
{
	displayName = "Secure Helicopter";
	position = "attach_refuel_1";
	onlyforplayer = 0;
	radius = 5;
	condition = "this animationPhase ""Railing1"" == 0 AND (vehicle player isKindOf ""Helicopter"")";
	statement = "[this, vehicle player] execVM ""\anzac_sea\scripts\heliland.sqf""";
       };
class gotodeck // The one i'm trying to get to work
{
	displayName = "Go to deck";
	position = "attach_refuel_1";
	onlyforplayer = 0;
	radius = 100;
	condition = "alive this";
	statement = "[this, player] execVM ""\anzac_ship_fix\scripts\gotodeck.sqf""";
};
};

Which leads to:

_ship = _this select 0;
_persontomove = _this select 1;
gotopoint = _ship selectionposition "attach_refuel_1";
_posgotopoint = getpos gotopoint;
_persontomove setpos [(getPos _posgotopoint select 0) + 1, (getPos _posgotopoint select 1) + 1, (getPos _posgotopoint select 2) + 0.5];

Now, I can get the action to pop-up and all, but i'm sure as hell making some stupid mistake on the script. All i need it to do, is move me to that selectionpoint's location, with a bit of offset, just in case i had landed a chopper there, moved the boat a bit, then, came out to the deck to use the chopper again.

EDIT: No need for help anymore, managed to conjure something myself that i'm pleased with :)

Edited by Evil_Brownie
I've done it...sort of

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  

×