Aller au contenu

Photo

Placeable anim question.


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

#1
Borden Haelven

Borden Haelven
  • Members
  • 403 messages
I've got my bookshelves nicely animated using the on2off & off2on anims. How do I stop the thing from playing the on2off anim when I close the placeable's inventory?

#2
s e n

s e n
  • Members
  • 408 messages
maybe you're forgetting a 0 node animation r stuff lk that

#3
Borden Haelven

Borden Haelven
  • Members
  • 403 messages
0 node animation? (Newby at animation really.)

#4
Bannor Bloodfist

Bannor Bloodfist
  • Members
  • 943 messages
Animations by default should have 4 base settings:

1) Off; does nothing, object sits still, animation keys typically start at Zero and move to Zero or to One with nothing actually changing.

2) Off-To-On; object starts it's movement sequence

3) On; Object performs it's full animation, as in whatever it does for a complete, always running cycle.

4) On-To-Off; where the object cycles down to it's stop position.

For a chest, the OFF position is always closed. You need that closed setting to be a distinct animation, even if it only uses one key on the animation bar. Typically, you are better off if you define more than one key for the off slot though.

When you "open" that chest, you use the Off-To-On animation to show the way the lid rises up.

Once open, since it is a simple chest, you use the ON animation to be a single or couple of keys that show the lid is open.

Closing the chest you would use On-To-Off to show the lid slowly closing the chest.

The engine will use what is available, and if the animation cycles are not all defined, it "guesses", typically incorrectly, what you want it to do. In your case, since it appears you have not defined the "off" slots, the engine assumes that you want it to perform the On-To-Off cycle.

You could define the On-To-Off cycle to be the same as the On cycle, (IE, fully open, no movement)

OR, you need to define a script that runs and "sets" the sequence in use when the "bookshelf" is empty to be the "On, fully open, no movement" sequence.

#5
_six

_six
  • Members
  • 919 messages
I don't think it's possibly to "open" a container placeable without the animation playing.

However, I would circumvent it by creating an invisible object with an inventory, and giving the bookshelf an OnUsed event to instruct the player to open that invisible object's inventory instead.

#6
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<shuffling the deck of many things...>

Oooh! Tricky, _six! I like that.
I've always like sleight of hand... It's like magic!

<...so badly it takes him three days to find his head>

Modifié par Rolo Kipp, 12 janvier 2012 - 11:02 .


#7
Borden Haelven

Borden Haelven
  • Members
  • 403 messages
Sorted it. A placeable fires it's On_Used script when you close it's inventory this script fixed things.

void main()
{
object oPC = GetLastUsedBy();
object oInvisible_Bookshelf = GetObjectByTag("InvisibleBookcase");
string sShelf_Pair = GetLocalString(OBJECT_SELF,"BookShelf_Pair_Tag");
object oShelf_Pair = GetObjectByTag(sShelf_Pair);
int nSearchDifficulty = GetWillSavingThrow(OBJECT_SELF);
int nListenDifficulty = GetReflexSavingThrow(OBJECT_SELF);
int nLoreDifficulty = GetFortitudeSavingThrow(OBJECT_SELF);
int nSearchSkill = GetSkillRank(SKILL_SEARCH,oPC);
int nListenSkill = GetSkillRank(SKILL_LISTEN,oPC);
int nLoreSkill = GetSkillRank(SKILL_LORE,oPC);
int nOpened = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE");

if (nOpened == TRUE)
{
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
SetUseableFlag(OBJECT_SELF,FALSE);
DelayCommand(10.0,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
DelayCommand(25.0,SetUseableFlag(OBJECT_SELF,TRUE));
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",FALSE);
return;
}
if ((nSearchSkill >= nSearchDifficulty))
{
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
AssignCommand(oShelf_Pair,ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
DelayCommand(10.0,AssignCommand(oShelf_Pair,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)));
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",TRUE);
return;
}
if ((nLoreSkill >= nLoreDifficulty))
{
FloatingTextStringOnCreature("These books don't seem quite right.",oPC);
return;
}

if ((nListenSkill >= nListenDifficulty))
{
FloatingTextStringOnCreature("It sounds hollow behind this.",oPC);
return;
}
}

The script below should work on any placeable with suitable animations.
void main()
{
if (nOpened == TRUE)
{
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
SetUseableFlag(OBJECT_SELF,FALSE);
DelayCommand(10.0,ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
DelayCommand(25.0,SetUseableFlag(OBJECT_SELF,TRUE));
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",FALSE);
return;
}

ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",TRUE);
}

Modifié par Borden Haelven, 12 janvier 2012 - 11:31 .


#8
s e n

s e n
  • Members
  • 408 messages
i dont understand why all that trouble... should be the same kind of animation of chests: if they do work without script, why a bookshelf shouldnt have the same behaviour?

#9
Borden Haelven

Borden Haelven
  • Members
  • 403 messages
I've used placeable activate type anims not container open type anims. You can't override container anims as they're built as creatures. I was just struggling stopping it from firing the deactivate anim not knowing it fired the on_use script twice.

All working now. :- www.xfire.com/video/52de01/ :wizard:

#10
_six

_six
  • Members
  • 919 messages
To clarify Sen, Bordren wanted it to not play the animation. Which is more difficult than it sounds :P Thats looking awesome by the way. How about a version where the bookshelf will only open if you put a specific book on the shelf?

#11
s e n

s e n
  • Members
  • 408 messages
so basically on close inventory keep the bookshelf opened?

#12
Borden Haelven

Borden Haelven
  • Members
  • 403 messages

_six wrote...

How about a version where the bookshelf will only open if you put a specific book on the shelf?


That use a on_disturbed script wouldn't it. Can do that.