Jump to content

Scripting Help: Werewolf Follower Transformations


thisisheffner

Recommended Posts

Greetings,

 

I am pretty new to the modding scene and in the process of creating a custom follower. While most aspects of the Creation Kit are easy enough for me, scripting has proven to be a challenge. What I want my follower to do is, when he hits 30% health, to transform into a werewolf, and then, when combat has ended, to revert back to his wood elf form.

 

The game has scripts for NPCs to transform into werewolves, but none that I understand allow for transforming back to human (or mer) form.

 

Can anyone guide me in right direction? I don't have a base script of my own even.

Link to comment
Share on other sites

You could try asking the author of AFT for help. AFT includes an option to have your followers transform into a werewolf. Turning back just automatically happens when the duration is not extended by feeding and runs out.

Link to comment
Share on other sites

Thank you for your response. :)

 

A big issue for me is, no matter which in game script I use (DLC2TribalWerebearScript, DLC2WEWerewolfTransformAliasScript, etc.), the follower gets stuck indefinitely as a werewolf. May I ask what AFT stands for?

Link to comment
Share on other sites

Now I'm not super at scripting but this is similar to actually what I am doing with one of my characters in DIscworld

Except the float I just gave her a 30% chance on combat change so this may or may not work, I am not sure how to do % exactly on the if call to soooo you on your own for that one

All this does is insta change them back to a preset race whenever they leave combat, and if they are under 200 health (I hope) will pop them into wolf with transform and all, that spell will auto fill in the property window btw

All I did was compile to make sure it did but I didn't test so GL




Scriptname testwerewolfscriptfornexus extends ObjectReference


SPELL Property WerewolfChangeFX Auto


Actor Property actorproperty Auto

race property raceyouwant auto


Event OnCombatStateChanged(Actor akTarget, int aeCombatState)

if (aeCombatState == 0)

actorproperty.setrace(raceyouwant)

unregisterforupdate()

elseif (aeCombatState == 1)

registerforupdate(3.0)

endif

endevent


event onupdate()

float ActorHealth2 = actorproperty.GetAV("health")

if actorhealth2 <= 200

werewolfchangefx.cast(actorproperty)

unregisterforupdate()

endif

endevent

Link to comment
Share on other sites

Thank you @Darren83 for the assistance. I made some minor modifications to the script below. I am running into an error where the follower will transform into a werewolf at the correct health marker, but then becomes stuck and reverts to a version of his wood elf form, just with the skeleton of the werewolf (meaning hunched with elongated limbs). I don't know if that's related to the script or the WerewolfChangeFX...

 

The script I use us:

Scriptname FollowerWerewolfTransformAliasScript extends ObjectReference

SPELL Property WerewolfChangeFX  Auto  
 
Actor Property actorproperty  Auto  
race property raceyouwant auto
 
event onupdate()
	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 < 0.5)
		werewolfchangefx.cast(self)
		unregisterforupdate()
	endif
endevent

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
	if (aeCombatState == 0)
		actorproperty.setrace(raceyouwant)
		unregisterforupdate()
	elseif (aeCombatState == 1)
		registerforupdate(3.0)
	endif
endevent
Link to comment
Share on other sites

I don't know if I did it correctly, as I still have that issue. This is what the script looks like:

Scriptname FollowerWerewolfTransformAliasScript extends ObjectReference

SPELL Property WerewolfChangeFX  Auto  
 
Actor Property actorproperty  Auto  
race property raceyouwant auto
 
event onupdate()
	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 < 0.5)
		werewolfchangefx.cast(self)
		RegisterForAnimationEvent(actorproperty, "SetRace")
		unregisterforupdate()
	endif
endevent

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
	if (aeCombatState == 0)
		actorproperty.setrace(raceyouwant)
		RegisterForAnimationEvent(actorproperty, "SetRace")
		unregisterforupdate()
	elseif (aeCombatState == 1)
		registerforupdate(3.0)
	endif
endevent
Link to comment
Share on other sites

Sorry to repost, but I could really use some help. No matter what I do to the script, I still get the same issue where my follow transforms but then instantly shifts back to his Wood Elf race, just with the skeleton of the werewolf. This is the latest edition of my script. Please help, if you can.

Scriptname FollowerWerewolfTransformAliasScript extends Actor

SPELL Property WerewolfChangeFX  Auto  
 
Actor Property actorproperty  Auto  
race property raceyouwant auto

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
	if (aeCombatState == 0)
		actorproperty.setrace(raceyouwant)
		unregisterforupdate()
	elseif (aeCombatState == 1)
		registerforupdate(1.5)
	endif
endevent
 
event onupdate()
	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 < 0.4)
		werewolfchangefx.cast(actorproperty)
		Utility.Wait(30)
		unregisterforupdate()
	endif
endevent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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