Jump to content
Sign in to follow this  
zipman

arma 3 mobile spawn vehicle mhq [help]

Recommended Posts

hi all I was hoping that someone might have or know of a temple and script I could look at and understand how a arma 3 mobile spawn vehicle mhq works, like teleport to mhq

thanks for any help in this matter.

Edited by zipman

Share this post


Link to post
Share on other sites

There's no set way any given MHQ script(s) could work. If you want a teleport type, you can simply make an object in your base have an action, that teleports you into the vehicle.

flag pole action

/*
    -Add the action to the flag pole. 
    -The action will only be available if the MHQ is alive and isn't moving.
    -The action will teleport the player to the vehicle's position and if there's room, move him into the cargo area of the MHQ.
    - Note: I never use 0 as the speed check because I don't trust it to be EXACTLY 0, at any given time, though it'd probably suffice... but just to be safe
*/

_id = myPole addaction [
"Teleport To MHQ",
{
	(_this select 1) setPos getPos myMHQ; 
	(_this select 1) moveInCargo myMHQ;
   },
nil,
1,
false,
true,
"",
"alive myMHQ && {speed myMHQ < 1}" //condition - if the MHQ is alive and isn't moving. 
];

Edited by Iceman77

Share this post


Link to post
Share on other sites

how and where would I put this code to work? what code do I put on the flagpole? what code to I put on the vehicle.? would you have a template of this working I could look at and read?

thanks for taking the time to reply,

Share this post


Link to post
Share on other sites

Give your MHQ a unique name. I used myMHQ as the name in the example. You can add the action simply by copy and pasting the code into your init.sqf and naming the object (flag pole) a unique name. I used myPole as the name in the example. Another way, would be to replace myPole with this and copy and paste the add action into the flag pole's initialization box within the editor.

Share this post


Link to post
Share on other sites

Thank you thank you thank you got it working right away.

Share this post


Link to post
Share on other sites

how can I get the name to show when you look at the flag pole?, if a user looks at the flag pole you would see "spawn to mhq" on the screen?

Share this post


Link to post
Share on other sites

Change the "1" between Nil and False to "6".

That will make it so when your looking at the pole, the action will become the "default action" and show on screen.

Share this post


Link to post
Share on other sites

I have this

_id = mypole addaction ["Teleport To MHQ",{(_this select 1)setPos getPos myMHQ;(_this select 1) moveInCargo myMHQ; },nil,6,false,true,"","alive myMHQ && {speed myMHQ < 1}"];

nil,6,false,true don't seem to do anything,

I scroll my mouse it shows on the menu and screen but without scrolling the mouse it don't show when you look at it,

Edited by zipman

Share this post


Link to post
Share on other sites

Is it possible to add to this code to make it possible to choose between multiple 'mhq' vehicles?

Share this post


Link to post
Share on other sites
Is it possible to add to this code to make it possible to choose between multiple 'mhq' vehicles?

If you are referring to the post before yours then it's rather simple, just duplicate it with different vehicle names so it adds more actions for more vehicles.

for example

_id = mypole addaction ["Teleport To MHQ",{(_this select 1)setPos getPos myMHQ;(_this select 1) moveInCargo myMHQ; },nil,6,false,true,"","alive myMHQ && {speed myMHQ < 1}"];  
_id2 = mypole addaction ["Teleport To MHQ 2",{(_this select 1)setPos getPos myMHQ2;(_this select 1) moveInCargo myMHQ2; },nil,6,false,true,"","alive myMHQ2 && {speed myMHQ2 < 1}"];  

in which a "2" was added to all the name calls.

Share this post


Link to post
Share on other sites

You would need to use the advanced version. There is a link in the bottom portion of the initial post for the advanced version of LVR. The advanced version uses vehVarName command to store the name. Also some additional functionality possible. There is also a version that Larrow did (NSLVR).

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  

×