Jump to content
GODSPEEDSNAKE

Multiplayer addAction execute global not working?!?! Please Help

Recommended Posts

Hey guys,

Sorry for the noob question however I been struggling for 2 days now with this and can't get my head around it. I have a mission which I have added a addAction to an object (which I'm hoping anyone in the multiplayer mission can execute).

However if I (the host) clicks it only plays the script out for me or if another player clicks then only they get the script to work??

This is the code I wrote in the init for the object:

nuke_action = nuke addAction["Shut Down Nuke", "scripts\mission\nukeactivated.sqf", nil, 6, True, True, "", "(_target distance _this) < 2"];

And this is the nukeactiveted.sqf:

nuke removeAction nuke_action;
sleep 1;
playSound "taskUpdated";
sleep 0.5;
titleText ["Code injection in progress... Please Wait...", "PLAIN"];
sleep 5;
playSound "taskUpdated";
sleep 0.5;
titleText ["Code Rejected. Powering up...", "PLAIN"];
sleep 1;
playSound "powerup";
sleep 6;
titleText ["ACTUAL: God damn it! This is not good... THIS IS NOT GOOD!", "PLAIN"];
sleep 6;
titleText ["ACTUAL: Alright get your asses to the EVAC!", "PLAIN"];
sleep 6;
titleText ["ACTUAL: Location marked on map...", "PLAIN"];
"evac" setMarkerType "mil_objective"; "evac" setMarkerColor "ColorBlue";
sleep 1;
playSound "hintCollapse";
sleep 2;
playMusic "04_Vorkuta_chase";

Sorry again, really trying to learn this stuff :/

Hope somebody can help :)

Thanks again

Share this post


Link to post
Share on other sites

This will run the script globally, inlcuding JIP.

nuke_action = nuke addAction[
"Shut Down Nuke", 
{ 0 = ["scripts\mission\nukeactivated.sqf","BIS_fnc_execVM",true,true] call BIS_fnc_MP; }, 
nil, 
6, 
True, 
True, 
"", 
"(_target distance _this) < 2"
];

Edited by Fight9

Share this post


Link to post
Share on other sites

Hi Flight9, I added that in exactly as you wrote it and both players get the action but nothing happens when clicked?

P.S thank you for your prompt aid :)

Share this post


Link to post
Share on other sites

try this:

[color="#FF8040"]nuke_action [color="#8B3E2F"][b]=[/b][/color] nuke [color="#191970"][b]addAction[/b][/color][color="#8B3E2F"][b][[/b][/color]
[color="#7A7A7A"]"Shut Down Nuke"[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b][[/b][/color][color="#7A7A7A"]"scripts\mission\nukeactivated.sqf"[/color][color="#8B3E2F"][b],[/b][/color][color="#7A7A7A"]"BIS_fnc_execVM"[/color][color="#8B3E2F"][b]][/b][/color] [color="#191970"][b]call[/b][/color] BIS_fnc_MP[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b],[/b][/color] 
[color="#000000"]nil[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#FF0000"]6[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#7A7A7A"]""[/color][color="#8B3E2F"][b],[/b][/color] 
[color="#7A7A7A"]"(_target distance _this) < 2"[/color]
[color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Share this post


Link to post
Share on other sites

Yup, I put a random extra parameter in there... fixed for future purposes.

Share this post


Link to post
Share on other sites

Arma3 dedicated server question    re:  addaction global

 

I am trying to use addaction on a dedicated server to start a fire that every one can see. I placed an invisable helipad under the crop and named it h2

 

I created a hemp plant and put this in the init

addaction ["Burn Crop","burncrop.sqf"];

 

burncrop.sqf

 

[h2,10,time,false,true] spawn BIS_Effects_Burn; sleep 15;  {deleteVehicle _x} forEach nearestObjects [h2, ["CUP_p_fiberPlant_EP1"], 25];

 

 

Only the player that used the action can see the fire.

 

How can I make this so everyone sees it? 

 

Here is a link to the mission on steam to see the screen shot

http://steamcommunity.com/sharedfiles/filedetails/?id=868914357

 

 

Please help

 

Edited by Megahurt2
specified game

Share this post


Link to post
Share on other sites

   Solved   re:  make addaction create a fire on a multiplayer Dedicated server

 

I made a mission where you flush out El Chapo by burning his marijuana fields, and it was nesessary to be able to do that on a dedicated server where all would see the fire lit by one player.  Heres the mission, it worked out well. Have a look at the screenies.

On Steam

http://steamcommunity.com/sharedfiles/filedetails/?id=868914357

Since searching for answers in arma ive been frustrated by others that have the same question as I have, found the answer and never posted it.

So here's how I solved it for me.

 

 

What I did was make the addaction delete an object on the map. Any object. I put a roll of duct tape in the middle of the pot field (hemp) where it wouldnt be seen.

in the hemp plants init:

this addaction ["burn crop ","crop2.sqf"];     the player gets close to the plant he gets the middle mouse wheel option "burn crop"

 

crop2.sqf

deletevehicle Ducktape2

 

Next a trigger grouped to the object ducktape, configured owner not present

When ducktape2 is deleted the trigger, which can be made to call a  Global Function all players can see,fires with this in its init;

.nul=[]execVM "crop21.sqf";       that makes the execution of an sqf file Global, which is impossible with addaction because the script executes only with the client not the server.

 

crop21.sqf

[h2,10,time,false,true] spawn BIS_Effects_Burn; sleep 15;  {deleteVehicle _x} forEach nearestObjects [h2, ["CUP_p_fiberPlant_EP1"], 25];

 

h2 is an invisible helipad in the crops

CUP_p_fiberPlant_EP1          is hemp plants.

 

The helipad catches on fire and after 15 secs the hemp plants are deleted and the big fire burns on where the plants had been.

 

It works. Da da.

 

 

Edited by Megahurt2

Share this post


Link to post
Share on other sites

this excessive use of BIS_fnc_MP drives me nuts. It was only sort of "grandfathered" in for backwards compatibility. remoteExec should be used.

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

×