Jump to content

Trying to get the Savior's Hide to Spawn Wolves on Death


SirBeasty

Recommended Posts

I've been trying to get this effect to work for a week now. The scripts are going in correctly and not screaming at me. I attached the script to the armor. I went into the game and found a random bandit and killed him, but no wolves spawn. Can someone please tell me what I am doing wrong. Here's the script by the way.

 

Scriptname SirBeastSaviorWolfSummons extends ObjectReference
ActorBase Property wolf Auto
Armor Property DA05SaviorsHide Auto
Spell Property SirBeastSummonWolvesSpell Auto
Actor Property PlayerREF Auto
Event OnDeath(ObjectReference akKiller)
akKiller = PlayerREF
If playerREF.IsEquipped(DA05SaviorsHide) == 1
game.getPlayer().placeAtMe(wolf)
game.getPlayer().placeAtMe(wolf)
EndIf
EndEvent
Any help is appreciated.
Link to comment
Share on other sites

The event OnDeath won't trigger from an object reference. It'll only trigger from an actor. For this script to work, it would need to be on the actor that you kill. Instead, you need to use the Story Manager node for when the player kills someone. Also, you're using akKiller wrong. And by "using it wrong", I simply mean it isn't doing anything. You've told the game to set the variable akKiller to the contents of the variable PlayerREF. So, now the variable akKiller is the player. But this is never used anywhere. Rather, it should have said "if ( akKiller == PlayerREF )" with a corresponding end to make sure the newly dead actor was killed by the player. But, as I said, that's not what you need, because this is the wrong event entirely.

 

To trigger an event on the death of something, you'll need another quest. This new quest will need to be tied into the story manager. The story manager is simpler than it might first appear. Open up the Kill Actor event (from story manager section of the creation kit, it's listed as SM Event Node under Character in the object window like weapons, armor, statics, and quests), add a new node by right clicking the very top item and choosing new quest node. It'll be created at the bottom. If you look into the nodes above it, you'll notice by expanding the one second from bottom that the last one in that node that it doesn't have Shares Event checked. This means that if this fires, the story manager will stop firing quests (it runs from top to bottom). So, drag yours directly above the Branch Node that contains that non-shared-event quest (making your quest node second from the bottom). Make sure you check Shares Event on yours so it doesn't cause issues. Give it a unique ID, then right click it and add a new quest and choose yours.

 

Now the story manager event node is ready and you can ok out of it and go back to your quest. Uncheck Start Game Enabled and Run Once. Set the Event box on this tab to Kill Actor Event. Give it a unique ID and click ok. Then reopen it (this step is necessary to prevent a crash). Add a new script on this quest using the event

Event OnStoryKillActor(ObjectReference akVictim, ObjectReference akKiller, Location akLocation, int aiCrimeStatus, int aiRelationshipRank)

Then, check that akKiller == Game.GetPlayer(). You'll also need to check that the player has the armor equipped. If both of these things are true, then spawn the wolves. To give the wolves a time limit, you might be better off putting the time limit script on the wolves themselves. Finally, when you're done checking everything (whether it passed or failed) stop the quest. This is because the script event only fires one time, and that one time is when the quest is started by the story manager event for that script event. When the story manager fires that event, it will start the quest. When the quest is started this way, that event in the script will fire. If the quest is already started (or still running from previously being started), then the event in that script is not fired (this is why you need to make sure the quest is not start game enabled). That should be everything. I'm sure that will be confusing if you're not already fairly familiar with all of this, feel free to ask.

 

Sample script that I have NOT confirmed works:

ActorBase Property Wolf  Auto  
Armor Property DA05SaviorsHide Auto

Event OnStoryKillActor(ObjectReference akVictim, ObjectReference akKiller, Location akLocation, int aiCrimeStatus, int aiRelationshipRank)
	If ( akKiller == Game.GetPlayer() && Game.GetPlayer().IsEquipped(DA05SaviorsHide) == 1 )
		Game.GetPlayer().PlaceAtMe(Wolf, 2)
	EndIf
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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