ok, i can't go into great detail at the moment because i am at work, but here's some info ..
Most of the animations are dealt with inside the script, these re the animation ranges you see listed in the LUA. However these are generally character specific, ie the ranges in the ai_soldier.lua script correspond with the default animations on all of the soldier characters and won't work if your characters animation ranges differ.
The various animations are called by the ai_soldier_state[e] = "" commands, these are partially hard coded, we can't add new ones to them, we're stuck with the ones we have (there are ways but they involve pretty much writing your own AI script and things won't be as automated as the scripts with the ai commands).
This is where the CSI_ list comes in.
The csi_ fields in the fpe are basically a list of overides for the lua scripting, each of them will make the animations you specify there run instead of the animations listed in the lua script, that is the list we have to work with, each one corresponds with a certain animation task, for example csi_relaxed1 is your primary idle animation, csi_unarmedmovefore is your unarmed walk forward.
These commands prmarily deal with character AI, you can use custom animations that correspond with the ai functions only, so you couldn't replace csi_unarmedmovefore with a dance, not unless you wanted it to dance while walking forward, and so on.
Here's a list of what we've worked out they do so far with their corresponding commands:
csi_relaxed1 --idle animation used when character is in CharacterControlFidget(e) (and maybe limbo?)
csi_relaxed2 --idle2, not sure this is used yet
csi_relaxedmovefore --not sure this is used (use unarmedmovefore instead)
csi_cautious --it's an alerted type stance, not sure this is used yet
csi_cautiousmovefore --alerted and moving, not sure this is used yet
csi_unarmed1 --punch / melee attack when not armed (doesnt have a direct AI reference yet)
csi_unarmed2 --kick / melee attack2 when not armed (doesnt have a direct AI reference yet)
csi_unarmedconversation --talking animation, not used
csi_unarmedexplain --talking2, not used
csi_unarmedpointfore --pointing, not used
csi_unarmedpointback --pointing, not used
csi_unarmedpointleft --pointing, not used
csi_unarmedpointright --pointing, not used
csi_unarmedmovefore walking forward while not armed, use SetCharacterToWalk(e) and AIEntityGoToPosition()
csi_unarmedmoverun --running while unarmed, use SetCharacterToRun(e) and AIEntityGoToPosition()
csi_unarmedstairascend --for going up stairs, not used
csi_unarmedstairdecend --for going down stairs, not used
csi_unarmedladderascend1 --ladder climbing, not used
csi_unarmedladderascend2 --ladder climbing, not used
csi_unarmedladderascend3 --ladder climbing, not used
csi_unarmedladderdecend1 --ladder climbing, not used
csi_unarmedladderdecend2 --ladder climbing, not used
csi_unarmeddeath --not used because of ragdoll
csi_unarmedimpactfore --taking damage, not used
csi_unarmedimpactback --taking damage, not used
csi_unarmedimpactleft --taking damage, not used
csi_unarmedimpactright --taking damage, not used
csi_inchair --sat down, not used
csi_inchairsit --sat down, not used
csi_inchairgetup --sat down, not used
csi_swim --i think this 1 is the get into swim position, not used
csi_swimmovefore --swimming, not used
csi_stoodnormal --stood with weapon, not used
csi_stoodfidget1 --i believe this is the CharacterControlFidget(e) when armed
csi_stoodfidget2 --not used
csi_stoodfidget3 --not used
csi_stoodfidget4 --not used
csi_stoodstartled --not used
csi_stoodpunch -- melee attack when holding weapon (not used)
csi_stoodkick -- melee attack2 when holding weapon (not used directly)
csi_stoodmovefore --i think this the CharacterControlArmed(e) version of SetCharacterToWalk(e) and AIEntityGoToPosition()
csi_stoodmoveback --i think this the CharacterControlArmed(e) version of SetCharacterToWalk(e) and AIEntityGoToPosition()
csi_stoodmoveleft --i think this the CharacterControlArmed(e) version of SetCharacterToWalk(e) and AIEntityGoToPosition()
csi_stoodmoveright --i think this the CharacterControlArmed(e) version of SetCharacterToWalk(e) and AIEntityGoToPosition()
csi_stoodstepleft --not used
csi_stoodstepright --not used
csi_stoodstrafeleft --not used
csi_stoodstraferight --not used
csi_stoodvault --climbing over an obstacle, not used (but i think it's jump in third person?)
csi_stoodmoverun --i think this the CharacterControlArmed(e) version of SetCharacterToRun(e) and AIEntityGoToPosition()
csi_stoodmoverunleft --i think this the CharacterControlArmed(e) version of SetCharacterToRun(e) and AIEntityGoToPosition()
csi_stoodmoverunright --i think this the CharacterControlArmed(e) version of SetCharacterToRun(e) and AIEntityGoToPosition()
csi_stoodreload --reloading, not used
csi_stoodwave --not used
csi_stoodtoss --throwing a grenade etc, not used
csi_stoodincoverleft --not used
csi_stoodincoverpeekleft --not used
csi_stoodincoverright --not used
csi_stoodincoverpeekright --not used
csi_stoodandturn --not used
csi_crouchidlenormal1 --not used? maybe CharacterControlFidget(e) in Ducked mode
csi_crouchidlenormal2 --not used
csi_crouchdown --CharacterControlDucked(e)
csi_crouchrolldown --not used
csi_crouchrollup --not used
csi_crouchmovefore --these control the animation while in Ducked mode
csi_crouchmoveback --these control the animation while in Ducked mode
csi_crouchmoveleft --these control the animation while in Ducked mode
csi_crouchmoveright --these control the animation while in Ducked mode
csi_crouchmoverun --dont think this works
csi_crouchreload --these control the animation while in Ducked mode
csi_crouchwave --not used
csi_crouchimpactfore --not used
csi_crouchimpactback --not used
csi_crouchimpactleft --not used
csi_crouchimpactright --not used
csi_crouchgetup --CharacterControlStood(e) or CharacterControlStand(e) (cant remember which)
Note: csi_unarmedxxxxx are your unarmed animations, and csi_stoodxxxxx and csi_crouchxxxxx are your armed animations
You will notice that some of the fpe files have weapon specific lists of csi_ fields, these are for the uber soldier that has animations for all the main modern weapons, and changing their weapon in the fpe should tell the ai which set to use, however i'm not entirely sure if they actually work or not, ive never seen them do anything.
Basically changing the animation ranges in the csi_ fields will override the ranges listed inside the ai script, so if you have the same ranges as the uber soldier for example you can actually leave all these blank.
Now on to custom animations that aren't part of the csi_ range. For example your example of dancing, you will not be able to do this in an existing AI script, and you would not be able to use csi_ to do this. You would have to specify the animation ranges under then ;anim section, and then write the commands into a script.
The ;anim section will look like this:
;anim
animmax = 2
anim0 = 0,100
anim1 = 101,200
playanimineditor = 0
animmax is the total number of animations you have added to this section, animX is each individual range, increase the number by 1 for each animation you add starting at 0, this number on the end is the number you need for your script, playanimineditor will make your anim0 loop without having to call it whenever there is no other animation set to run, this is great for a base idle animation, 0 is no, 1 is yes.
To animate the range listed in anim1 once then stop you would need to do the following:
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(e,1)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if g_Entity[e]['animating'] == 0 then
--tells your script to get ready to animate.
SetAnimationFrames(e,v)
--is used to queue up the animation you have chosen ready to be played, v is the number on the end of animX.
PlayAnimation(e)
--tells the script to play the queued animation
g_Entity[e]['animating'] = 1
--tells your script to stop when it's finished the animation range.
end
-- closes the "if" loop
Now if you had 4 dance animations you could create a chain of animations, but you would need to do it in conjunction with a timer thus:
function dancing_init(e)
StartTimer(e)
end
function dancing_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 1000 then
StartTimer(e)
end
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(e,1)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetTimer(e) > 5000 then
SetAnimationFrames(e,2)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetTimer(e) > 10000 then
SetAnimationFrames(e,1)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetTimer(e) > 15000 then
SetAnimationFrames(e,3)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
if GetTimer(e) > 20000 then
SetAnimationFrames(e,0)
PlayAnimation(e)
g_Entity[e]['animating'] = 1
end
end
and the character would play the animations a single time each every 5 seconds in the following order 1 2 1 3 0
Alternatively instead of SetAnimationFrames(e,1) to run anim1, you could hard code your ranges into the script and forget about the ;anim portion of the fpe by putting for example: SetAnimationFrames(50,100), that would then set the range of 50 to 100 to play the next time PlayAnimation(e) is called.
That's about all i can hep you with at the moment, i'm not 100% on animation myself, i'm still learning, and i probably got some of it wrong, but as far as i know it's mostly right. Hope it helps.
i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.