Jump to content
Sign in to follow this  
armilio

block a soldier in one point

Recommended Posts

There is a way to block a soldier in one point? even with "hold" waypoint command, if you shot near a IA man he move. Is a good thing generally, but i want keep a colonel safe in a building.

Thanks a lot for your helps!

Share this post


Link to post
Share on other sites

Write :

this disableAI "MOVE"

in the init line of the unit, in the game editor.

Share this post


Link to post
Share on other sites

You put it in the initialization field of the unit for example. Select the guy you don't want to move and in the box named INITIALIZATION in the editor you write that.

Share this post


Link to post
Share on other sites

Ok, i have tried.

Work, but with this script not even can turn left or right! even if i shot. If i enter in the building, they cannot defend himself.

Edited by Armilio

Share this post


Link to post
Share on other sites

The AI can barely defend themselves in buildings even if you don't disable their movement. But try this forceSpeed 0. They should stay in one spot but still be able to turn. However, they will still move sometimes, for example if they are wounded. Combine it with group this enableAttack false and they should usually stay put.

Share this post


Link to post
Share on other sites

but if I use enableattack false, they respond to the fire?

Share this post


Link to post
Share on other sites

I've used this as a solution in the past. This method forces the unit to kneel, be ready for combat, but not able to move, until you are danger close.

Great for placing behind cover at windows or lying prone in sniping positions etc.

Remember to face him in the likely direction he will see the enemy coming. In the following example we will place a unit in the kneeling position ready for combat.

For this example name him KnUnit1.

Set this as KnUnit1 init

this setUnitPos "MIDDLE";this setBehaviour "AWARE";this setCombatMode "RED";this disableAI "MOVE";

Now setup an elliptical trigger centred around the unit of say 3-5m, with activation BlueFor Trigger once, and Present

and set the On Act: to

KnUnit1 enableAI "MOVE";

Basically what this will do is leave the unit in a kneeled position able to shoot, but if you come within say 5m of him, you will trip the trigger and he will turn and defend himself.

The advantage of this is is it also lets him behave more realistically as you can't sneak up behind him.

Useful for placing units to surprise you or for concealing them until the last minute.

Units stance options can be "UP" to force to stand, "MIDDLE" to force to crouch or "DOWN" for prone.

Edited by Beerkan

Share this post


Link to post
Share on other sites
but if I use enableattack false, they respond to the fire?

Yes, they will still shoot. enableAttack just decides if they will go looking for you or not. For example if you have a group of AI and one of them spots an enemy, the AI leader will usually give orders for some subordinates to go looking for the threat and engage it. If you enableAttack false, the leader will not give any attack orders.

Beerkan's method is what I usually use, the downside is that if you are in a position where you can see the AI, for example in a window, and he should be able to see you, you may be far enough away from the trigger that the AI won't be able to turn and shoot you. But if anyone uses disableAI "move" then they should always allow them to move again when the players get close, otherwise it just looks ridiculous when you get near them.

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  

×