Sign in to follow this  
Followers 0
Ganbada

[solved] enabled Physic with "_this enableSimulation false;"

3 posts in this topic

Hello everybody.

I have a question about the Thing "_this enableSimulation false;"

 

I placed for example "Exile_Sign_Office_Small" with enableSimulation false.

but on the Server, when i hit the Sign with a Car it gets physics/damage and the Sign falls to the ground.

We tested on the Server with the createvehicle Command some other Solutions for Example with AddEventHandler "handledamage false".

It works Great, but when i put the Eventhandler in my sqf it doesnt take effect and the Sign has Physics.

Here is a stripped example from my sqf:

_objects = 
[
["Exile_Sign_Office_Small",[3918.69,9293.52,-0.544037],312.173,[[-0.741121,0.671372,0],[0,0,1]],false],
["Exile_Sign_Office_Small",[3918.69,9293.52,-0.544037],312.173,[[-0.741121,0.671372,0],[0,0,1]],false]
];

{
    private ["_object"];

    _object = (_x select 0) createVehicleLocal [0,0,0];
    _object setDir (_x select 2);
    _object setPosATL (_x select 1);
    _object enableSimulation false; // 
    //_object addEventHandler ["handleDamage", { false }];
  //whats wrong here?
}
forEach _objects;

 

I take the basics from the initserver.sqf (i think?) from Vanilla Exile.

I inlcude it in the "init.sqf"  with the command " execVM "test_sign.sqf"; "

 

If somebody can Help me?

Edited by Ganbada

Share this post


Link to post
Share on other sites

Hi,

a possible reason of different behaviors related to enableSimulation is how (or better where) the sqf is being executed.

According to the Initialization Order for Mission Files https://community.bistudio.com/wiki/Functions_Library_(Arma_3)#Initialization_Order they might work or not work.

In addition to this there is also a enableSimulationGlobal available (https://community.bistudio.com/wiki/enableSimulationGlobal)
Dont know exactly what benefit it has, but maybe the community?!

Thanks in advance

1 person likes this

Share this post


Link to post
Share on other sites

Ok after some researching i´ve found a solution for this Problem

its called 

    _object allowDamage false;

so the code should look like this

_objects = 
[
["Exile_Sign_Office_Small",[3918.69,9293.52,-0.544037],312.173,[[-0.741121,0.671372,0],[0,0,1]],false],
["Exile_Sign_Office_Small",[3918.69,9293.52,-0.544037],312.173,[[-0.741121,0.671372,0],[0,0,1]],false]
];

{
    private ["_object"];

    _object = (_x select 0) createVehicleLocal [0,0,0];
    _object setDir (_x select 2);
    _object setPosATL (_x select 1);

    _object allowDamage false; //here it goes ;)
    _object enableSimulation false;
}
forEach _objects;

.Just let this Info here, so if somebody is running in the same Problem.

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.