Jump to content
Sign in to follow this  
tortuosit

Enable dynamic simulation with script

Recommended Posts

Hi guys, I am editing another guys code. It is about spawning units in houses and I want to test dynamic simulation. But it did not start, units happily moved even when I was miles away.

 

enableDynamicSimulationSystem true;
[...]
_unit = _milGroup createUnit [_unitType, _newPos, [], 0, "NONE"];
_unit setpos _newPos; _unit enableDynamicSimulation true;
hint str (dynamicSimulationEnabled _unit);

Relevant code. The hint returns "false" - How is it possible?

 

 

Share this post


Link to post
Share on other sites

In 3den you can only tick Enable Dynamic Simulation for groups or objects, not units. For units you can tick Wake-Up Dynamic Simulation. So maybe it need to be group in the script as well?

  • Like 1

Share this post


Link to post
Share on other sites

Well now I have set ""Group" setDynamicSimulationDistance 100;"

 

And still, the group is in the north of Stratis, I am (player) in the south end, and I can see, all 3 members of the group move. Even after minutes.

Share this post


Link to post
Share on other sites

As mentioned by Janez, have you tried to add the dynamic simulation to the group of the untis as in
 

_milGroup enableDynamicSimulation true;

I personally only touch the setting of dynamic simulation in the editor and just enable it on ais, groups and objects upon them spawning.

  • Like 1

Share this post


Link to post
Share on other sites

Guys, I was blind. Happily confused groups with units. As it seems, dyn. sim. has to be applied to groups.

EDIT: it works.

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  

×