I am making the PC and companions slide down a icy hill. I am trying to do this by making them play the animation LOOPING_PRONE, then applying the FREEZE_ANIMATION vfx after a delay of about 0.5 seconds. This freezes the characters in a good "slide down the hill" position. After this, I give the characters the ActionForceMoveToObject() command to move to a waypoint at the bottom of the hill. Everything works except there is a slight delay between the characters falling and then moving and it sort of takes away from the effect.
Has anyone messed with this before and if so have you figured out a way around this?
My suspicion is that the engine is making the character finish playing the animation (even though it isn't visible due to the freeze_animation vfx) before it executes the command to move down the hill. I have experimented with changing the duration and speed of the looping animation, but have had no success.
I was able to apply the knockdown effect and then apply the Freeze_animation_vfx, but that is inconsistent and one of my characters always gets halfway beck up before freezing, although the delay was not present.
Thoughts?
Animation hesitation
Débuté par
M. Rieder
, avril 27 2011 03:03
#1
Posté 27 avril 2011 - 03:03
#2
Posté 28 avril 2011 - 06:35
The knockdown effect doesn't seem to be terribly consistent in having the duration of the appearance match the duration of the effect. In general play, I've often found that a character will get up some time before they can act again.
I'm interested to hear what you find with the FREEZE_ANIMATION VFX. The limited amount of animations available for NWN2 makes some kind of actions frustrating to script (for example, there's a decent jump-back animation for most playable races but no jump-forward) so being able to slice and splice them together might be nice. When the freeze VFX is removed, does the character resume the animation they were doing before? Or do they just start the next thing to come along?
Regarding your delay: I think the reason might be that it's an action and requires the character to actually move. Because of the (oft-cursed by me!) round system, how quickly movement can happen after performing another action is often unpredictable. When I scripted a jump-back feat, what I did was just have the character teleport back a very short distance (JumpToLocation) with a properly timed DelayCommand, so this command didn't wait in the action queue. If the distance was small enough, it looked nearly seamless. Any time you use teleporting and any view but strategy, though, the screen will jump slightly.
I suppose if you had a series of jumps, instead of one move, you could use them as a sort of stop-motion animation. You'd have to figure out the path yourself, though, instead of allowing the pathfinding AI to work it out for you. I suspect you might hit a practical limit of the number of jumps in terms of performance before you get it to look polished enough for your satisfaction, though.
I'm interested to hear what you find with the FREEZE_ANIMATION VFX. The limited amount of animations available for NWN2 makes some kind of actions frustrating to script (for example, there's a decent jump-back animation for most playable races but no jump-forward) so being able to slice and splice them together might be nice. When the freeze VFX is removed, does the character resume the animation they were doing before? Or do they just start the next thing to come along?
Regarding your delay: I think the reason might be that it's an action and requires the character to actually move. Because of the (oft-cursed by me!) round system, how quickly movement can happen after performing another action is often unpredictable. When I scripted a jump-back feat, what I did was just have the character teleport back a very short distance (JumpToLocation) with a properly timed DelayCommand, so this command didn't wait in the action queue. If the distance was small enough, it looked nearly seamless. Any time you use teleporting and any view but strategy, though, the screen will jump slightly.
I suppose if you had a series of jumps, instead of one move, you could use them as a sort of stop-motion animation. You'd have to figure out the path yourself, though, instead of allowing the pathfinding AI to work it out for you. I suspect you might hit a practical limit of the number of jumps in terms of performance before you get it to look polished enough for your satisfaction, though.
#3
Posté 28 avril 2011 - 06:43
Fantastic idea! Yes, that may just work! Originally I thought I would have to make a little snow puff VFX to conceal the hesitation, but stop motion animation could be just the thing! Great idea!
It looks like when the FREEZE_ANIMATION VFX is removed the player just goes on to the next thing without finishing the animation. When I use it in the sliding script, the PC starts running again when I remove the FREEZE_ANIMATION. In another script, where I freeze the player in midair, when I take it off, the player just jumps right back to the ground.
It looks like when the FREEZE_ANIMATION VFX is removed the player just goes on to the next thing without finishing the animation. When I use it in the sliding script, the PC starts running again when I remove the FREEZE_ANIMATION. In another script, where I freeze the player in midair, when I take it off, the player just jumps right back to the ground.
#4
Posté 28 avril 2011 - 06:46
This might help, delay your commands for the next thing based on which animation you use below. This is all in my csl library. ( prettier version is on the citadel
/**
* Returns duration of the given animation string, add any new animations ot this function as needed
* Based on listing provided by Cerea2 http://www.cerea2.com/index.php?option=com_openwiki&Itemid=50&id=players:animations&rev=1180528722
* @author
* @param sAnimationName Name of the animation
* @param iGender GENDER_MALE or GENDER_FEMALE
* @see
* @return
*/
float CSLGetAnimationDuration( string sAnimationName, int iGender )
{
iGender = ( iGender != GENDER_FEMALE ) ? GENDER_MALE : GENDER_FEMALE;
sAnimationName = GetStringLowerCase(sAnimationName); // make sure it's lower case
//SendMessageToPC( GetFirstPC(), "For "+sAnimationName+" we return "+IntToString( CSLAlphabeticalSortConstant( sAnimationName ) ) );
switch ( CSLAlphabeticalSortConstant( sAnimationName ) )
{
case CSL_LETTER_NA: // not a letter, can be number or a space
if ( sAnimationName == "%" ) { return ( iGender == GENDER_MALE ) ? 0.01f : 0.01f; }
break;
case CSL_LETTER_A:
if ( sAnimationName == "activate" ) { return ( iGender == GENDER_MALE ) ? 1.36f : 1.53f; }
if ( sAnimationName == "annoyed" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "atk_cast" ) { return ( iGender == GENDER_MALE ) ? 2.03f : 2.0f; }
if ( sAnimationName == "atk_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "atk_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "attention" ) { return ( iGender == GENDER_MALE ) ? 2.53f : 1.66f; }
break;
case CSL_LETTER_B:
if ( sAnimationName == "bardsong" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "bored" ) { return ( iGender == GENDER_MALE ) ? 16.03f : 6.66f; }
if ( sAnimationName == "bow" ) { return ( iGender == GENDER_MALE ) ? 3.93f : 2.33f; }
if ( sAnimationName == "bsd_cast" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
if ( sAnimationName == "bsd_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "bsd_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "bsf_cast" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
if ( sAnimationName == "bsf_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "bsf_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "bsl_cast" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
if ( sAnimationName == "bsl_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "bsl_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "bss_cast" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
if ( sAnimationName == "bss_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "bss_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
break;
case CSL_LETTER_C:
if ( sAnimationName == "chuckle" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "clapping" ) { return ( iGender == GENDER_MALE ) ? 3.46f : 3.33f; }
if ( sAnimationName == "collapseb" ) { return ( iGender == GENDER_MALE ) ? 2.26f : 2.66f; }
if ( sAnimationName == "cooking01" ) { return ( iGender == GENDER_MALE ) ? 5.83f : 5.83f; }
if ( sAnimationName == "cooking02" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 4.0f; }
if ( sAnimationName == "craft01" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "crying" ) { return ( iGender == GENDER_MALE ) ? 8.16f : 8.16f; }
if ( sAnimationName == "curtsey" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
break;
case CSL_LETTER_D:
if ( sAnimationName == "damage01" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "damage02" ) { return ( iGender == GENDER_MALE ) ? 1.06f : 2.0f; }
if ( sAnimationName == "dance01" ) { return ( iGender == GENDER_MALE ) ? 4.06f : 4.0f; }
if ( sAnimationName == "dance02" ) { return ( iGender == GENDER_MALE ) ? 9.63f : 2.0f; }
if ( sAnimationName == "death01" ) { return ( iGender == GENDER_MALE ) ? 2.29f : 2.73f; }
if ( sAnimationName == "death02" ) { return ( iGender == GENDER_MALE ) ? 1.46f : 3.86f; }
if ( sAnimationName == "def_cast" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "def_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "def_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "dejected" ) { return ( iGender == GENDER_MALE ) ? 4.8f : 4.8f; }
if ( sAnimationName == "disablefront" ) { return ( iGender == GENDER_MALE ) ? 2.33f : 2.0f; }
if ( sAnimationName == "disableground" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "drink" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 3.0f; }
if ( sAnimationName == "drinkbeer" ) { return ( iGender == GENDER_MALE ) ? 3.06f : 3.06f; }
if ( sAnimationName == "drinkbeerfidget" ) { return ( iGender == GENDER_MALE ) ? 6.0f : 6.0f; }
if ( sAnimationName == "drinkbeeridle" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "drumrun" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 0.8f; }
if ( sAnimationName == "drunk" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "dustoff" ) { return ( iGender == GENDER_MALE ) ? 5.03 : 3.66f; }
break;
case CSL_LETTER_E:
if ( sAnimationName == "eat" ) { return ( iGender == GENDER_MALE ) ? 3.50f : 3.0f; }
if ( sAnimationName == "emo_amused" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_angry" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_annoyed" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_depressed" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_frown" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_nervous" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_scared" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_smile" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_smilebig" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_surprised" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
if ( sAnimationName == "emo_thoughtful" ) { return ( iGender == GENDER_MALE ) ? 0.03f : 0.03f; }
break;
case CSL_LETTER_F:
if ( sAnimationName == "flirt" ) { return ( iGender == GENDER_MALE ) ? 4.26f : 7.0f; }
if ( sAnimationName == "fluterun" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 0.8f; }
if ( sAnimationName == "forge01" ) { return ( iGender == GENDER_MALE ) ? 3.4f : 3.36f; }
if ( sAnimationName == "forge02" ) { return ( iGender == GENDER_MALE ) ? 3.36f : 3.36f; }
break;
case CSL_LETTER_G:
if ( sAnimationName == "gen_cast" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "gen_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "gen_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "getground" ) { return ( iGender == GENDER_MALE ) ? 1.83f : 1.66f; }
if ( sAnimationName == "gethigh" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "gettable" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "guitarrun" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 0.8f; }
break;
case CSL_LETTER_H:
break;
case CSL_LETTER_I:
if ( sAnimationName == "idle" ) { return ( iGender == GENDER_MALE ) ? 11.66f : 5.0f; }
if ( sAnimationName == "idlecower" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 3.0f; }
if ( sAnimationName == "idledrum" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 3.0f; }
if ( sAnimationName == "idlefidgetdrum" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 3.0f; }
if ( sAnimationName == "idlefidgetflute" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.33f; }
if ( sAnimationName == "idlefidgetguitar" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "idlefidgetnervous" ) { return ( iGender == GENDER_MALE ) ? 9.5f : 9.5f; }
if ( sAnimationName == "idleflute" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 3.0f; }
if ( sAnimationName == "idleguitar" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "idleinj" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 5.0f; }
if ( sAnimationName == "intimidate" ) { return ( iGender == GENDER_MALE ) ? 3.06f : 5.0f; }
break;
case CSL_LETTER_J:
if ( sAnimationName == "jumpback" ) { return ( iGender == GENDER_MALE ) ? 1.6f : 1.66f; }
break;
case CSL_LETTER_K:
if ( sAnimationName == "kneelbow" ) { return ( iGender == GENDER_MALE ) ? 2.59f : 2.0f; }
if ( sAnimationName == "kneelclutch" ) { return ( iGender == GENDER_MALE ) ? 1.06f : 1.0f; }
if ( sAnimationName == "kneelclutchloop" ) { return ( iGender == GENDER_MALE ) ? 5.23f : 1.66f; }
if ( sAnimationName == "kneeldamage" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "kneeldeath" ) { return ( iGender == GENDER_MALE ) ? 1.43f : 1.5f; }
if ( sAnimationName == "kneeldown" ) { return ( iGender == GENDER_MALE ) ? 1.36f : 1.0f; }
if ( sAnimationName == "kneelfidget" ) { return ( iGender == GENDER_MALE ) ? 5.19f : 4.0f; }
if ( sAnimationName == "kneelidle" ) { return ( iGender == GENDER_MALE ) ? 2.59f : 2.0f; }
if ( sAnimationName == "kneeltalk" ) { return ( iGender == GENDER_MALE ) ? 5.19f : 4.0f; }
if ( sAnimationName == "kneelup" ) { return ( iGender == GENDER_MALE ) ? 1.36f : 1.0f; }
if ( sAnimationName == "knighting" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 12.6f; }
if ( sAnimationName == "knockdownb" ) { return ( iGender == GENDER_MALE ) ? 1.13f : 1.66f; }
break;
case CSL_LETTER_L:
if ( sAnimationName == "laugh" ) { return ( iGender == GENDER_MALE ) ? 2.5f : 2.5f; }
if ( sAnimationName == "laydownb" ) { return ( iGender == GENDER_MALE ) ? 2.33f : 2.33f; } //3.33 : 2.33f;
if ( sAnimationName == "liftsworddown" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "liftswordloop" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 4.0f; }
if ( sAnimationName == "liftswordup" ) { return ( iGender == GENDER_MALE ) ? 1.16f : 1.16f; }
if ( sAnimationName == "listen" ) { return ( iGender == GENDER_MALE ) ? 16.03f : 15.0f; }
if ( sAnimationName == "listeninjured" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.0f; }
if ( sAnimationName == "lookleft" ) { return ( iGender == GENDER_MALE ) ? 5.63f : 5.0f; }
if ( sAnimationName == "lookleftback" ) { return ( iGender == GENDER_MALE ) ? 0.60f : 1.0f; }
if ( sAnimationName == "lookleftloop" ) { return ( iGender == GENDER_MALE ) ? 4.43f : 3.0f; }
if ( sAnimationName == "lookleftstart" ) { return ( iGender == GENDER_MALE ) ? 0.60f : 1.0f; }
if ( sAnimationName == "lookright" ) { return ( iGender == GENDER_MALE ) ? 5.63f : 5.0f; }
if ( sAnimationName == "lookrightback" ) { return ( iGender == GENDER_MALE ) ? 0.60f : 1.0f; }
if ( sAnimationName == "lookrightloop" ) { return ( iGender == GENDER_MALE ) ? 4.43f : 3.0f; }
if ( sAnimationName == "lookrightstart" ) { return ( iGender == GENDER_MALE ) ? 0.60f : 1.0f; }
break;
case CSL_LETTER_M:
if ( sAnimationName == "meditate" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 5.0f; }
if ( sAnimationName == "mjr_cast" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "mjr_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "mjr_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
break;
case CSL_LETTER_N:
if ( sAnimationName == "nodno" ) { return ( iGender == GENDER_MALE ) ? 1.6f : 1.5f; }
if ( sAnimationName == "nodyes" ) { return ( iGender == GENDER_MALE ) ? 1.6f : 1.5f; }
break;
case CSL_LETTER_O:
if ( sAnimationName == "openchest" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 2.66f; }
if ( sAnimationName == "opendoor" ) { return ( iGender == GENDER_MALE ) ? 1.90f : 2.0f; }
if ( sAnimationName == "openlock" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 2.33f; }
if ( sAnimationName == "openlockloop" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 1.0f; }
break;
case CSL_LETTER_P:
if ( sAnimationName == "playdrum" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 3.73f; }
if ( sAnimationName == "playflute" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "playguitar" ) { return ( iGender == GENDER_MALE ) ? 1.86f : 2.0f; }
if ( sAnimationName == "point" ) { return ( iGender == GENDER_MALE ) ? 1.66f : 2.0f; }
if ( sAnimationName == "proneb" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 2.0f; }
if ( sAnimationName == "pronedamageb" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "pronedeathb" ) { return ( iGender == GENDER_MALE ) ? 1.29f : 1.53f; }
if ( sAnimationName == "pty_cast" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "pty_conjure" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
if ( sAnimationName == "pty_conjureloop" ) { return ( iGender == GENDER_MALE ) ? 1.0f : 1.0f; }
break;
case CSL_LETTER_Q:
break;
case CSL_LETTER_R:
if ( sAnimationName == "raking" ) { return ( iGender == GENDER_MALE ) ? 3.59f : 3.59f; }
if ( sAnimationName == "read" ) { return ( iGender == GENDER_MALE ) ? 6.0f : 4.0f; }
if ( sAnimationName == "runafraid" ) { return ( iGender == GENDER_MALE ) ? 0.83f : 0.8f; }
if ( sAnimationName == "runinj" ) { return ( iGender == GENDER_MALE ) ? 0.83f : 0.8f; }
break;
case CSL_LETTER_S:
if ( sAnimationName == "salute" ) { return ( iGender == GENDER_MALE ) ? 2.33f : 2.0f; }
if ( sAnimationName == "scratchhead" ) { return ( iGender == GENDER_MALE ) ? 2.16f : 2.16f; }
if ( sAnimationName == "scrollrecite" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 4.0f; }
if ( sAnimationName == "search" ) { return ( iGender == GENDER_MALE ) ? 11.73f : 6.66f; }
if ( sAnimationName == "shoveling" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "shrug" ) { return ( iGender == GENDER_MALE ) ? 1.5f : 1.5f; }
if ( sAnimationName == "sigh" ) { return ( iGender == GENDER_MALE ) ? 3.56f : 3.0f; }
if ( sAnimationName == "sitdeath" ) { return ( iGender == GENDER_MALE ) ? 2.46f : 2.06f; }
if ( sAnimationName == "sitdrink" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "sitdrinkidle" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 2.66f; }
if ( sAnimationName == "siteat" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "sitfidget" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.33f; }
if ( sAnimationName == "sitgrounddown" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "sitgroundidle" ) { return ( iGender == GENDER_MALE ) ? 4.66f : 4.66f; }
if ( sAnimationName == "sitgroundup" ) { return ( iGender == GENDER_MALE ) ? 1.33f : 1.33f; }
if ( sAnimationName == "sitidle" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 2.66f; }
if ( sAnimationName == "sitread" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.33f; }
if ( sAnimationName == "sittalk01" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.33f; }
if ( sAnimationName == "sittalk02" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.33f; }
if ( sAnimationName == "sleightofhand" ) { return ( iGender == GENDER_MALE ) ? 1.76f : 1.76f; }
if ( sAnimationName == "sneak" ) { return ( iGender == GENDER_MALE ) ? 1.66f : 1.33f; }
if ( sAnimationName == "sp_lightning" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "sp_spray" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "sp_thrown" ) { return ( iGender == GENDER_MALE ) ? 1.9f : 1.83f; }
if ( sAnimationName == "sp_touch" ) { return ( iGender == GENDER_MALE ) ? 1.66f : 1.66f; }
if ( sAnimationName == "sp_turnundead" ) { return ( iGender == GENDER_MALE ) ? 1.66f : 1.66f; }
if ( sAnimationName == "sp_warcry" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "standupb" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 2.66f; }
break;
case CSL_LETTER_T:
if ( sAnimationName == "talkcheer" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talkforce" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talkforce01" ) { return ( iGender == GENDER_MALE ) ? 2.16f : 2.16f; }
if ( sAnimationName == "talkforce02" ) { return ( iGender == GENDER_MALE ) ? 2.0f : 2.0f; }
if ( sAnimationName == "talkforce03" ) { return ( iGender == GENDER_MALE ) ? 3.66f : 3.66f; }
if ( sAnimationName == "talkinjured" ) { return ( iGender == GENDER_MALE ) ? 5.33f : 5.0f; }
if ( sAnimationName == "talklaugh" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talknervous" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talknormal" ) { return ( iGender == GENDER_MALE ) ? 16.0f : 15.0f; }
if ( sAnimationName == "talknormal02" ) { return ( iGender == GENDER_MALE ) ? 16.03f : 15.0f; }
if ( sAnimationName == "talkplead" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talksad" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "talkshout" ) { return ( iGender == GENDER_MALE ) ? 6.66f : 6.66f; }
if ( sAnimationName == "taunt" ) { return ( iGender == GENDER_MALE ) ? 6.26f : 5.0f; }
if ( sAnimationName == "throwarmsdown" ) { return ( iGender == GENDER_MALE ) ? 0.66f : 0.66f; }
if ( sAnimationName == "throwarmsloop" ) { return ( iGender == GENDER_MALE ) ? 3.16f : 3.16f; }
if ( sAnimationName == "throwarmsup" ) { return ( iGender == GENDER_MALE ) ? 0.83f : 0.83f; }
if ( sAnimationName == "tired" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
if ( sAnimationName == "torchidle" ) { return ( iGender == GENDER_MALE ) ? 11.69f : 8.0f; }
if ( sAnimationName == "torchlightfront" ) { return ( iGender == GENDER_MALE ) ? 2.16f : 4.0f; }
if ( sAnimationName == "torchlightground" ) { return ( iGender == GENDER_MALE ) ? 2.16f : 4.0f; }
if ( sAnimationName == "torchrun" ) { return ( iGender == GENDER_MALE ) ? 0.83f : 0.8f; }
if ( sAnimationName == "torchturnl" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 0.8f; }
if ( sAnimationName == "torchturnr" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 0.8f; }
if ( sAnimationName == "torchwalk" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "torchwalkback" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 1.33f; }
if ( sAnimationName == "torchwalkleft" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 1.33f; }
if ( sAnimationName == "torchwalkright" ) { return ( iGender == GENDER_MALE ) ? 0.0f : 1.33f; }
if ( sAnimationName == "toss" ) { return ( iGender == GENDER_MALE ) ? 1.50f : 0.0f; }
if ( sAnimationName == "touchheart" ) { return ( iGender == GENDER_MALE ) ? 3.0f : 3.0f; }
if ( sAnimationName == "turnl" ) { return ( iGender == GENDER_MALE ) ? 0.8f : 0.8f; }
if ( sAnimationName == "turnr" ) { return ( iGender == GENDER_MALE ) ? 0.8f : 0.8f; }
break;
case CSL_LETTER_U:
if ( sAnimationName == "useitem" ) { return ( iGender == GENDER_MALE ) ? 4.0f : 3.0f; }
break;
case CSL_LETTER_V:
if ( sAnimationName == "victory" ) { return ( iGender == GENDER_MALE ) ? 5.0f : 5.0f; }
break;
case CSL_LETTER_W:
if ( sAnimationName == "walk" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkback" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkdrum" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkflute" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkguitar" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkinj" ) { return ( iGender == GENDER_MALE ) ? 1.26f : 1.33f; }
if ( sAnimationName == "walkleft" ) { return ( iGender == GENDER_MALE ) ? 1.06f : 1.06f; }
if ( sAnimationName == "walkright" ) { return ( iGender == GENDER_MALE ) ? 1.06f : 1.06f; }
if ( sAnimationName == "wave" ) { return ( iGender == GENDER_MALE ) ? 2.20f : 2.0f; }
if ( sAnimationName == "waveshort" ) { return ( iGender == GENDER_MALE ) ? 1.56f : 1.5f; }
if ( sAnimationName == "wildshape" ) { return ( iGender == GENDER_MALE ) ? 1.16f : 1.16f; }
if ( sAnimationName == "worship" ) { return ( iGender == GENDER_MALE ) ? 2.66f : 2.0f; }
if ( sAnimationName == "wounded" ) { return ( iGender == GENDER_MALE ) ? 8.33f : 8.33f; }
break;
case CSL_LETTER_X:
break;
case CSL_LETTER_Y:
if ( sAnimationName == "yawn" ) { return ( iGender == GENDER_MALE ) ? 3.13f : 3.0f; }
break;
case CSL_LETTER_Z:
break;
default:
return 0.0f;
break;
}
return 0.0f;
}
// alphabet sort constants, used to use case statements with strings
const int CSL_LETTER_NA = -1; // not a letter
const int CSL_LETTER_A = 1;
const int CSL_LETTER_B = 2;
const int CSL_LETTER_C = 3;
const int CSL_LETTER_D = 4;
const int CSL_LETTER_E = 5;
const int CSL_LETTER_F = 6;
const int CSL_LETTER_G = 7;
const int CSL_LETTER_H = 8;
const int CSL_LETTER_I = 9;
const int CSL_LETTER_J = 10;
const int CSL_LETTER_K = 11;
const int CSL_LETTER_L = 12;
const int CSL_LETTER_M = 13;
const int CSL_LETTER_N = 14;
const int CSL_LETTER_O = 15;
const int CSL_LETTER_P = 16;
const int CSL_LETTER_Q = 17;
const int CSL_LETTER_R = 18;
const int CSL_LETTER_S = 19;
const int CSL_LETTER_T = 20;
const int CSL_LETTER_U = 21;
const int CSL_LETTER_V = 22;
const int CSL_LETTER_W = 23;
const int CSL_LETTER_X = 24;
const int CSL_LETTER_Y = 25;
const int CSL_LETTER_Z = 26;
/**
* Returns letter sort CSL_LETTER_* constant which allows using letters in case statements
* @param sIn Input String
* @return CSL_LETTER_* constant
*/
int CSLAlphabeticalSortConstant( string sSin )
{
if ( sSin == "" )
{
return CSL_LETTER_NA;
}
return FindSubString("Aabcdefghijklmnopqrstuvwxyz", GetStringLowerCase(GetStringLeft(sSin, 1)) );
}
Modifié par painofdungeoneternal, 28 avril 2011 - 06:48 .
#5
Posté 29 avril 2011 - 01:54
IT looks like animations have slightly different durations based on gender. Based on observation, size seems to matter too (heh heh...). My smaller characters seem to execute different animations. Is this the case, or is the gender all that matters?
I'm going to try this out.
I'm going to try this out.
#6
Posté 29 avril 2011 - 02:10
M. Rieder wrote...
IT looks like animations have slightly different durations based on gender. Based on observation, size seems to matter too (heh heh...). My smaller characters seem to execute different animations. Is this the case, or is the gender all that matters?
I'm going to try this out.
Animations are entirely defined by what gr2 files are present. They take forms such as OOM or OOF with various suffices (is that a word?) depending on the skeleton and gender. Various races share the same skeletons; I think it's humans, elves, half-elves, and all their sub-varieties share one, half-orcs have their own, and gnomes and halflings share one. I could be wrong on the details, though.
#7
Posté 29 avril 2011 - 05:43
What you described is similar to what I have observed. I tested with a gnome, male human, and female human, and they all had slightly different animations.
#8
Guest_Chaos Wielder_*
Posté 29 avril 2011 - 05:49
Guest_Chaos Wielder_*
Yep, they all have different animations with slightly varying durations and such. Frustrating to a fault!
#9
Posté 30 avril 2011 - 12:06
I spent all night working with alternatives and finally settled on the stop-motion animation. I have a prototype script that works in a test area. I just have to refine distances and delays and then see how it interacts with other commands, but it looks promising.
#10
Posté 30 avril 2011 - 04:47
Ha! It works! Thanks MasterChanger for the suggestion. There is still a minute hesitation when the movement transitions from stop-motion to ActionMoveToObject(), but it is much better than before and sort of looks like the character is building up momentum.
#11
Posté 30 avril 2011 - 07:03
M. Rieder wrote...
Ha! It works! Thanks MasterChanger for the suggestion. There is still a minute hesitation when the movement transitions from stop-motion to ActionMoveToObject(), but it is much better than before and sort of looks like the character is building up momentum.
Glad to help! It sounds like you're doing a lot of interesting stuff with your new project.
I noticed in your http://social.biowar...x/7253978]other post[/url] that you're using angles and vectors to determine the new points to jump to. This certainly works (it's what I did when I was creating a feat involving jumping) but if you've pre-determined exactly where the slide is going to take place, I'd think you could use also just use a series of waypoints. It might be annoying to place them all if the distances are really small, but then you could get fancy and use a curved path or something.
At the same time, if the vectors work for you, you could just go with that--if it ain't broke don't fix it! Up to you, naturally.
#12
Posté 01 mai 2011 - 01:19
This is an interesting tale. I first wrote my script using vectors and such and it worked- except backwards! It seems that if you do a bunch of consecutive commands without any delay, the engine will jump the pc backwards (but if you are spawning objects, it does it properly. that's how I tested it. Really interesting) so it was about 1130 pm at that point and I didn't think of just throwing in a delay, so I tried the waypoints idea, and it didn't seem to work. Now to be fair, I was writing this code at about 1145 after a full day of work and then a couple of beers, so the code may well have been faulty, but I couldn't get it to work.
The next morning I realized I hadn't used the delay and when I threw it in there, it worked like clockwork.
The next morning I realized I hadn't used the delay and when I threw it in there, it worked like clockwork.





Retour en haut






