Jump to content

Help with scripting an animation


SAC

Recommended Posts

I have assigned an animfurn keyword to a furniture, and the NPC "sitting" the furniture is playing it correctly. That is fine.

 

However, what I want to achieve is changing the idle after some time passes (or after an event) with a different one, and that doesn't seem to work.

 

More specifically, I have attached an object script to the furniture, which contains an event triggering an actorref.playidle(myidle), and that doesn't work, the actor keeps performing the furniture animfurn, not my idle.

 

If, on the other hand, I remove the animfurn keyword from the furniture, then the furniture becomes inaccessible, the prompt changes from "sit..." to "inspect..." and the NPC does nothing, does not sit or play any animation, just ignores the furniture.

 

Bottom line: is there a way to script a furniture to play a specific sequence of idles to an NPC sitting that furniture?

 

Or do I have to cast a spell which places the furniture as static around the NPC, then plays the idles? (that would require rework from my part, I would really hope I can use my existing furniture)

 

Thanks!

Link to comment

I am not sure about Fallout 4, but wont all those idles you want to play, have to be set as this furniture idles?

 

I remember in Skyrim...

When i played idle, which was properly configured as that furniture's idle animation, no problems.

When i played idle, which was NOT configured as that furniture's idle anim, but as simple loose animation, then it worked, but the actor's "sittign state" got broken/terminated (so, the game no longer considered that actor as sittign in that furniture).

 

Now is it possible in Fallout 4 it was changed? ...so that while sitting in a furniture, the actor can play ONLY the animations which are configured as that furniture's idles, and any other anims do not break his sitting state and cannot be played - unless the actor uses that furniture's proper "exit" animation to stop sitting and returns to some state where these other anims would be available.

 

...what happens if you use the "sae" console command to play those animations (try when actor is just standing idle, and then again when he is in that furniture - if those anims do not play in any of those situations, something may be wrong with them. If it plays only when actor is standing idle, then it's possible the loose anims are blocked while in sitting state in a furniture).

 

Link to comment

Have a look at 'Race' objects in your CreationKit. Fallout 4 is wired as fuck - to get a new animation into the game you need to create a new race and make it add 'Subgraph Data'. Just load TortureDevices.esm in the CK and have a look at the 'Race' object 'HumanRaceSubgraphData_TD_Additive'. Vader666 has it figured out correctly, you can look how he's done what he's done.

 

It's a pain in the ass, but at least we don't need FNIS anymore.

Link to comment

Thanks, I've seen that. My problem is that I cannot change the animation "mid-sitting", it is limited to the initial animfurn (no matter if the animfurn is vanilla or added).

 

I want the actor to perform a succession of 2 or more animations, not be limited to just one.

Link to comment

Thanks, I've seen that. My problem is that I cannot change the animation "mid-sitting", it is limited to the initial animfurn (no matter if the animfurn is vanilla or added).

 

I want the actor to perform a succession of 2 or more animations, not be limited to just one.

 

 

I haven't messed with animations and such but maybe something along these lines would work:

  • Have no initial keyword on the furniture.
  • Have a script attached to the furniture handle an OnInit to give itself an anim keyword.
  • Have another event when it's being used start a timer to rotate through some selection of keywords.
  • In the event that handles the rotation also have it detect the actor and trigger the actor to re-"use" the furniture to trigger the new animation.
  • Also hook the exit event to stop the keyword swapping timer. Optionally setting it back to the default or something.
Link to comment

Thank you! Thing is, if you don't associate an animfurn keyword, the actor won't see it as furniture at all, and the "sit" command is not available (it says "inspect" instead, and does nothing).

 

Until I find a solution, I switched my approach to a scripted animation gun which spawns the furniture around the animated actor. There I can script basically anything, to the limits of my own scripting knowledge, but need to account for collision (the furniture sitting actor ignored collision).

Link to comment

Changing the Funiture animation should work just like changing an Actor animation.

You assign a keyword to a SubGraph entry wich is your initial or standart animation.

Then your´re doing a new SubGraph entry pointing to the 2nd animation and assign the 1st keyword to it together with a 2nd keyword

( just be sure, a single new keyword should do it aswell).

 

Now while an Actor is using the Furniture you just have to add the 2nd Keyword to the Furniture, then update the Furniture.

I´m not really sure if it is possible to update furnitures with ChangeAnimarchetype(), if thats not working you may try using AttemptAnimationSetSwitch().

Or maybe we just have to update the actor...

 

I haven´t tried anything about changing the anim while using Furniture so everything untested.

Link to comment

Changing the Funiture animation should work just like changing an Actor animation.

You assign a keyword to a SubGraph entry wich is your initial or standart animation.

Then your´re doing a new SubGraph entry pointing to the 2nd animation and assign the 1st keyword to it together with a 2nd keyword

( just be sure, a single new keyword should do it aswell).

 

Now while an Actor is using the Furniture you just have to add the 2nd Keyword to the Furniture, then update the Furniture.

I´m not really sure if it is possible to update furnitures with ChangeAnimarchetype(), if thats not working you may try using AttemptAnimationSetSwitch().

Or maybe we just have to update the actor...

 

I haven´t tried anything about changing the anim while using Furniture so everything untested.

 

Thanks, I'll try. In the meantime, I made an animation gun version which spawns statics around the actor. Alas, this option also requires some invisible collision furniture in order to "suspend" the actor... oh well. Done that too.

 

This approach is able to cycle any number of animations. Now I need animations :))

 

http://www.loverslab.com/files/file/4025-working-noose-proof-of-concept/

Link to comment

Hmm... just thought of a way to "get the best from the two worlds", but it's gonna be tedious. Basically replicate the furniture and assign (the torturedevices way) a different animfurn keyword to each replica. Then script swap the furniture clones in sequence, and snapintointerraction. It's probably going to produce jarring transitions, even there are no onsit / onexit animations, though.

 

I'll test it, anyway.

 

I've seen some people are using "nodes", but I've got no idea what those even are, let alone how to use them.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use