based on icq dialog.. :)

LECTURE 1
------------------------------------------------------------------------------------

actually all stuff is in state_mgr_animation_list.script

into - "entering" animation to idle
idle - idle 
out - after idle

if y wana totaly new anim then its more hard because y will need to create npc with this animation logic for him etc in le

for example

oso_walk_tank_boss =
{
prop  = { maxidle = 1, sumidle = 3, rnd = 100 }, 

into	= {	[0]	= "oso_walk_tank_boss_0" },

        out   = { [0] = "oso_walk_tank_boss_2" },

          idle = { [0] = "oso_walk_tank_boss_1" },

		rnd		= nil },

y will  need to create 3 parts of one anim into cycled and out

then choose model export to skl

then open actor editor -> motions -> append

then .. find your anim in list.. for into and out should be setted tick "stop at end"

so anim plays one time

then y just replace in state_mgr_animation anims with your names

but dont forget to export object to omf file and copy to game

if y wana more then one part of anims in into

into	= {	[0]	= {"oso_sit_left_main_0a", {s="oso_final4"}, "oso_sit_left_main_3" }},

try something like that

into	= {	[0]	= {"oso_sit_left_main_0a", "oso_sit_left_main_3" }},

s= 
sound

if y wana anims for different states.. without weapon... 0, with pistol.. with ak... etc

look in into

so it plays depending on type of weapon npc has

						into	= { [0]	= "prisluh_0_in",
									[1]	= "prisluh_1_in",
									[2]	= "prisluh_2_in",
									[3]	= "prisluh_3_in",
									[4]	= "prisluh_4_in",
									[8]	= "prisluh_8_in",
									[9]	= "prisluh_9_in",
									[10]= "prisluh_10_in" },

so it play 0 or 1 or 2 or 3.. to 10 depending on what npc have right now

but! its only entering anim 

idle can be such way too
						idle	= { [0]	= "prisluh_0_1",
									[1]	= "prisluh_1_1",
									[2]	= "prisluh_2_1",
									[3]	= "prisluh_3_1",
									[4]	= "prisluh_4_1",
									[8]	= "prisluh_8_1",
									[9]	= "prisluh_9_1",
									[10]= "prisluh_10_1" },

and out

						out		= { [0]	= "prisluh_0_out",
									[1]	= "prisluh_1_out",
									[2]	= "prisluh_2_out",
									[3]	= "prisluh_3_out",
									[4]	= "prisluh_4_out",
									[8]	= "prisluh_8_out",
									[9]	= "prisluh_9_out",
									[10]= "prisluh_10_out" },

so if game choosed 0 then it play 0 everywhere in setted animation (in,idle,out)

						into	= { [0]	= "prisluh_0_in",

						idle	= { [0]	= "prisluh_0_1",
						out		= { [0]	= "prisluh_0_out",



back to roots..

oso_walk_tank_boss =
{
prop  = { maxidle = 1, sumidle = 3, rnd = 100 }, 

into	= {	[0]	= "oso_walk_tank_boss_0" },

        out   = { [0] = "oso_walk_tank_boss_2" },

          idle = { [0] = "oso_walk_tank_boss_1" },

		rnd		= nil }

what is rnd type?

random anim
it plays depends of this parametres
prop  = { maxidle = 1, sumidle = 3, rnd = 100 }, 

when you are in idle cycle

maxidle and sumidle time, after random animation will be choosed

its in seconds
formula how it works
sumidle + random(1..maxidle)

so y set for example sumidle

10 seconds

idle lasts 10 seconds..

+-5 seconds  
sumdile

so after 10 +-5 seconds random anim will be played

to all
some anims needs this but rarely

mostly for global one
it animations of all stalkers like drink, eat... walk etc

there are also specific type animations like soldiers_animation.omf
they replace some of default from stalker_animation.omf (stalker_la.object)

are the anims from stalker_la.object applied to all models of NPCs or it needs to be done for every type of NPC?
if change the anim in that file it will change it for all the NPCs exept specific animations(walk, stand) which were noted.
for example different anims of walking for scies or for bandits or for militaries

bandits_animation.omf soldiers_animation.omf etc


so back to roots

{
prop  = { maxidle = 1, sumidle = 3, rnd = 100 }, 

so to be clear
sumidle - waiting time until rnd
maxidle - +- add time to waiting

rnd - percents how high is probability

that rnd will be played

100%

80%

50%

state_lib.script

      mono_crazy = {	weapon = "strapped",
				movement = move.walk,
				mental = anim.free,
				bodystate = move.standing,
				animstate = "stand",
				animation = "mono_crazy"
			},

so y see setted weapon -> strapped or unstrapped or fire during animation


movement = move.walk,
how engine interpretates our anim
is he walking standing

movement = move.stand,

mental = anim.free,
psyhic mental condition of npc during playing anim in game :D


this one he is calm all fine no worries


mental = anim.danger,

danger :D he is nervous

this can effect badly on anim not sure but i think he can even run away from pose

mental = anim.panic,

he will definatly will be in panic and run away
:D

also forgot there is..
weapon = "none", --no weapon at all
movement = move.run, --run movent type of animation for engine

the only problem in all of this are quotes
if y decide totaly change anim just.. dont mess then :D
its always should be opening quote and closing quote 
{ }

they are reason of all mistakes

						rnd		= { [0]	= {	"prisluh_0_0",
											"prisluh_0_2" },
									[1]	= {	"prisluh_1_0",
											"prisluh_1_2" },
									[2]	= {	"prisluh_2_0",
											"prisluh_2_2" },
									[3]	= {	"prisluh_3_0",
											"prisluh_3_2" },
									[4]	= {	"prisluh_4_0",
											"prisluh_4_2" },
									[8]	= {	"prisluh_8_0",
											"prisluh_8_2" },
									[9]	= {	"prisluh_9_0",
											"prisluh_9_2" },
									[10]= {	"prisluh_10_0",
											"prisluh_10_2" }}},


rnd		= {

}}},

why three?

because

rnd		= { [0]	= {

[10]= {	"prisluh_10_0",
											"prisluh_10_2" }

}},

and remember forever

into out

only "stop at end" animation no cycled at all


or engine wont accept them

also if y see a=
						into	= {	[0]	= {"metering_0_draw_0", {a="kruglov_flash"}, "metering_0_draw_1", 

a= - attach object to hands
						out		= {	[0]	= {"metering_0_hide_0", {d="kruglov_flash"}, "metering_0_hide_1"} },

d= - detach object from hands also only in into and in out

same as s= - sound which can be only in into and in middle between 2 animations

[1]	= {	"norm_facer_1_0", {f=xr_effects.actor_punch}, "norm_facer_1_1", {f=xr_effects.clearAbuse}},

f= 
play special effect from xr_effects.script 
for example this one actor punch it plays camera "move" of punching to face
:D

same only into and maybe out dunno

LECTURE 2
------------------------------------------------------------------------------------

bodystate = move.standing,
bodystate..  so we standing sitting or anything else during animation
this standing

its effect on bones and animation directly i think, so npc will actually sit or stand

bodystate = move.crouch,

crouch - "sitting"

animation =
this one from  state_mgr_animation.script

better set one name for both of them


but y can set different names of course

	laughing = 
	{
		weapon = "strapped",
		movement = move.stand,
		mental = anim.free,
		bodystate = move.standing,
		animstate = "stand",
		animation = "smeh",
	},

or same
	cr_raciya_hide = 
	{ 
		weapon = "strapped",
		movement = move.stand,
		mental = anim.free,
		bodystate = move.crouch,
		animstate = "stand",
		animation = "cr_raciya_hide",
	},



animstate = "sit",
animstate = "stand",

state_mgr_animstate.script

by default everywhere mostly setted stand :D
so maybe left that way.. actually its "middle" animations mostly


		stand		= { sit			= {nrm = {"idle_0_to_sit_0"}},
						sit_knee	= {nrm = {"idle_0_to_sit_1"}},
						sit_ass		= {nrm = {"idle_0_to_sit_2"}},
						sleep		= {nrm = {"idle_0_to_sit_0","sit_to_sleep_0"}}},

from idle to sit for example

middle poses between your anims to engine default

y can create new "middle" poses but me personaly never did it :D
wasnt needed
because out and into works same style...

in state_mgr_animations

anyway y can set the
stand
sit
sit_knee
sit_ass
sleep

by default mostly everywhere stand

if set weapon = "fire",
npc will fire by his attached weapon during animation

direction = look.cur_dir,

where to look during animation
mostly not needed

it can be done by waypoints in le

      oso_actor_attempt_fire = { weapon = "fire",
				weapon_slot = 1,
				movement = move.walk,
				mental = anim.free,
				bodystate = move.standing,
				animstate = "stand",
				animation = "oso_actor_attempt_fire"

weapon_slot = 1,
slot of activated weapon which will fire in this case

inventory slot

so 2 i guess pistols

but if npc has only one weapon than 1

if 2 ak and pistol
than 2 for pistol

wounded_heavy_3 = { weapon = "drop",

:)
drop weapon

during anim

and last thing

	idle = {	weapon = nil,
				movement = nil,
				mental = nil,
				bodystate = nil,
				animstate = "stand",
				animation = nil
			},

this one engine animation

	walk = {	weapon = "strapped",
				movement = move.walk,
				mental = anim.free,
				bodystate = move.standing,
				animstate = "stand",
				animation = nil
			},

y see animation setted to nil

so in game i can't set this as animation only like "state"

its actually logic..
so i cant write anim = walk i need to write def_state_moving = walk so npc will move with this state

or def_state_standing = idle
so he will stand in this state

if i wana write as animation

	wait = {	weapon = "strapped",
				movement = move.stand,
				mental = anim.free,
				bodystate = move.standing,
				animstate = "stand",
				animation = "idle"
			},

anim = wait
same as 
def_state_standing = idle

problem with engine anims..they are absolute 
no way to change it script way

and game uses them during whole game

but most types of this engine 'animations' has normal one analog in state_mgr_animation.script so possible to use them as usual

def_state_standing = idle
default state standing

so to create anim
write it there
state_mgr_animation.script
and
create a state there
state_lib.script
its all
y can use it where y want in game
if y have already animation y will need only change it in
state_mgr_animation.script or if change is radical then in state_lib

END
------------------------------------------------------------------------------------
