My first attempts at creating a custom AI script have ended in frustration.
Here's what I'm trying to do (this should be relatively easy):
I'm trying to create some simply random "fidgets" for the entity.
Something along the lines of
:state=1:animate=1
:state=1,random=100:animate=6
:state=1,random=100:animate=7
In theory this script would have the character standing idle and randomly preforming action 6 (reload) and action 7 (press button). By adjusting the random=100 you could alter the frequency of the random fidgeting.
In practice what happens is the entity will loop an animation several times. In other words the entity will play the reload animation 3, 4 or more times in a row.
I tried every combination I could think of using freeze, animate=1, frameatend, alternate states, etc. and I could NOT get the AI to play an animation sequence only once!?!
Did I hit another bug here relating to the timing given to AI or am I just missing an obvious sequence of FPI commands?
This is a very easy setup to test. Create a room, place a player marker and 1 entity (I was using Aiko w/ blaster pistol for all my tests). Give the entity the custom AI with NO other commands in it (so the entity doesn't wander around, etc.)
IF anyone can get this to work please let me know... and do test what you post because I want to ascertain that this is something I'm doing wrong and not a bug.
I'm not going to post my exact script here because I would rename the test script each time and re-assign it to the entity to make sure it was using a fresh script. I no longer have all the different variations I tried...
Let's put it this way - I got up to a_test30.fpi before I gave up in frustration for the night.