Jump to content
TriXter-9fcad23cb89cb108

enableSimulationGlobal on Ded-server

Recommended Posts

Hi, I'm completely and utterly incompetent at this! This is my first attempt at doing something like this. The idea is that this should be implemented on an Arma 3 Exile server. What I'm trying to do is a script for a so-called base defense. I have placed "in edior" an x number of mines on a field and disable simulation on these. (inside "mission.sqm") And I have then added an addaction on "INIT" to a object

 

-----------------------------------------------------------------------------------            Addaction on object           -----------------------------------------------------------------------------------------------------------------------------------------------------------P1 addAction ["<t color='#ded51f'>Activate Minefields", "Mine\ActivateMine.sqf",P1 removeAction (_this select 2)] remoteExec ["execVM",1,true];                                                                                                                                                                                                                               

Then I have two sqf files 

Activate.sqf and Deactivate.sqf

------------------------------------------------------------------------------------------------------------------------            Activate.sqf           --------------------------------------------------------------------------------------------------------------------------------hintSilent parsetext format ["<br /><t align='center' color='#de2c1f' size='2,5'>•• MINEFIELDS ACTIVATED ••</''"];

P1 addAction ["<t color='#ded51f'>Deactivate Minefields", "Mine\DeactivateMine.sqf", P1 removeAction (_this select 2)] remoteExec ["execVM",1,true];

[P1, ["Activate", 1000, 1] ] remoteExec ["say3D"];

_Obj= ["AT1"AP1"];                    // AT1 =ATMine AP1=APERSBoundingMine these are placed and name in Editor and disabled the simulation. So these are in the Mission.sqm file. So these spawn at every restart and are disabled.

{_x enableSimulationGlobal true;} forEach _Obj; 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Hints and sounds work but the simulation on the mines doesn't work =(

Share this post


Link to post
Share on other sites

There are a few syntax errors in your parseText, but the real issue is the syntax of your array of mine objects. An array of variables/variable names does not use quotes, and array elements are separated by a comma.

hintSilent parsetext format ["<br /><t align='center' color='#de2c1f' size='2.5'>•• MINEFIELDS ACTIVATED ••</t>"];

P1 addAction ["<t color='#ded51f'>Deactivate Minefields", "Mine\DeactivateMine.sqf", P1 removeAction (_this select 2)] remoteExec ["execVM",1,true];

[P1, ["Activate", 1000, 1] ] remoteExec ["say3D"];

_Obj = [AT1, AP1];

{
	_x enableSimulationGlobal true;
} forEach _Obj; 

 

And please don't use your own custom fancy formatting here, it makes things difficult to read. Just type normally and use code blocks (the <> tool in the toolbar).

Share this post


Link to post
Share on other sites

Yeah, enableSimulationGlobal is SE, meaning it must be executed on the server. An alternative might be:

hintSilent parsetext format ["<br /><t align='center' color='#de2c1f' size='2.5'>•• MINEFIELDS ACTIVATED ••</t>"];

P1 addAction ["<t color='#ded51f'>Deactivate Minefields", "Mine\DeactivateMine.sqf", P1 removeAction (_this select 2)] remoteExec ["execVM",1,true];

[P1, ["Activate", 1000, 1] ] remoteExec ["say3D"];
  
_Obj = [AT1, AP1];

{
	[_x, true] remoteExec ["enableSimulation", 0, true];
} forEach _Obj; 

 

Share this post


Link to post
Share on other sites

Thanks a lot, I really appreciate your help! But the mines still don't get activated "enableSimulation" =(

I have no idea what I'm doing, but I've tried this and a few others, but none have worked except in the editor

 

{

[_x, true] remoteExec ["enableSimulation", 0, true];

} forEach _Obj;

 

{

[_x, true] remoteExecCall ["enableSimulationGlobal", 0]

} forEach _Obj;

 

 

and a few others, but none have worked except in the editor

 

It works in the editor but nothing happens on the server. 

as before hint, addaction works fine in the editor and server.

 

Share this post


Link to post
Share on other sites

Just a point (for beginning)

3den enable simulation  (untick in editor) doesn't work well with mines.

If you preview from editor, it's OK (no menu for deactivation).

If you restart the mission, that fails partially (for mines only as far as I tested: deactivate menu is back and active but mines are not dangerous).

 

And that's for SP preview. I can't imagine the test in MP dedi server, with 2 players at least.

 

NOTE: in settings / preferences, I recompile functions every time the preview is launched.

  • Like 1

Share this post


Link to post
Share on other sites

OK thx for the info!

But can i hide these mines under ground and the lift them up when i activate?

 

_Obj = [AT1, AP1];

_x setposATL [getPosATL _x select 0,getPosATL _x select 1,(getPosATL _x select 2)+5] forEach  _Obj ;

Share this post


Link to post
Share on other sites

Hello!

I'm no expert, but I think it's easier if you do it via script, creating and deleting mines accordingly.
 

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

×