Jump to content
Sign in to follow this  
Guest

How do i stop a unit from moving?

Recommended Posts

Guest

Hey fellas,

I have created a soldier, and would like him to stay exactly where i placed him, even if he wants to engage an enemy. I have made a waypoint on top of him telling him to hold, but when he sees an enemy he just runs off like an idiot towards them and gets killed.

So how would i go about stopping him from being able to move under any cicumstances?

Thanks alot,

Rich.

Share this post


Link to post
Share on other sites

With disableAI:

_soldier1 disableAI "MOVE";

You can combine that with _soldier1 setUnitPos "UP"; to keep them standing after you attack them. The main drawback of this is that they can't move at all. Meaning, unless you stand directly in their line of line (not arc, line) they can't turn to shoot you.

Edited by kylania
Standing and firing arc limitations.
  • Like 1

Share this post


Link to post
Share on other sites
dostop this

or

commandstop this 

works also... but they can move if given another order by their commander

Share this post


Link to post
Share on other sites

Also try to put this in the units init field:

unit allowfleeing 0

or for group

{_x allowfleeing 0} foreach units group groupname

I needed to use this to halt captive east officers from running away from guerilla enemy, because if the unit is overwhelmed by enemy, he will flee even if u use dostop or HOLD waypoint.

hope this helped

Share this post


Link to post
Share on other sites

DisableAI is the most guaranteed way to keep them from moving. With anything else there's still a chance they could want to move, but disableAI physically prevents them from doing it.

Share this post


Link to post
Share on other sites

how can i make the unit with disableAI "MOVE" to be able to move again?

I tried enbaleAI "move" but it won't move?

---------- Post added at 10:15 AM ---------- Previous post was at 10:13 AM ----------

Forget it...haha, i didnt put condition true on the trigger xDDD <- dumbass!

Share this post


Link to post
Share on other sites

I put

this disableAI "MOVE";

into the init of a tank put he will stimm move.... :(

Is there any trick ?

Share this post


Link to post
Share on other sites

disableAI "MOVE" only works for units, not vehicles.

Try making a waypoint over the tank,like "MOVE", and on condition: tankmove, then you need a trigger that sets the tankmove to TRUE so the tank moves someday =)

Share this post


Link to post
Share on other sites

I don't think it works for vehicles, that would be too easy. I want to disable AI from driving but keep them in and engine on.

If anyone has a fix that would be usefull.

Share this post


Link to post
Share on other sites

I am using disableAI on a Humvee, an insurgent pickup, and a civilian car and it works fine. I know it does not work for aircraft, though.

Share this post


Link to post
Share on other sites
I am using disableAI on a Humvee, an insurgent pickup, and a civilian car and it works fine. I know it does not work for aircraft, though.

Are you sure it's on the vehicle and not the man driving, if you put it on the man and he gets in the car then dissableAI will work but if they are in the vehicle from the start it seems to ignore the command.

Share this post


Link to post
Share on other sites
Guest

Thanks for all the help fellas, i got it all worked out now :D

Share this post


Link to post
Share on other sites
Are you sure it's on the vehicle and not the man driving, if you put it on the man and he gets in the car then dissableAI will work but if they are in the vehicle from the start it seems to ignore the command.

Could always try putting this in the init line of a vehicle placed in editor:

(driver this) disableAI "MOVE";

That should work in that situation

Share this post


Link to post
Share on other sites

Are there examples of how to script an AI to halt or proceed to waypoints through the dialogue box available? I'm trying to create a mission where the player is clearing areas before a convoy goes through. I can get a result by creating triggers that hold the convoy at waypoints until the player goes through the area but it's sloppy and impercise. What if the player is in an area in a fire fight but it triggers the truck anyway? I'd like to give the player a manual option.

Share this post


Link to post
Share on other sites

Instead of activating the trigger when the player steps into it, just activate it via radio-command. Anything wrong with that ?

Share this post


Link to post
Share on other sites

Hi everyone ! I'm late but i'm scripting a mission on A3, I wan't to create a shop system like in life's servers, so I've follow what you say and places that in the init field of the unit (a civilian) :

this addEventHandler ["HandleDamage", {false}];
this disableAI "MOVE";
this setUnitPos "UP";

It's work fine but when i shoot on the units it say "Cease FIRE !!!!!" and play the dying animation very quick and go up after ... how to disable totaly those two things ... to make him not react to shooting (I'm a beginner in scripting ^^).

Thanks

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  

×