Jump to content

How do you check an actor's actions with a script?


Cavaticus

Recommended Posts

I was wondering if anyone knew how to check if an actor (specifically the player) is performing an action or is no longer performing an action. Like a way to check if the player is using a workbench or if they are no longer using a workbench.

 

My aim is to make the player play a certain animation using "playidle" while they are using a workbench, but when they stop, the idle stops too.

 

The animations I am wanting to use are:

 

idlewriteledgerenter

idlewriteledgerwrite

sae idlestop

 

 

I was thinking of using a script that looked something like this:

Event OnActivate
Game.GetPlayer().playidle idlewriteledgerenter
while (???)
Game.GetPlayer().playidle idlewriteledgerwrite
endWhile
Game.GetPlayer().SAE idlestop
EndEvent
but I wasn't sure how to check if the player was in the crafting menu.
Any ideas of how to do this? Any solution (including workarounds if scripting is not possible) are welcome!
Thanks in advance!
Link to comment
Share on other sites

On a related note, is there a way to have an "invisible workbench"? I basically want the Player to do the same thing as when you activate the Drafting table, leaning over the table looking at the draft and opening a crafting menu. BUt I want this without the drafting table model there so I could place it above a table with books or sth.

 

Changing the model to an empty one won't do it.

Link to comment
Share on other sites

 

I was thinking of using a script that looked something like this:

Event OnActivate
Game.GetPlayer().playidle idlewriteledgerenter
while (???)
Game.GetPlayer().playidle idlewriteledgerwrite
endWhile
Game.GetPlayer().SAE idlestop
EndEvent

 

As a matter of principle this cannot work. A behavior graph is a state machine which is is controlled by AnimationEvents. With playidle you send different AnimEvents as expected. Either the graph won't understand these AnimEvents, or, most likely in your case, the state machine will continue in a totally different place and not be able to come back where it is supposed to. Resulting in all kind of glitches.

 

Save your time here. I have seen dozens of prospective modders trying such things. Almost all have spent many hours without result. Or produced glitchy mods. The only chance to do it is using FNIS. See the FNIS Modders' Doc. This has also general informations about using furniture animations.

 

On a related note, is there a way to have an "invisible workbench"? I basically want the Player to do the same thing as when you activate the Drafting table, leaning over the table looking at the draft and opening a crafting menu. BUt I want this without the drafting table model there so I could place it above a table with books or sth.

 

Changing the model to an empty one won't do it.

 

That's quite easy. Because the WriteTableStanding furniture (that's probably what you have in mind) already is a furniture object without any model. In particular situations it's just placed onto a static furniture item.

Link to comment
Share on other sites

that is very useful indeed, thanks.

 

a sidenote though:

afaik the "IsX" e.g. "IsEnchanting" controls what animation will be playing for the furniture. I have to try the one you mentioned but it has its own "animation keyword" while the draftingtable I was talking about has "IsEnchanting". Not sure if you can just swap them and it'll work.

Edited by BigBizkit
Link to comment
Share on other sites

What is the CK name of this "drafting" table? I didn't find anytthing with drafting in it, and the writetablestanding was the closets I could see. The CK find text doesn't show any place where isEnchanting is used. Finding things is so much harder compared to Oblivion.

 

You are absolutely right with the keyword and the selection of the corresponding animations. But you can create new furnitures, or add new keywords to existing ones. I can't but recommend looking into the FNIS Modder's doc. THere are 2 pages of information on how to deal with furnitures, and most of it even applies to standard furniture and its animations.

Link to comment
Share on other sites

The drafting table is a hearthfires asset. There are several and two different models, one with a blueprint on the table and one without:

 

The one I am refering to is "BYOHDraftingTable". It has the Keywords BYOHBuildingdrafting, FurnitureForce3rdPerson, FurnitureSpecial, RaceToScale and... IsEnchanting. It is shared with e.g. the CraftingEnchantingWorkbench. It is the same "putting your hands on the table looking over it" animation.

 

I have created new furniture from the drafting table, changed the model to that of an open book (resource) and kept the keywords. And when I activate it ingame, it uses no animation when it opens the crafting menu, making me believe that the model plays its part as well.

 

Checking through, I notice there are some interesting furniture markers one could make some neat "workbenches" from for all sorts of things. I'll make sure to check out your modder's doc.

Link to comment
Share on other sites

Hearthfire is the only DLC I don't have. So I can't check what they have added here. But isEnchanting indeed is one used animation conditions.

 

If you haven't found it yet in the CK: look under Animations -> Actors.../0_master.hkx -> ActionActivate -> ActivateRootChar -> Chair -> CraftingEnchantingRoot.

 

Edit: you don't need different workbenches btw to have different animations. You can also use conditions that are not unique to thze furniture. This way I have one single invisible furniture in one of my testmods which allows me to play all kinds of different furniture animations.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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