Jump to content
Sign in to follow this  
PorkyJack

Prevent units from moving

Recommended Posts

Im making a mission, it's in a city and there are snipers on the rooftops. Sometimes though, they start moving and fall down of the building. Any ideas?

Share this post


Link to post
Share on other sites

The command disableAI "MOVE" will stop the unit from moving completely, including turning. The command forceSpeed 0 will stop movement EXCEPT turning (but this can be overridden with an engage order from the squad leader though so make sure you set combat yellow mode or the unit might start moving anyway). Last is doStop this, This command will stop the unit until any new order is given by the squad leader. This will cause units to stay in place at the start of the mission if they have no other waypoints or battles to attend to. One more thing you might want to do is turn off "In Formation" when you create the unit so they will be exactly where you place them in the editor.

Share this post


Link to post
Share on other sites

What a fortune! I was looking for this exactly.

Only some more info: the exact syntax of theese commands.

Should I put those script in the init line of the unit?

Do I need space or ";"

What I need is a unit well grouped that wait in an enclosed space without running outside so when player enter from the sole hallway, he find the unit waiting for him :D

P.S. What is combat yellow mode?

Edited by puzzola

Share this post


Link to post
Share on other sites

Check here for all the combat mode colors:

http://community.bistudio.com/wiki/setCombatMode

In the init line of a unit:

this disableAI "move";

semi-colon is optional unless you have multiple commands

For roof tops, I recommend playing with setbuildingpos command until you find the right position. The unit should stay in the right place without falling.

this setPos (nearestBuilding this buildingPos 3);

replacing the 3 with the correct position. You will have to experiment until it's right.

Share this post


Link to post
Share on other sites
The command forceSpeed 0 will stop movement EXCEPT turning (but this can be overridden with an engage order from the squad leader though so make sure you set combat yellow mode or the unit might start moving anyway).

Mmm... My squad leader give the "engage" order even if the group is in yellow combat mode... Am i missing something? :j:

Edited by Federico 76

Share this post


Link to post
Share on other sites
Check here for all the combat mode colors:

http://community.bistudio.com/wiki/setCombatMode

In the init line of a unit:

this disableAI "move";

semi-colon is optional unless you have multiple commands

For roof tops, I recommend playing with setbuildingpos command until you find the right position. The unit should stay in the right place without falling.

this setPos (nearestBuilding this buildingPos 3);

replacing the 3 with the correct position. You will have to experiment until it's right.

Very useful, for the future too, thank you :)

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  

×