Aller au contenu

Photo

Another set of animated placeables


  • Veuillez vous connecter pour répondre
54 réponses à ce sujet

#51
4760

4760
  • Members
  • 1 204 messages

Now uploaded on nexus. And I forgot to add many files, so I updated the new vault upload as well.

Now, I'm sure the 2da and the blueprints are included!  ;)



#52
4760

4760
  • Members
  • 1 204 messages

Anyway, at the moment I'm struggling with the animations: if I use the x2_plc_used_opn script, the game runs it too fast (whatever the initial duration, it will last one second, no more, no less...) If I use the equivalent script for "activate" instead of "open", the animation runs perfectly, but for those that can be reverted (the sluice gate namely), the animation for going backwards doesn't play (I'm quite sure it's an NWN2 bug, the levers were already behaving that way).

 

Well, as I can't fight what I'm afraid is a hard-coded issue, I'll make all the animation fit in a one second timeframe... Sorry for the delay before releasing the new set.

FIXED!!!

:D

While working on some animations for Kamal, I understood why it didn't work as expected.

For those interested:

  • name_IDLE is the animation of the placeable called "name" in its closed (or initial) position,
  • name_PLC_OPENIDLE is the animation of the placeable called "name" in its open (or final) position,
  • for static positions in both cases, the animation is obviously just one frame long,
  • name_PLC_TURNON is the animation of the placeable from _IDLE to _OPENIDLE,
  • name_PLC_OPEN is the animation of the placeable from _IDLE to _OPENIDLE (yes, two different names for the same thing),
  • name_PLC_CLOSE is the animation of the placeable from _OPENIDLE to _IDLE.

What is the difference between x2_plc_used_open.nss and x2_plc_used_act.nss?

 

x2_plc_used_open:

void main()
{
    // * note that nActive == 1 does  not necessarily mean the placeable is active
    // * that depends on the initial state of the object
    int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_OPEN_STATE");
    // * Play Appropriate Animation
    if (!nActive)
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_OPEN);
    }
    else
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_CLOSE);
    }
    // * Store New State
    SetLocalInt(OBJECT_SELF,"X2_L_PLC_OPEN_STATE",!nActive);
}

x2_plc_used_act:

void main()
{
    // * note that nActive == 1 does  not necessarily mean the placeable is active
    // * that depends on the initial state of the object
    int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE");
    // * Play Appropriate Animation
    if (!nActive)
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    }
    else
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
    }
    // * Store New State
    SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive);
}

So they basically run the same script, but where it's interesting is that OPN will run the OPEN/CLOSE animations while ACT will run the "TURNON/IDLE" animations (yep, I didn't see any TURNOFF gr2 files. And I tried [we never know!], but they don't run).

The main difference is that x2_plc_used_opn can work both ways (close --> open or open --> close depending on the current state of the placeable) whereas x2_plc_used_act will only activate the placeable (i.e. idle --> activate; if already activated the animation will jump back to idle).

 

Here below two examples of how this could be used:

- normal use of the coffin: open/close --> x2_plc_used_opn (top row)

- special use: break it so the player can use the top part as a small boat!  ;) --> x2_plc_used_act (bottom row)

901-1-1409150144.jpg

 

- when the practice dummy is hit, the shield, helm and sword shudder --> x2_plc_used_opn

- when it's destroyed, it collapses and breaks --> x2_plc_used_act

901-2-1409150144.jpg


  • rjshae aime ceci

#53
Tchos

Tchos
  • Members
  • 5 042 messages

Interesting.  That explains some things I've seen.  Thank you for the explanation!



#54
4760

4760
  • Members
  • 1 204 messages

I added the _OPEN and _CLOSE animations to the sluice gate and the mineshaft, so they play more nicely. Upload in progress on the new vault.


  • rjshae et Loki_999 aiment ceci

#55
4760

4760
  • Members
  • 1 204 messages

Update complete, at least on the New Vault.


  • rjshae aime ceci