Enemy AI lay still on ground.

Post Reply
User avatar
Ender
Posts: 218
Joined: Sun Mar 06, 2016 5:42 pm
Location: Sweden
Contact:

Enemy AI lay still on ground.

Post by Ender »

Usually if you for example put an AI in a building, once the bullets start flying he lay on the ground completely still.

What I wonder is if anyone got any info, tricks in how to make the AI stand up without making movement waypoints. Maby a hold waypoint with stand but I never tried it so if someone know something that will, it would be good!

Cheers!
It is the challenge that makes one better, to push one's limit and actively look for things to do better- Ender
User avatar
Wombat
Posts: 601
Joined: Mon Jan 18, 2016 3:19 am
Contact:

Re: Enemy AI lay still on ground.

Post by Wombat »

You can force a unit to stay standing by entering the following code into it's init:

this setUnitPos "UP";

You can also force units to stay crouch or prone by using "MIDDLE" or "DOWN" respectively. I'm sure it's possible to create a more detailed script which forces a unit to go from standing to a crouch for X number of seconds when he takes damage and then return back to standing again (see setUnitPos, getDammage and sleep). This could make an AI use cover more effectively when fighting from a window for example.
StRiKeR
Posts: 293
Joined: Sun Jan 17, 2016 5:10 pm
Contact:

Re: Enemy AI lay still on ground.

Post by StRiKeR »

Please put this kind of question in the Editing Forum next time. It does not specifically concern Server 2. ;)
User avatar
Wombat
Posts: 601
Joined: Mon Jan 18, 2016 3:19 am
Contact:

Re: Enemy AI lay still on ground.

Post by Wombat »

StRiKeR wrote: Thu Sep 28, 2017 4:48 pm Please put this kind of question in the Editing Forum next time. It does not specifically concern Server 2. ;)
Quite right, I actually failed to spot that. I will move it to the correct forum.
User avatar
Ender
Posts: 218
Joined: Sun Mar 06, 2016 5:42 pm
Location: Sweden
Contact:

Re: Enemy AI lay still on ground.

Post by Ender »

Cheers!
It is the challenge that makes one better, to push one's limit and actively look for things to do better- Ender
User avatar
2600K
Posts: 173
Joined: Sun Jan 17, 2016 5:21 pm
Contact:

Re: Enemy AI lay still on ground.

Post by 2600K »

There's a 'stance' icon under 'Object States' which has the same effect as adding the code into the units init.
lawman
Posts: 49
Joined: Sun Oct 23, 2016 7:21 pm
Contact:

Re: Enemy AI lay still on ground.

Post by lawman »

You can also disable certain aspect of the AI if you wish for them to remain specifically in one position.

Here's the init of a unit that will always remain standing in the window, and should be observing a specific position without moving, fleeing or engaging enemies (will still open fire at will though).


this setUnitPos "UP";
this disableAI "path";
this disableAI "FSM";
this lookAt gateMain;


I think I may have been having trouble with the lookAt command not being strict enough (unit still scans surrounding area when shots heard) but this may be because of ACE scripting.

I haven't yet looked into testing that further though.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests