[javascript] Character
Viewer
- // character.zonescript
- // Created on: 23-Feb-2019
- // Last modified on: 06-May-2019
- //--------------------------------------------------------------------------
- import includes.animations.generate;
- import includes.animations.logic;
- //--------------------------------------------------------------------------
- function processCharacterAnimations(src, tgt, character_name)
- {
- var array = [];
- var animations = [];
- array = array.concat(processAnimation(src, "combat_idle", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "combat_walk", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_idle", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_walk", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "explore_idle", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "explore_walk", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "dead_idle", true, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "cast_big", false, character_name, animations, -16.0, "CastEvent", 31));
- array = array.concat(processAnimation(src, "cast_small", false, character_name, animations, -16.0, "CastEvent", 12));
- array = array.concat(processAnimation(src, "combat_to_explore", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_big_cast", false, character_name, animations, -16.0, "CastEvent", 26));
- array = array.concat(processAnimation(src, "crouch_big_hit", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_evade", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_hit", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_small_cast", false, character_name, animations, -16.0, "CastEvent", 29));
- array = array.concat(processAnimation(src, "crouch_to_dead", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "crouch_use_high", false, character_name, animations, -16.0, "UseEvent", 11));
- array = array.concat(processAnimation(src, "crouch_use_low", false, character_name, animations, -16.0, "UseEvent", 9));
- array = array.concat(processAnimation(src, "dead_to_crouch", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "dead_to_stand", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "die", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "evade", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "explore_to_combat", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "get_up", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "hit_big", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "hit_small", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "stand_to_crouch", false, character_name, animations, -16.0, "", -1));
- array = array.concat(processAnimation(src, "use_high", false, character_name, animations, -16.0, "UseEvent", 10));
- array = array.concat(processAnimation(src, "use_low", false, character_name, animations, -16.0, "UseEvent", 22));
- saveAnimations(tgt, character_name, array, animations);
- }
- //--------------------------------------------------------------------------
- function createCharacterControl(anim_loc, tgt, name)
- {
- var map_data = [
- {stance:"Combat", tag:"CastBig", anim:"cast_big"},
- {stance:"Combat", tag:"CastSmall", anim:"cast_small"},
- {stance:"Combat", tag:"HitBig", anim:"hit_big"},
- {stance:"Combat", tag:"HitSmall", anim:"hit_small"},
- {stance:"Combat", tag:"UseHigh", anim:"use_high"},
- {stance:"Combat", tag:"UseLow", anim:"use_low"},
- {stance:"Crouch", tag:"CastBig", anim:"crouch_big_cast"},
- {stance:"Crouch", tag:"CastSmall", anim:"crouch_small_cast"},
- {stance:"Crouch", tag:"HitBig", anim:"crouch_big_hit"},
- {stance:"Crouch", tag:"HitSmall", anim:"crouch_hit"},
- {stance:"Crouch", tag:"UseHigh", anim:"use_high"},
- {stance:"Crouch", tag:"UseLow", anim:"use_low"},
- {stance:"Explore", tag:"UseHigh", anim:"crouch_use_high"},
- {stance:"Explore", tag:"UseLow", anim:"crouch_use_low"}
- ];
- createControl("characters/animation_tags", anim_loc, tgt, name, map_data)
- }
- //--------------------------------------------------------------------------
- function createCharacterMotionControl(anim_loc, tgt, name)
- {
- var transition_data = [
- {from:"Explore", to:"Combat", anim:"explore_to_combat"},
- {from:"Combat", to:"Explore", anim:"combat_to_explore"},
- {from:"Explore", to:"Crouch", anim:"stand_to_crouch"},
- {from:"Combat", to:"Crouch", anim:"stand_to_crouch"},
- {from:"Explore", to:"KnockedOut", anim:"die"},
- {from:"Combat", to:"KnockedOut", anim:"die"},
- {from:"Crouch", to:"Explore", anim:"get_up"},
- {from:"KnockedOut", to:"Explore", anim:"dead_to_stand"},
- {from:"Crouch", to:"Combat", anim:"get_up"},
- {from:"KnockedOut", to:"Combat", anim:"dead_to_stand"},
- {from:"Crouch", to:"KnockedOut", anim:"crouch_to_dead"},
- {from:"KnockedOut", to:"Crouch", anim:"dead_to_crouch"}
- ];
- var stance_data = {
- exploreWalk:"explore_walk",
- exploreRun:"explore_walk",
- combatMove:"combat_walk",
- crouchMove:"crouch_walk",
- exploreIdle:"explore_idle",
- combatIdle:"combat_idle",
- crouchIdle:"crouch_idle",
- koIdle:"dead_idle"
- };
- var move_data = {
- walk:1.4,
- run:2.8,
- combat:2.0,
- crouch:2.0
- };
- createMotionControl(anim_loc, tgt, name, stance_data, transition_data, move_data);
- }
- //--------------------------------------------------------------------------
Editor
You can edit this paste and save as new: