Jump to content

Question on animation


Recommended Posts

So basically, i've made an item, and when that item is used I'd like an animation to play. All I want for the animation for the moment is a simple Wilson moving his hands around thing like he does when he messes with stuff already. I just can't figure out how to add that in to the item. Is it just a component I add in, or something to do with stategraphs? Do I add it into the item at all? Because when you murder bees it plays the animation I want but there's nothing in the bee prefab (I think) that tells it to do that. I think it's in the SgWilson file that makes it play the animation, and it just plays it whenever Wilson murders anything. So do I have to add it into the stategraph for my character, under ActionHandler (ACTIONS.USE, "dolongaction")?

 

Any help would be appreciated.

Link to comment
Share on other sites

There is an API call for this from modmain.lua

 

AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(MAGNIFYIDENTIFY, "dolongaction"))

 

where MAGNIFYIDENTIFY is the variable containing your new action.

local MAGNIFYIDENTIFY = GLOBAL.Action()MAGNIFYIDENTIFY.str = "Identify"MAGNIFYIDENTIFY.id = "MAGNIFYIDENTIFY"MAGNIFYIDENTIFY.fn = function(act)    if act.target and act.target.components.rpgweapon and act.target.components.rpgweapon.discovered == false and act.invobject and act.invobject.components.magnifyidentify then        return act.invobject.components.magnifyidentify:DoIdentify(act.target, act.doer)    end    if act.target and act.target.components.rpgarmor and act.target.components.rpgarmor.discovered == false and act.invobject and act.invobject.components.magnifyidentify then        return act.invobject.components.magnifyidentify:DoIdentify(act.target, act.doer)    endendAddAction(MAGNIFYIDENTIFY)AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(MAGNIFYIDENTIFY, "dolongaction"))

the above is an example of an action created from modmain in RPG Items mod.

Link to comment
Share on other sites

Archived

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

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...