Jump to content

Recommended Posts

Posted

Preserving your general approach but subbed in the animation since I am not familiar with those and know these should def work. I didnt test but if still having issues let me know. Also throw in a Debug Message to confirm if the object is seeing it to remove any doubt. You dont need container event btw and you also dont have to declare states in the script to use them

;=================================================================
ScriptName colo_FluidAnimationScript Extends ObjectReference
;=================================================================
; Idle Property IdleStop_Loose Auto; Feel free to use this instead
;=================================================================
Event OnEquipped(Actor akActor)
  String PriorStatus = GetState()
  GotoState("Limbo")
  Utility.Wait(0.2)
  GotoState(PriorStatus)
  Bool Valid = akActor.GetFormID() == 0x14 && !PriorStatus as Bool && !Utility.IsInMenuMode() && akActor.IsEquipped(GetBaseObject())
  If Valid
   GotoState("WearItem")
   Debug.SendAnimationEvent(akActor,"IdleCiceroDance2"); Was EFF
   RegisterForSingleUpdate(20.0)
  EndIf
EndEvent
;=================================================================
Event OnUnEquipped(Actor akActor)
  String PriorStatus = GetState()
  Utility.Wait(0.2)
  Bool Valid = !Utility.IsInMenuMode() && PriorStatus == "WearItem" && GetState() == PriorStatus && !akActor.IsEquipped(GetBaseObject())
  If Valid
   GotoState("")
   UnRegisterForUpdate()
   Debug.SendAnimationEvent(akActor,"JumpLand"); Was EFFstop
  EndIf
EndEvent
;=================================================================
Event OnUpdate()
     GetState() == "WearItem" && Debug.SendAnimationEvent(Game.GetPlayer(),"JumpLand")
  ; Was Game.GetPlayer().PlayIdle(IdleStop_Loose)
EndEvent
;=================================================================

The menumode routine I did off memory and you can use another method ofc. The intent there is prevent issues if whatever reason you decided to equip/unequip multiple times before exiting menu

Posted

Preserving your general approach but subbed in the animation since I am not familiar with those and know these should def work. I didnt test but if still having issues let me know. Also throw in a Debug Message to confirm if the object is seeing it to remove any doubt. You dont need container event btw and you also dont have to declare states in the script to use them

;=================================================================
ScriptName colo_FluidAnimationScript Extends ObjectReference
;=================================================================
; Idle Property IdleStop_Loose Auto; Feel free to use this instead
;=================================================================
Event OnEquipped(Actor akActor)
  String PriorStatus = GetState()
  GotoState("Limbo")
  Utility.Wait(0.2)
  GotoState(PriorStatus)
  Bool Valid = akActor.GetFormID() == 0x14 && !PriorStatus as Bool && !Utility.IsInMenuMode() && akActor.IsEquipped(GetBaseObject())
  If Valid
   GotoState("WearItem")
   Debug.SendAnimationEvent(akActor,"IdleCiceroDance2"); Was EFF
   RegisterForSingleUpdate(20.0)
  EndIf
EndEvent
;=================================================================
Event OnUnEquipped(Actor akActor)
  String PriorStatus = GetState()
  Utility.Wait(0.2)
  Bool Valid = !Utility.IsInMenuMode() && PriorStatus == "WearItem" && GetState() == PriorStatus && !akActor.IsEquipped(GetBaseObject())
  If Valid
   GotoState("")
   UnRegisterForUpdate()
   Debug.SendAnimationEvent(akActor,"JumpLand"); Was EFFstop
  EndIf
EndEvent
;=================================================================
Event OnUpdate()
     GetState() == "WearItem" && Debug.SendAnimationEvent(Game.GetPlayer(),"JumpLand")
  ; Was Game.GetPlayer().PlayIdle(IdleStop_Loose)
EndEvent
;=================================================================

The menumode routine I did off memory and you can use another method ofc. The intent there is prevent issues if whatever reason you decided to equip/unequip multiple times before exiting menu

Yeah, now that works but not the right way) script works just if I drop item from inventory then pick up it and equip or re equip item the animation will work, but it work only for PC, not NPC. Problem is the item which need this script was added at inventory by another script and dont showing at characters I think it have "invisible hat" mark so script wont work before item will be dropped and pick upped again.

After all I thinking more and more about I'm just dumb)

Posted

Player.AddItem(SharpSword)

vs

Player.AddItem(Player.PlaceAtMe(SharpSword))

 

Above are not the same

 

ObjectReference is tricky in that, how it comes to be, impacts how it operates under the hood. The PlaceAtMe method will make the script on the sword act as you would expect, where as the usual way causes issues if spawned into a container

 

What is commonly done to sidestep issues like that, is to make something an Alias. That works, but really if you grant the item the PlaceAtMe way you dont have to Alias. In the end you just want an item to act as you would expect. Dropping an object also works because it now has come to be, aka has now spawned in the world and is no longer just in your inventory spreadsheet. Kinda tricky to explain I guess but really it doesnt matter so long as you know how to make it behave as expected

Posted

Player.AddItem(SharpSword)

vs

Player.AddItem(Player.PlaceAtMe(SharpSword))

 

Above are not the same

 

ObjectReference is tricky in that, how it comes to be, impacts how it operates under the hood. The PlaceAtMe method will make the script on the sword act as you would expect, where as the usual way causes issues if spawned into a container

 

What is commonly done to sidestep issues like that, is to make something an Alias. That works, but really if you grant the item the PlaceAtMe way you dont have to Alias. In the end you just want an item to act as you would expect. Dropping an object also works because it now has come to be, aka has now spawned in the world and is no longer just in your inventory spreadsheet. Kinda tricky to explain I guess but really it doesnt matter so long as you know how to make it behave as expected

I dont think so, the item is an armor with particle system, but if your are right I can attach script only to magical effect, if I just change event from OnEquipped to EffectStarts will script work properly or it must be rewritten?

Posted

A script is a script and there are various ways to reach a goal. Yeah an enchant using OnEffectStart can effectively perform the same end result as OnEquip. Just have to adapt accordingly like akActor would be akCaster etc

  • Recently Browsing   0 members

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