Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [Dark AI] Change entity action when animation loop ends

Author
Message
Xystus
21
Years of Service
User Offline
Joined: 2nd Sep 2003
Location:
Posted: 8th Sep 2011 01:40
I use this to make entity animations:

select AI Get Entity action$ (Object Number)
case "Moving Forwards":
LOOP OBJECT Object Number, Start Frame, End Frame
endcase

...

but the problem is that AI Get Entity action$ change the action before or after the animation loops ends and that is very ugly.

Is there a better way to make animations accord with entity states?

Thanks and sorry for my english
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Sep 2011 20:35
try using these

AI Set Console Output On
AI Set Console Output Off

this will help you see what your entity is thinking and doing, then you may be able to slow or pause the action.

also try

AI Entity Hold Position. while the animations is running.

Dark Physics makes any hot drink go cold.
Xystus
21
Years of Service
User Offline
Joined: 2nd Sep 2003
Location:
Posted: 9th Sep 2011 12:37
If i try with AI Entity Hold Position while the animations is running the entity doesn´t move and this isn´t what i need.

I know what my entity is doing but i need my entity doesn´t take another decision until my animation ends. I don´t found a command to do this...

Thank you
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Sep 2011 21:18 Edited at: 9th Sep 2011 21:34
found this also show the set command for it. which might do what you wish.
Quote: "
AI GET ENTITY STANCE

This command will get the current stance of the entity. The stance can be defined using AI Set Entity Stance, and is not changing by the AI system. See AI Set Entity Stance for the different behaviours that the stances correspond to.

In manual mode this value has no effect and can be used to store an integer value for any purpose.

Syntax
return integer = AI Get Entity Stance ( Entity Number )

Parameters
Entity Number, The id of the entity to check.

Return
The entity stance as a positive integer.
"


Quote: "AI SET ENTITY STANCE

This command sets the entity stance mode which controls behaviour during automatic mode control (see AI Set Entity Control). During manual control this has no effect except to store the value.

There are 4 main behaviours which have been implemented in automatic mode that you can use to define how you want entities to behave. These can be described as Run Away, Stationary, Cautious and Aggressive.

- Run Away is the default state for neutral entities and results in an entity moving away from any sound it hears or damage it receives from a known direction. Entities are still able to fire in this mode (except neutral entities) but are likely to quickly move out of sight and lose their target. (mode=3)

- Stationary limits the entity to their idle position but they are still allowed to return fire and duck. The entity will not investigate sounds nor move when attacked. (mode=2)

- Cautious allows the entity to move about freely whilst attacking a target but will not attempt to follow or search for a target that goes out of sight. Also it does not readily approach a target preferring to shoot from a distance. (mode=0)

- Aggressive is similar to cautious except that the entity will move towards targets and follow them when they go out of sight. It will also briefly search for targets that remain out of sight for extended periods before returning to its idle position. (mode=1)

You can then use the AI Set Entity Can ____ commands to refine the behaviour to further restrict or allow certain actions that the entity can perform.

Syntax
AI Set Entity Stance Entity Number, Mode

Parameters
Entity Number, The id of the entity to set the stance.
Mode, The new stance for the entity as a positive integer.

Return
n/a
"


Dark Physics makes any hot drink go cold.
Xystus
21
Years of Service
User Offline
Joined: 2nd Sep 2003
Location:
Posted: 12th Sep 2011 12:28 Edited at: 12th Sep 2011 12:29
I solved the problem with

AI Get Entity X ( Entity Number )
AI Get Entity Z ( Entity Number )

before AI Update, so i can keep the position of the entity as long as i want until the loop animation ends.

It was easier than I thought.

Thank you

Login to post a reply

Server time is: 2024-11-24 14:08:28
Your offset time is: 2024-11-24 14:08:28