Forum Discussion

TriplisTrip's avatar
8 years ago

on_xevt and xevt ids?

Documentation and discussion on xevt seems to be sparse. What I've been able to find in the TDESCs is stuff like this:
The behavior should occur synchronized visually with an xevt in an animation played as part of the interaction. If for some reason such an event doesn't occur, the behavior will occur at the end of the interaction. This is by far the most common use case, as when a Sim flushes a toilet and the water level should change when the actual flush animation and effects fire.

There was somewhere else in the TDESCs that it said something about an agreed upon ID, but I can't remember where at the moment.

I also managed to find this with a google search out of some random document:
xevt=(value)
This tag is used to synchronize some sprite event that must occur as the skill plays. Examples
might be picking up/putting down an object, or playing a sprite animation, where each
xevt=(value) refers to the next item on a series of sprite frames, like opening a door.


My question/confusion is twofold:

1) Does each animation frame have a xevt id, like 1, 2, 3, etc.? Or does an animation only have xevt_ids that can be referenced in timing if one was specifically put in place for a particular animation (e.g. the flushing example in the documentation).

2) Is there any kind of consistency to what xevt ids are? In looking through the code, it seems like there's some common uses. A number of toddler interactions that have a 101 xevt_id. So far, the lowest I found was a xevt_id of 100. And some jump as high as 600-700. Heck, the vampire mind power one is 1289 for success and 1290 for failure.

The reason I ask is I want to time vfx with animations in custom ways. The most basic of this is I want to start playing the vfx when the animation starts, rather than when the interaction starts (on_xevt, rather than at_beginning).

For *just* timing vfx with the beginning of an animation, rather than the beginning of an interaction, I can sort of work around the problem using continuations, but it's kind of a rough solution and isn't the most efficient thing ever when doing it for multiple interactions.

So ideally, I'd like to be able to use xevt timing instead. Problem is, all attempts to "guess" at xevt ids that'll work have so far failed, so I'm wondering if the animation I'm attempting it on (the one I've been attempting on is the warming hands at the fireplace animation) even has xevt ids that I can reference to begin with.

  • Hi @Triplis,

    Clip Events (aka xevts) are manually added by animators on a per animation basis. There are some clip event IDs that are standardized by convention but they can also be somewhat arbitrary. You can't assume they are firing consistently across all interactions since they are just added as needed, which is likely why your guessing approach is unfortunately not working.

    Clip Events are defined in the clip resource (documented here, see ClipEventType:SCRIPT). This resource also contains the name of the clip, so if there's a particular interaction’s animation you are interested in you may be able to reverse engineer what animation clips are playing based on the name, and then what script events are firing. Although just looking at what events gameplay tuning is listening for may be easier. Also, it would be possible to add your own script events to the clip resource, might be a bit tricky since afaik there aren’t a lot of community animation tools, but doable.

    Hope that helps,
    SGMS
  • @SimGuruModSquad Thanks for the info! I'll see what I can glean from it. :smiley: