monkeybrain

Addaction on a single Item

12 posts in this topic

Im trying to add a action on a single object but I cant seem to figure it out. This is how I have it atm

 

private _vehicles = [

["Land_WaterCooler_01_new_F", [9051.25, 16265.8, 127.961], [0.215417, -0.976522, 0], [0, 0, 1], true]
];

{
    private _vehicle = (_x select 0) createVehicle (_x select 1);
    _vehicle allowDamage false;
    _vehicle setPosWorld (_x select 1);
    _vehicle setVectorDirAndUp [_x select 2, _x select 3];
    _vehicle enableSimulationGlobal (_x select 4);
    _vehicle setVariable ["ExileIsLocked", -1, true];
    _vehicle addAction ["This is a Action", "YOURSCRIPT.sqf"];
    
    
    
  
}
forEach _vehicles;

At the moment there is no scroll wheel option.

Is there any way to copy the init of a certain object from the editor and apply it to the object in multiplayer?

Share this post


Link to post
Share on other sites

Maybe you need to set the condition to true?

Edited by kuplion

Share this post


Link to post
Share on other sites
Advertisement

you dont want to do it this way! :) Exile has a nice little addaction system that does it all for you! :) (that is unless you want to ONLY add this addaction to only ONE of a type of item and not to all of them ( in which case still use the method i describe but add a condition checking for a variable that you set on the item you created))

put this code into your

CfgInteractionMenus 

inside the mission file

	class WaterCooler
	{
		targetType = INTERACTION_TYPE_VEHICLE;
		target = "Land_WaterCooler_01_new_F";

		class Actions
		{
			class myScript: ExileAbstractAction
			{
				title = "this is my action name";
				condition = "true";
				action = "[] execVM 'path/to/your/script.sqf'";
			};
	
		};
	};


 

Edited by happydayz
2 people like this

Share this post


Link to post
Share on other sites

Yea I knew this way, didn't realize you could do it with one object. By a variable do you mean a name or something? How would i name the object , say if i want a script to teleport to it? I see the

getvariable ['ExileIsLocked',1]) isEqualTo 1

not sure what variable i should use though.

Thanks for all the help!

Edited by monkeybrain

Share this post


Link to post
Share on other sites
14 hours ago, happydayz said:

you dont want to do it this way! :) Exile has a nice little addaction system that does it all for you! :) (that is unless you want to ONLY add this addaction to only ONE of a type of item and not to all of them ( in which case still use the method i describe but add a condition checking for a variable that you set on the item you created))

put this code into your

CfgInteractionMenus 

inside the mission file


	class WaterCooler
	{
		targetType = INTERACTION_TYPE_VEHICLE;
		target = "Land_WaterCooler_01_new_F";

		class Actions
		{
			class myScript: ExileAbstractAction
			{
				title = "this is my action name";
				condition = "true";
				action = "[] execVM 'path/to/your/script.sqf'";
			};
	
		};
	};


 

How long before......
 

 

Share this post


Link to post
Share on other sites

this is what I want to do

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

teleport.sqf

_dest = (_this select 3) select 0;
_dir = random 359;


player SetPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir)];

and then have multiple markers which to teleport to.

any help would be great.

I also want to put this init stuff in for a object

null=[l1,100,11,10,3,7,-0.3,0.1,0.5,1,1,1,13,12,15,true,2,2.1,0.1,4,6,0,3. 5,17.5] execFSM "Fog.fsm";

I just don't understand how to do it without having a init for a item.

Edited by monkeybrain

Share this post


Link to post
Share on other sites

The item you want to teleport from just make a variable when u create it so for example

 

_object setVariable ["ExileTPPoint", true];

 

Then your condition check to see if your looking at that specific object would be 

(Exileclientinteractionobject getVariable  ["ExileTTPoint", false])

If your looking at the right one it will then show the Addaction. just beware infi may not like this as it has anti to built in. 

Edited by happydayz
1 person likes this

Share this post


Link to post
Share on other sites
6 hours ago, happydayz said:

The item you want to teleport from just make a variable when u create it so for example

 

_object setVariable ["ExileTPPoint", true];

 

Then your condition check to see if your looking at that specific object would be 

(Exileclientinteractionobject getVariable  ["ExileTTPoint", false])

If your looking at the right one it will then show the Addaction. just beware infi may not like this as it has anti to built in. 

So I killed infistar to test, this is what I have

private _vehicles = [

["Land_WaterCooler_01_new_F", [9051.25, 16265.8, 127.961], [0.215417, -0.976522, 0], [0, 0, 1], true]
];

{
    private _vehicle = (_x select 0) createVehicle (_x select 1);
    _vehicle allowDamage false;
    _vehicle setPosWorld (_x select 1);
    _vehicle setVectorDirAndUp [_x select 2, _x select 3];
    _vehicle enableSimulationGlobal (_x select 4);
    _vehicle setVariable ["ExileIsLocked", -1, true];
    _vehicle setVariable ["ExileTPPoint", true];

}
forEach _vehicles;
class WaterCooler
	{
		targetType = 2;
		target = "Land_WaterCooler_01_new_F";

		class Actions
		{
			class myScript: ExileAbstractAction
			{
				title = "Going Up";
				condition = "(ExileClientInteractionObject getvariable ['ExileTPPoint',false])";
				action = "[] execVM 'script.sqf'";
			};
	
		};
	};

No pop up occurs, only if I set the exileTPPoint to true.( But then it pops up on all objects)

Share this post


Link to post
Share on other sites

Your creating the item on server yeah? If so then the variable needs another true  to be global for all clients as by default it's just local to the creator. 

_object setVariable ["ExileTPPoint", true,true];

 

1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.