Author Topic: tweaking f.b's climbing animations  (Read 406 times)

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
tweaking f.b's climbing animations
« on: January 19, 2016, 10:25:08 am »


               

i've been playing around w/failed.bard's excellent climbing+jumping animations. overall i like what i see and it's obvious f.b has put a lot of time into it. there are two problematic aspects i'm trying to tweak, so far w/o success : the character has a tendency to climb through walls and other textured tileset elements, and the character frequently can't commence the climb/jump because it gets 'blocked'. i'm pretty sure both of these are due to the fact that the range of the 'activate item' spell is 'short' [i'm using f.b's animation item to kick off the action] and the character simply travels to the edge of the spell activation radius before trying to activate the spell, as usual. the result is that if the spell activation radius happens to coincide w/the wall's visual plane, the character climbs/jumps perfectly ; if it's somewhat within the plane, the character is submerged inside the wall ; and if it's outside, the character gets blocked. using a different activation method w/a spell range of 'long' might allow a solution, provided i can find the edges of the tileset structures [walls, etc.], but i can't figure out how to find them. if i could find these, i could have the character move to the edge of the structure before undertaking the climb or jump, and there'd be no more climbing inside walls. anyone have any ideas how i could do that ?



               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
tweaking f.b's climbing animations
« Reply #1 on: January 19, 2016, 09:35:26 pm »


               

The only ways to ensure that a character climbs at the proper distance from a wall that I'd found, is to either place a waypoint at the exact wall edge, or place a clickable object at the bottom as the start point (Set the proper start distance from the wall), with a WP at the top (set back from the edge 1m, which serves as the location to jump them to for finishing the animation).


Both methods require you to adjust the starting distance from the wall by the character model's animation scale to ensure that you're beginning at the correct distance.


 


The only full scripts I made for them using that method were for Sinfar, though, using the custom nwnx and nwncx systems (and server specific includes) they have, or I'd just post all the code for that method.  Unfortunately, as it is, most of the code will only work there.


 


Here's the function I used to get the base PC race's animation scales, using the animation scales in the basemodels.  It's one of the things that you'll need even if someone has a nwnx edge detction script that you can use to find the wall with.



 


//// returns the animation scale for that appearance number.

//// returns 1.0f if no match is present.

float GetAnimationScale(object oTarget = OBJECT_SELF)

{

    // Sanity check.Don't want anyone dividing by 0.0

    if(oTarget==OBJECT_INVALID)return 1.0;

 

    float fScale = 1.0;

 

    if (GetGender (oTarget) == GENDER_FEMALE)

    {

        switch (GetAppearanceType(oTarget))

        {

            case APPEARANCE_TYPE_DWARF: fScale = 0.65; break;

            case APPEARANCE_TYPE_ELF: fScale = 0.894; break;

            case APPEARANCE_TYPE_GNOME:

            case APPEARANCE_TYPE_HALFLING: fScale = 0.64; break;

 

            // The 1.0 races don't need to be listed separately.

            default: 1.0; break;

        }

    }

 else

    {

        switch (GetAppearanceType(oTarget))

        {

            case APPEARANCE_TYPE_DWARF: fScale = 0.66; break;

            case APPEARANCE_TYPE_ELF: fScale = 0.895; break;

            case APPEARANCE_TYPE_GNOME: fScale = 0.62; break;

            case APPEARANCE_TYPE_HALFLING: fScale = 0.65; break;

 

            // The 1.0 races don't need to be listed separately.

            default: 1.0; break;

        }

    }    

    return fScale;

}

 



               
               

               
            

Legacy_azaz1234

  • Full Member
  • ***
  • Posts: 154
  • Karma: +0/-0
tweaking f.b's climbing animations
« Reply #2 on: January 21, 2016, 02:42:01 am »


               

'<img'> '<img'>


thanks much for the hints, f.b.  i'll see how i can get on w/that.


and keep up the good work !