Jump to content

Recommended Posts

Posted

Lol heres a thought, I thought he wa transforming BACK into a wood elf after combat not during the transformation, it could be combat screwing it up so add Utility.wait(3.0) actorproperty.setrace(werewolfbeastrace) after the werewolfchangefx, that should force him to be set as werewolf though it could get screwy if combat ends in the next 3 seconds lol

Posted
Did you try loading an earlier save (one made before you first added the script)? I've noticed when testing scripts in game that scripts sometimes do not update unless an earlier save is used.
Posted

Sorry for the delay in response. A short vacation kept my attention.

 

Alas, even when applied to an earlier save, the script doesn't appear to have changed the same problem I have been having. Should I extend the wait time after the transformation?

 

This is where the script currently stands:

Scriptname FollowerWerewolfTransformAliasScript extends Actor

SPELL Property WerewolfChangeFX  Auto  
 
Actor Property actorproperty  Auto  
race property raceyouwant auto
race property secondaryrace 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.GetAVPercentage("Health")
	if (ActorHealth2 < 0.4)
		werewolfchangefx.cast(actorproperty)
		Utility.Wait(3.0)
		actorproperty.setrace(secondaryrace)
		unregisterforupdate()
	endif
endevent
Posted

I made some more changes to the script only now he'll change in to werewolf form and just stand there. Enemies won't target him nor will he target them...this is what I came up with after perusing the CK wiki. Thoughts on what to do?

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

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack,  bool abBashAttack, bool abHitBlocked)
  	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 < 0.4)
		werewolfchangefx.cast(actorproperty)
		actorproperty.setrace(secondaryrace)
		actorproperty.SetRelationshipRank(Game.GetPlayer(), 3)
		registerforupdate(3.0)
	endif
EndEvent

event onupdate()
	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 >= 0.9)
		actorproperty.setrace(raceyouwant)
		actorproperty.SetRelationshipRank(Game.GetPlayer(), 3)
		unregisterforupdate()
	endif
endevent
Posted
You might need to add a line to the script to add the NPC to the player's faction and to the werewolf faction. Enemies of either faction might then attack the NPC and the NPC might then no longer remain neutral. Let us know if that works.
Posted

Alas, even setting the follower to those factions doesn't appear to work...I wish I knew more about scripting so that I could contribute more, but I do appreciate both of yours both. :)

 

Here is the script as it stands currently:

Scriptname FollowerWerewolfTransformAliasScript extends Actor

SPELL Property WerewolfChangeFX  Auto  
 
Actor Property actorproperty  Auto  
race property raceyouwant auto
race property secondaryrace auto
Faction property WerewolfFaction auto
Faction property PlayerFaction auto 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack,  bool abBashAttack, bool abHitBlocked)
  	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 < 0.4)
		werewolfchangefx.cast(actorproperty)
		actorproperty.setrace(secondaryrace)
		actorproperty.SetRelationshipRank(Game.GetPlayer(), 3)
		actorproperty.SetFactionRank(WerewolfFaction, 1)
		actorproperty.SetFactionRank(PlayerFaction, 1)
		registerforupdate(3.0)
	endif
EndEvent

event onupdate()
	float ActorHealth2 = actorproperty.GetAVPercentage("Health")
	if (ActorHealth2 >= 0.9)
		actorproperty.setrace(raceyouwant)
		actorproperty.SetRelationshipRank(Game.GetPlayer(), 3)
		actorproperty.SetFactionRank(PlayerFaction, 1)
		actorproperty.RemoveFromFaction(WerewolfFaction)
		unregisterforupdate()
	endif
endevent
Posted (edited)
It will be really something if you get it to work! OK, if we are sure factions are not the cause, maybe there is an issue with the NPC's AI? For example, there is a way to use the command console to remove AI from NPCs so that they just stand in one place, don't speak and take no action. What you are describing sounds similar. Edited by sp0ckrates
Posted
So perhaps it might help to examine the scripts in the game used to turn an NPC into a werewolf? In the Companions quest Proving Honor, Farkas uses beast form to transform from a Nord. After transforming, he takes out a group of five Silver Hand.
  • 2 weeks later...
  • 2 weeks later...
  • Recently Browsing   0 members

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