Jump to content

Possibly Easy Animation (Need a Scripter's Eyes)


futamagus

Recommended Posts

Posted

So in my search to add animation to static meshes and NON character based animations, I found this mod that was actually posted here.

 

Animated Katana:

http://www.loverslab.com/showthread.php?tid=5316

 

This is the ONLY animating weapon I found (currently I think there's a chainsaw)

 

And it's NOT using Havok, it's using an animation baked into the NIF and a Script that's calling the animation somehow.

 

I am not very script savvy, but if someone can reverse engineer it and make a template form it, we could have some really really interesting mods here.

 

Below is the script they use (I believe)

 

 

.FLAGS
hidden 0
conditional 1
.OBJECTS
OBJECT aaaYamatoHookScn : ObjectReference {0}
VARS
	weapon ::YamatoScb_var = null {0}
	weapon ::Yamato_var = null {0}
	String DrawEvtStr = "weaponDraw" {0}
	weapon ::YamatoNoScb_var = null {0}
	String SheatheEvtStr = "weaponSheathe" {0}
	weapon ::YamatoScbInvisible_var = null {0}
ENDVARS
PROPS
	PROP WEAPON Yamato rw {0}
		AUTOVAR ::Yamato_var
	ENDPROP
	PROP WEAPON YamatoNoScb rw {0}
		AUTOVAR ::YamatoNoScb_var
	ENDPROP
	PROP WEAPON YamatoScb rw {0}
		AUTOVAR ::YamatoScb_var
	ENDPROP
	PROP WEAPON YamatoScbInvisible rw {0}
		AUTOVAR ::YamatoScbInvisible_var
	ENDPROP
ENDPROPS
STATES
	STATE DEFAULT
		NONE FUNCTION OnObjectEquipped(Form akBaseObject, ObjectReference akReference) {0}
			FLAGS 0
			VARS
				actor ::temp3
				weapon ::temp4
				Form ::temp5
				bool ::temp6
				int ::temp7
				bool ::temp8
				actor player
				NONE ::nonevar
				ObjectReference ::temp9
			ENDVARS
			callstatic game, GetPlayer, ::temp3
			assign player, ::temp3
			cast ::temp4, akBaseObject
			cast ::temp6, ::temp4
			jmpf ::temp6, 4
			cast ::temp5, ::Yamato_var
			cmp_eq ::temp6, akBaseObject, ::temp5
			cast ::temp6, ::temp6
			cast ::temp6, ::temp6
			jmpf ::temp6, 5
			cast ::temp5, ::YamatoScb_var
			callmethod GetItemCount, player, ::temp7, ::temp5
			cmp_eq ::temp8, ::temp7, 0
			cast ::temp6, ::temp8
			jmpf ::temp6, 7
			callstatic debug, Trace, ::nonevar, "Reg Anim Hook", 0
			cast ::temp9, player
			callmethod RegisterForAnimationEvent, self, ::temp8, ::temp9, DrawEvtStr
			cast ::temp9, player
			callmethod RegisterForAnimationEvent, self, ::temp8, ::temp9, SheatheEvtStr
			jmp 1
		ENDFUNCTION
		NONE FUNCTION OnAnimationEvent(ObjectReference akSource, String asEventName) {0}
			FLAGS 0
			VARS
				actor ::temp18
				Form ::temp19
				bool ::temp20
				bool ::temp21
				bool ::temp22
				actor player
				NONE ::nonevar
			ENDVARS
			callstatic game, GetPlayer, ::temp18
			assign player, ::temp18
			cast ::temp19, ::Yamato_var
			callmethod IsEquipped, player, ::temp20, ::temp19
			cast ::temp20, ::temp20
			jmpf ::temp20, 3
			cmp_eq ::temp21, asEventName, DrawEvtStr
			cast ::temp20, ::temp21
			jmpf ::temp20, 3
			callmethod YamatoDrawn, self, ::nonevar, player
			jmp 10
			cast ::temp19, ::YamatoNoScb_var
			callmethod IsEquipped, player, ::temp21, ::temp19
			cast ::temp21, ::temp21
			jmpf ::temp21, 3
			cmp_eq ::temp22, asEventName, SheatheEvtStr
			cast ::temp21, ::temp22
			jmpf ::temp21, 3
			callmethod YamatoSheathe, self, ::nonevar, player
			jmp 1
		ENDFUNCTION
		NONE FUNCTION YamatoDrawn(actor player) {0}
			FLAGS 0
			VARS
				NONE ::nonevar
				Form ::temp0
			ENDVARS
			callstatic debug, Trace, ::nonevar, "Yamato Drawn!", 0
			cast ::temp0, ::YamatoScb_var
			callmethod AddItem, player, ::nonevar, ::temp0, 1, true
			cast ::temp0, ::YamatoNoScb_var
			callmethod AddItem, player, ::nonevar, ::temp0, 1, true
			cast ::temp0, ::YamatoScbInvisible_var
			callmethod RemoveItem, player, ::nonevar, ::temp0, 1, true, null
			cast ::temp0, ::Yamato_var
			callmethod RemoveItem, player, ::nonevar, ::temp0, 1, true, null
			cast ::temp0, ::YamatoScb_var
			callmethod EquipItem, player, ::nonevar, ::temp0, false, true
			cast ::temp0, ::YamatoNoScb_var
			callmethod EquipItem, player, ::nonevar, ::temp0, false, true
		ENDFUNCTION
		NONE FUNCTION UnequipYamatoWhenDrawn(actor player) {0}
			FLAGS 0
			VARS
				NONE ::nonevar
				Form ::temp2
			ENDVARS
			callstatic debug, Trace, ::nonevar, "Unequip Yamato When Drawn", 0
			cast ::temp2, ::Yamato_var
			callmethod AddItem, player, ::nonevar, ::temp2, 1, true
			cast ::temp2, ::YamatoScbInvisible_var
			callmethod AddItem, player, ::nonevar, ::temp2, 1, true
			cast ::temp2, ::YamatoNoScb_var
			callmethod RemoveItem, player, ::nonevar, ::temp2, 1, true, null
			cast ::temp2, ::YamatoScb_var
			callmethod RemoveItem, player, ::nonevar, ::temp2, 1, true, null
			cast ::temp2, ::YamatoScbInvisible_var
			callmethod EquipItem, player, ::nonevar, ::temp2, false, true
		ENDFUNCTION
		NONE FUNCTION GotoState(String newState) {0}
		@doc Function that switches this object to the specified state
			FLAGS 0
			VARS
				NONE ::nonevar
			ENDVARS
			callmethod onEndState, self, ::nonevar
			assign ::state, newState
			callmethod onBeginState, self, ::nonevar
		ENDFUNCTION
		String FUNCTION GetState() {0}
		@doc Function that returns the current state
			FLAGS 0
			return ::state
		ENDFUNCTION
		NONE FUNCTION OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) {0}
			FLAGS 0
			VARS
				weapon ::temp10
				actor ::temp11
				Form ::temp12
				bool ::temp13
				int ::temp14
				bool ::temp15
				bool ::temp16
				actor player
				bool isUnreg
				NONE ::nonevar
				ObjectReference ::temp17
			ENDVARS
			cast ::temp10, akBaseObject
			jmpf ::temp10, 36
			callstatic game, GetPlayer, ::temp11
			assign player, ::temp11
			assign isUnreg, false
			cast ::temp12, ::Yamato_var
			cmp_eq ::temp13, akBaseObject, ::temp12
			cast ::temp13, ::temp13
			jmpf ::temp13, 5
			cast ::temp12, ::YamatoNoScb_var
			callmethod GetItemCount, player, ::temp14, ::temp12
			cmp_eq ::temp15, ::temp14, 0
			cast ::temp13, ::temp15
			jmpf ::temp13, 4
			callstatic debug, Trace, ::nonevar, "unequip Yamato!", 0
			assign isUnreg, true
			jmp 13
			cast ::temp12, ::YamatoNoScb_var
			cmp_eq ::temp15, akBaseObject, ::temp12
			cast ::temp15, ::temp15
			jmpf ::temp15, 5
			cast ::temp12, ::Yamato_var
			callmethod GetItemCount, player, ::temp14, ::temp12
			cmp_eq ::temp16, ::temp14, 0
			cast ::temp15, ::temp16
			jmpf ::temp15, 4
			callmethod UnequipYamatoWhenDrawn, self, ::nonevar, player
			assign isUnreg, true
			jmp 1
			jmpf isUnreg, 7
			callstatic debug, Trace, ::nonevar, "unReg Anim Hook", 0
			cast ::temp17, player
			callmethod UnRegisterForAnimationEvent, self, ::nonevar, ::temp17, DrawEvtStr
			cast ::temp17, player
			callmethod UnRegisterForAnimationEvent, self, ::nonevar, ::temp17, SheatheEvtStr
			jmp 1
			jmp 1
		ENDFUNCTION
		NONE FUNCTION YamatoSheathe(actor player) {0}
			FLAGS 0
			VARS
				NONE ::nonevar
				Form ::temp1
			ENDVARS
			callstatic debug, Trace, ::nonevar, "Yamato Sheathe!", 0
			cast ::temp1, ::Yamato_var
			callmethod AddItem, player, ::nonevar, ::temp1, 1, true
			cast ::temp1, ::YamatoNoScb_var
			callmethod RemoveItem, player, ::nonevar, ::temp1, 1, true, null
			cast ::temp1, ::YamatoScb_var
			callmethod RemoveItem, player, ::nonevar, ::temp1, 1, true, null
			cast ::temp1, ::Yamato_var
			callmethod EquipItem, player, ::nonevar, ::temp1, false, true
		ENDFUNCTION
	ENDSTATE
ENDSTATES
ENDOBJECT

 

 

Posted

So after consulting with someone at work. I have reason to believe this is actually the wrong script for triggering a nif exported with animations baked in (without kfs or havock). When I get home tonight I'm going to look at the other two scripts and the katana nif in greater detail.

Posted

From what i understand IMO, the animated ribbons on the scabbard doesnt require any of script to trigger the animation.. but from what i can tell, scripts that were use (you listed above) maybe intended for the scabbard being hold by left hand with/out the sword and also the pose thing.

 

just like what i mention in the animated katana thread where i failed to rig the ribbons into chains. and currently there's about 4-5 of my sword (standalone mod) that i mashup with that animated ribbon, and they all work just fine without any script at all.

Posted

I think I'll try to fix up a different animation and see if it works ingame without a script tomorrow. I checked out the other script and it makes no reference to the nif file at all.

 

Hopefully I can get something to work, if not - I'm really curious as to how they did it :C

Archived

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

  • Recently Browsing   0 members

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