Open eduzappa18 opened 9 months ago
I don't think actors have state files in AA. It's just a big state diagram that is hard coded. BTW, fakk2 AI is defo different in implementation than AA. Can you give examples of the function/contents of fakk2 state files for actors?
for example, this is models/claw.tik
TIKI
setup
{
scale 1.0
path models/monster/claw
surface material1 shader claw.tga
radius 100
}
$define clawdir sound/monsters/claw
init
{
server
{
classname Actor
setsize "-32 -32 0" "32 32 116"
stationary
statemap ai/klaw.st
fov 20
nodamage
name "Klaw"
deaf
targetable 0
attackablebyactors 0
}
client
{
cache $clawdir$/impact1.wav
cache $clawdir$/move4.wav
cache $clawdir$/strike1.wav
cache $clawdir$/idle.wav
cache dirtcloud.spr
cache dirtpiece.spr
}
}
and this is ai/klaw.st
state IDLE
{
legs
{
idle : default
}
behavior idle
states
{
STUNNED : STUNNED
// STRIKE_SHORT : RANGE "300" "50" CAN_SEE_ENEMY NAME "Klaw (short)"
// STRIKE_SHORT : RANGE "300" "50" CAN_SEE_ENEMY NAME "Klaw (medium)"
// STRIKE_MEDIUM : RANGE "400" "50" CAN_SEE_ENEMY NAME "Klaw (medium)"
// STRIKE_SHORT : RANGE "300" "50" CAN_SEE_ENEMY NAME "Klaw"
// STRIKE_MEDIUM : RANGE "400" "50" CAN_SEE_ENEMY NAME "Klaw"
// STRIKE_LONG : RANGE "550" "50" CAN_SEE_ENEMY NAME "Klaw"
STRIKE_LONG : NAME "Klaw" MOVING_ACTOR_RANGE "550" "50"
STRIKE_MEDIUM : NAME "Klaw" MOVING_ACTOR_RANGE "400" "50"
STRIKE_SHORT : NAME "Klaw" MOVING_ACTOR_RANGE "300" "50"
STRIKE_MEDIUM : NAME "Klaw (medium)" MOVING_ACTOR_RANGE "400" "50"
STRIKE_SHORT : NAME "Klaw (medium)" MOVING_ACTOR_RANGE "300" "50"
STRIKE_SHORT : NAME "Klaw (short)" MOVING_ACTOR_RANGE "300" "50"
}
}
state STRIKE_SHORT
{
legs
{
strikeshort : default
}
behavior idle
states
{
WAIT : ANIM_DONE
}
}
state STRIKE_MEDIUM
{
legs
{
strikemid : default
}
behavior idle
states
{
WAIT : ANIM_DONE
}
}
state STRIKE_LONG
{
legs
{
strikelong : default
}
behavior idle
states
{
WAIT : ANIM_DONE
}
}
state WAIT
{
legs
{
idle : default
}
behavior idle
time ".2" ".5"
states
{
STUNNED : STUNNED
IDLE : DONE
}
}
state STUNNED
{
entrycommands
{
attachmodel fx_stars.tik tag_clawend 1 "" 0 -1 -1 -1 -1 "0 0 80"
}
legs
{
stunned : default
}
states
{
IDLE : ANIM_DONE !STUNNED
}
exitcommands
{
removeattachedmodel tag_clawend
}
}
//
// Script stuff
//
state SCRIPT_STRIKE_SHORT
{
entrycommands
{
// removeattachedmodel tag_clawend
}
states
{
SCRIPT_STUNNED : STUNNED
SCRIPT_STRIKE_SHORT2 : default
}
}
state SCRIPT_STRIKE_MEDIUM
{
states
{
SCRIPT_STUNNED : STUNNED
SCRIPT_STRIKE_MEDIUM2 : default
}
}
state SCRIPT_STRIKE_LONG
{
states
{
SCRIPT_STUNNED : STUNNED
SCRIPT_STRIKE_LONG2 : default
}
}
state SCRIPT_STRIKE_SHORT2
{
legs
{
strikeshort : default
}
behavior idle
states
{
SCRIPT_IDLE : ANIM_DONE
}
}
state SCRIPT_STRIKE_MEDIUM2
{
legs
{
strikemid : default
}
behavior idle
states
{
SCRIPT_IDLE : ANIM_DONE
}
}
state SCRIPT_STRIKE_LONG2
{
legs
{
strikelong : default
}
behavior idle
states
{
SCRIPT_IDLE : ANIM_DONE
}
}
state SCRIPT_IDLE
{
legs
{
idle : default
}
behavior idle
states
{
SCRIPT_STUNNED : STUNNED
IDLE : HAVE_ENEMY
}
}
state SCRIPT_STUNNED
{
entrycommands
{
attachmodel fx_stars.tik tag_clawend 1 "" 0 -1 -1 -1 -1 "0 0 80"
}
legs
{
stunned : default
}
states
{
SCRIPT_IDLE : ANIM_DONE !STUNNED
}
exitcommands
{
removeattachedmodel tag_clawend
}
}
Here is a related thread on xNULL from 2012 It looks like RR was looking into adding that feature to reborn https://www.x-null.net/forums/threads/1464-State-Files-State-Files-State-Files-and-suggestions
So in FAKK2 there is an Actor command called
statemap
that allows you to set specific state files to different AI's e.g.statemap ai/default.st
I wonder if it would be possible to add a similar command to set a state file to only one player via script.
For example
No idea if it's even possible to add something like this to NightFall (or maybe OPM), but it would be really convenient to have it