#include maps\_utility; #include common_scripts\utility; #include animscripts\shared; #include animscripts\utility; #include animscripts\face; CONST_anim_end_time = 0.25; init() { if ( !isDefined( level._scr_notetrack ) ) level._scr_notetrack = []; if ( !isDefined( level._scr_face ) ) level._scr_face = []; if ( !isDefined( level._scr_look ) ) level._scr_look = []; if ( !isDefined( level._scr_animSound ) ) level._scr_animSound = []; if ( !isDefined( level._scr_sound ) ) level._scr_sound = []; if ( !isDefined( level._scr_radio ) ) level._scr_radio = []; if ( !isDefined( level._scr_text ) ) level._scr_text = []; if ( !isDefined( level._scr_anim ) ) level._scr_anim[ 0 ][ 0 ] = 0; if ( !isDefined( level._scr_radio ) ) level._scr_radio = []; } endonRemoveAnimActive( endonString, guyPackets ) { self endon( "newAnimActive" ); self waittill( endonString ); foreach ( guyPacket in guyPackets ) { guy = guyPacket[ "guy" ]; if ( !isdefined( guy ) ) continue; guy._animActive--; guy._lastAnimTime = GetTime(); Assert( guy._animactive >= 0 ); } } /* ============= ///ScriptDocBegin "Name: anim_first_frame( , , )" "Summary: Puts the animating models or AI or vehicles into the first frame of the animated scene. The animation is played relative to the entity that calls the scene" "Module: _Anim" "CallOn: The root entity that is the point of relativity for the scene, be it node, ai, vehicle, etc." "MandatoryArg: : An array of AI or vehicles or script_models, mixed or homogenous." "MandatoryArg: : The anime in level.scr_anim[ animname ][ anime ]." "OptionalArg: : A tag that the root entity has that the animating entities are attached to." "Example: node anim_first_frame( guys, "rappel_sequence" );" "SPMP: singleplayer" ///ScriptDocEnd ============= */ anim_first_frame( guys, anime, tag ) { array = get_anim_position( tag ); org = array[ "origin" ]; angles = array[ "angles" ]; array_levelthread( guys, ::anim_first_frame_on_guy, anime, org, angles ); } /* ============= ///ScriptDocBegin "Name: anim_generic_first_frame( , , )" "Summary: Puts the animating model or AI or vehicle into the first frame of the animated scene. The animation is played relative to the entity that calls the scene" "Module: _Anim" "CallOn: The root entity that is the point of relativity for the scene, be it node, ai, vehicle, etc." "MandatoryArg: : An AI or vehicle or script_model." "MandatoryArg: : The anime in level.scr_anim[ animname ][ anime ]." "OptionalArg: : A tag that the root entity has that the animating entities are attached to." "Example: node anim_generic_first_frame( guy, "rappel_sequence" );" "SPMP: singleplayer" ///ScriptDocEnd ============= */ anim_generic_first_frame( guy, anime, tag ) { array = get_anim_position( tag ); org = array[ "origin" ]; angles = array[ "angles" ]; thread anim_first_frame_on_guy( guy, anime, org, angles, "generic" ); } /* ============= ///ScriptDocBegin "Name: anim_generic( , , )" "Summary: Makes an AI play a generic anim. The calling ent notifies itself the name of the animation scene when it completes." "Module: _Anim" "CallOn: The root entity that is the point of relativity for the scene, be it node, ai, vehicle, etc." "MandatoryArg: AI, model, or vehicle." "MandatoryArg: : The anime in level.scr_anim[ generic ][ anime ]." "OptionalArg: : A tag that the root entity has that the animating entities are attached to." "Example: node anim_generic( guy, "rappel_sequence" );" "SPMP: singleplayer" ///ScriptDocEnd ============= */ anim_generic( guy, anime, tag ) { guys = []; guys[ 0 ] = guy; anim_single( guys, anime, tag, 0, "generic" ); } /* ============= ///ScriptDocBegin "Name: anim_generic_gravity( , , )" "Summary: Makes an AI play a generic anim with gravity (so he'll self aline to any floor even if the animation doesnt). The calling ent notifies itself the name of the animation scene when it completes." "Module: _Anim" "CallOn: The root entity that is the point of relativity for the scene, be it node, ai, vehicle, etc." "MandatoryArg: AI, model, or vehicle." "MandatoryArg: : The anime in level.scr_anim[ generic ][ anime ]." "OptionalArg: : A tag that the root entity has that the animating entities are attached to." "Example: node anim_generic( guy, "rappel_sequence" );" "SPMP: singleplayer" ///ScriptDocEnd ============= */ anim_generic_gravity( guy, anime, tag ) { pain = guy.allowPain; guy disable_pain();// anim_custom allows for pain - since 99% of the time this is unwanted behavior - we turn off pain before doing the anim. self anim_generic_custom_animmode( guy, "gravity", anime, tag ); if( pain ) guy enable_pain(); } /* ============= ///ScriptDocBegin "Name: anim_set_time_solo( ,