argetting reanimated minions to equip armorweapons

Post » Thu Jun 21, 2012 2:21 am

edit: don't know how I messed the title up...should be "Getting" not "argetting" O_o

has anyone found a good way of getting into the inventory of reanimated minions?

OpenInventory() doesn't seem to work on them so what I did was:

created a new perk with an Activate entry point
created a new generic container
in the fragment for my perk I use RemoveAllItems to send the minion's inventory to the container, force activate the container, then RemoveAllitems back to the minion.

That all works swimmingly. I can use ShowInventory in the console to verify that the transfer happens. The problem is, the borked reanimated AI doesn't seem to want to equip anything...at all. I give it weapons and it fights with its fists when combat starts. I give it armor and it just stands around naked.

So, since it doesn't want to automatically equip nice things like normal NPCs, I gave it a scripted magic effect.
Actor TargetEvent OnEffectStart(Actor akTarget, Actor akCaster)		Target = akTarget	Debug.MessageBox("start")	EndEventEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)Form ToAdd = akItemReference as FormTarget.EquipItem(ToAdd)if ToAdd != none  Debug.MessageBox("equipped")endifEndEvent

I never get the "equipped" message. http://www.creationkit.com/OnItemAdded_-_ObjectReference's notes on the wiki say that akItemReference is usually none...How else should I go about getting things equipped?
User avatar
Ronald
 
Posts: 3319
Joined: Sun Aug 05, 2007 12:16 am

Post » Wed Jun 20, 2012 10:57 pm

I created my own scripted effect which I added to all the raise dead spell which makes then equip any gear in their inventory. Been playing with it for ages and works great. When I get home from work I will post it.
Think it had something to do with setting your summon/raised creature as SetPlayerTeammate().
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Thu Jun 21, 2012 3:04 am

Armor Property LFEquipFix Auto; This little beauty is what forces the raised creature to re-equip the correct gear.; Its a 1 armor piece of leather chest armor with no value.Race Property ArgonianRace autoRace Property BretonRace autoRace Property BretonRaceVampire autoRace Property DA13AfflictedRace autoRace Property DarkElfRace autoRace Property DarkElfRaceVampire autoRace Property DraugrMagicRace autoRace Property DraugrRace autoRace Property ElderRace autoRace Property FalmerRace autoRace Property HighElfRace autoRace Property HighElfRaceVampire autoRace Property ImperialRace autoRace Property ImperialRaceVampire autoRace Property KhajiitRace autoRace Property NordRace autoRace Property NordRaceVampire autoRace Property OrcRace autoRace Property RedguardRace autoRace Property RedguardRaceVampire autoRace Property RigidSkeletonRace autoRace Property SkeletonNecroPriestRace autoRace Property SkeletonNecroRace autoRace Property SkeletonRace autoRace Property WoodElfRace autoint HumanoidNPCEVENT OnEffectStart(Actor akTarget, Actor akCaster)If akTarget.GetRace() == OrcRace || akTarget.GetRace() == BretonRace || akTarget.GetRace() == NordRace || akTarget.GetRace() == ElderRace || akTarget.GetRace() == KhajiitRace \ || akTarget.GetRace() == HighElfRace || akTarget.GetRace() == ImperialRace || akTarget.GetRace() == BretonRaceVampire || akTarget.GetRace() == DarkElfRace \ || akTarget.GetRace() == ArgonianRace || akTarget.GetRace() == RedguardRace || akTarget.GetRace() == WoodElfRace || akTarget.GetRace() == DA13AfflictedRace \ || akTarget.GetRace() == FalmerRace || akTarget.GetRace() == SkeletonRace || akTarget.GetRace() == SkeletonNecroRace || akTarget.GetRace() == SkeletonNecroPriestRace \ || akTarget.GetRace() == RigidSkeletonRace || akTarget.GetRace() == RedguardRaceVampire || akTarget.GetRace() == NordRaceVampire || akTarget.GetRace() == ImperialRaceVampire \ || akTarget.GetRace() == HighElfRaceVampire || akTarget.GetRace() == DraugrRace || akTarget.GetRace() == DraugrMagicRace || akTarget.GetRace() == DarkElfRaceVampire HumanoidNPC = 1Endif; All of the above just to make sure we only try and equip humanoid creatures and not animals/insects etc.; I could have used a formlist with all the races saved inside but this was an old script before I learnt so much. Utility.Wait(6); Wait 5-6 seconds because of the time it takes for the animation to actually 'raise' them to standing. akTarget.SetPlayerTeammate(True, True); This is very important. If HumanoidNPC == 1 && akTarget.GetActorValue("Health") >= 1		; Make sure they are a humanoid race and is starting to ressurect.  akTarget.OpenInventory()				; Force opens akTarget's inventory.  akTarget.AddItem(LFEquipFix, 1, True)			 ; Adds the equipment fix to make them equip the right gear.  Utility.WaitMenuMode(0.5)				; Wait half a second before removing the equipment fix.  akTarget.RemoveItem(LFEquipFix, 1)			  ; Removes the equipment fix now it has done its job. Endif; Only downside to all this is the raised creatures inventory is left open for the player to close but you can; still add weapons and armor to it while in this inventory.ENDEVENT
User avatar
Samantha Mitchell
 
Posts: 3459
Joined: Mon Nov 13, 2006 8:33 pm

Post » Thu Jun 21, 2012 2:17 am

Neat! I went for a different method. I used a function in the magic effect that allowed it to be removed without turning them to ash, and used a new spell to call the function. I called the spell "relenquish" and it simply kills your undead on the spot, without turning it to ash. You are then able to add or remove items from the body and then raise it again. I thought it had a nice feel to it.


In your method, does it prioritize better weapons and armor depending on its skills? Such that if it has a high light armor rating, it will prefer light armor over heavy armor in most cases?
User avatar
chirsty aggas
 
Posts: 3396
Joined: Wed Oct 04, 2006 9:23 am

Post » Wed Jun 20, 2012 11:48 pm

Yes it seams the higher in a certain skill they will equip the relevant weapon/armour. I tested this a little and noticed the higher level I got they started using there original armour because I was giving them heavy and the levelled lists started giving them armour perks lol.
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Thu Jun 21, 2012 4:01 am

BOOSH! Thanks leonfenten, I finally got it to work.

Out of curiosity...did you put that script on the reanimate effect? And it just automatically gave you the chance to equip any humanoid NPCs you cast it on?

After adding SetPlayerTeammate to my modified Reanimate spell effect and utilizing your little armor piece trick I got my perk up and running.
I'll have to do some more strenuous testing on this but I think I got around that large script chunk of actor type checks by using factions and "ActorType" keywords.
My Reanimate spell has an effect with the condition HasKeyword ActorTypeNPC == 1. If that condition is met, the actor gets added to a custom faction and my perk adds an Activation option to any actor in that faction.
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Thu Jun 21, 2012 2:08 pm

caveat: I just spent more hours than I care to admit trying to solve this stupid issue...
The above post was true for my crappy little test esp that I made...I wanted to incorporate the stuff into a mod so I copied everything (with a few tweaks/improvements) over to the mod I'm working on aaaaaaannnnnd it didn't work!

I was banging my head on my desk trying to figure out what I could have done differently, until finally I opened up both esp's side by side and went through the various magic effects and perks scrutinizing every little detail.
The culprit: in my test mod I had given my magic effect a taper duration for some reason, and as it turns out, that was the only reason it was working.

Here's the script I have atm(mangled from hours of minute debugging changes)
Scriptname csdAddToMinionFactionScript extends ActiveMagicEffect {Adds target to a Faction.}Keyword property csdkeyword autoFaction property csdUndeadHumanoidMinionFaction autoFaction property csdUndeadMinionFaction autoActor TargetBool ChangedEVENT OnEffectStart(Actor akTarget, Actor akCaster)Debug.Notification("started")Target = akTarget;utility.wait(6.0)akTarget.IgnoreFriendlyHits()akTarget.setFactionRank(csdUndeadMinionFaction, 0) akTarget.SetPlayerTeammate(True, True)akTarget.SetFactionRank(csdUndeadHumanoidMinionFaction, 0)Changed = True if akTarget.IsIgnoringFriendlyHits()  Debug.Notification("IgnoringFriendlyHits")endifif akTarget.IsPlayerTeammate()  Debug.Notification("Teammate")endifif akTarget.IsInFaction(csdUndeadMinionFaction)  Debug.Notification("Faction")endifEndEvent Event Ondying(Actor akKiller)if Changed  Target.IgnoreFriendlyHits(False)  Target.SetPlayerTeammate(False, False)  Target.RemoveFromFaction(csdUndeadMinionFaction)  Target.RemoveFromFaction(csdUndeadHumanoidMinionFaction)  endifEndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)if Changed  akTarget.IgnoreFriendlyHits(False)  akTarget.SetPlayerTeammate(False, False)  akTarget.RemoveFromFaction(csdUndeadMinionFaction)  akTarget.RemoveFromFaction(csdUndeadHumanoidMinionFaction)  endifEndEvent
it would seem that the effect starts as it should but then immediately ends (even with the utility.wait, it waits for x seconds then immediately ends rendering the entire script useless because I need the other events to happen) unless there is a taper duration regardless of the duration on the spell. I'm assuming this has something to do with the godawful reanimate effects.

It seems to be working as intended with the taper but I'd like to know if anyone has any other insights as to why these shenanigans are happening.
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am

Post » Thu Jun 21, 2012 1:45 am

caveat #2: It turns out that wasn't the answer to my problem either for the same reason the vanilla reanimated things turn to ash when you go through a load screen. Somehow those secondary magic effects tacked on to the reanimate spells just end.
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Thu Jun 21, 2012 2:43 am

What's the duration of your magic effect? The script is only active for the duration of its magic effect. When the magic effect ends, the script will stop processing any new events. Any events/functions that are currently being processed will still continue until completed.
User avatar
Valerie Marie
 
Posts: 3451
Joined: Wed Aug 15, 2007 10:29 am

Post » Thu Jun 21, 2012 4:43 am

999 days
I have a Reanimate effect with duration 999 days and a Script effect with duration 999 days
the reanimate effect seems to last as long as it should (though using HasMagicEffect in the console returns 0 for it - I'm guessing thats how the Reanimate archetype is supposed to work?)

The script effect is where the weirdness happens. Those Debug.Notifications pop on the screen but when I check the values in the console they return 0, meaning the OnEffectFinish happens immediately after the OnEffectStart. Unless I put a long taper duration on the script effect, in which case, the effects (setplayerteammate, ignorefriendlyhits, factions) will remain set until I go through a load screen and then the OnEffectFinish fires erasing those changes prematurely.

I did a search for "reanimate" on this forum and from the other posts on this matter it seems these are just unfortunate side effects of the Reanimate archetype. Still testing to see if the problem lies with the reanimated actor itself or the spell containing the reanimate effect...

http://www.gamesas.com/topic/1351778-oneffectfinish-why-it-doesnt-last/page__p__20369322__hl__reanimate__fromsearch__1#entry20369322, http://www.gamesas.com/topic/1351656-problem-unable-to-use-addtofaction-on-reanimate-targetand-unable-to-see-the-conditional-buttons/page__hl__reanimate__fromsearch__1, http://www.gamesas.com/topic/1366341-massively-annoying-bug-with-commanded-actors/page__p__20623423__hl__reanimate__fromsearch__1#entry20623423
User avatar
Zoe Ratcliffe
 
Posts: 3370
Joined: Mon Feb 19, 2007 12:45 am

Post » Thu Jun 21, 2012 5:15 am

Research update: I have now tried adding the effects through a scripted Ability instead. The results are the same as with a 999day long fire and forget effect. The effect stays active until you go through a load screen (not all load screens, fast traveling/coc'ing will do it) and then the ability is inexplicably removed...

A question: Is this behavior exclusive to reanimated actors? or is this something that all followers suffer from? I've never had any circumstances where I added any long term spells/abilities to any of my followers.
User avatar
courtnay
 
Posts: 3412
Joined: Sun Nov 05, 2006 8:49 pm

Post » Wed Jun 20, 2012 11:41 pm

I have noticed a few strange things about "summonable" over other actors, for example you cannot in any way shape or form "Command" summoned minions like you can Ally's by making them wait at a pointed location or attack a target just by holding the action key. I tried for ages to get this to work with all sorts of new scripts, effects, quests, dialogues and even re-makling the vanilla summons but in the end I found as soon as I tick "Summonable" all that work is for naught.
Have you noticed in the vanilla reanimation spells the secondary effect lasts a second longer?
There must be some kind of hard coding for the reanimated actors because I couldn't see anything scripted that stated "If i go though a load screen turn me to ash" but Thrall's seam immune to it.
User avatar
Laura Richards
 
Posts: 3468
Joined: Mon Aug 28, 2006 4:42 am

Post » Thu Jun 21, 2012 5:28 am

Yeah Leonfenten I just tried adding this to one of my summons in my mod.. While I was able to open their inventory I couldnt get them to equip anything. possibly because skeletons just simply are not able to equip that and don't have the ability at all just as you cannot give them certain items in the creation kit even.

However as for giving them commands I have thought about instead of using a summon spell perhaps use a PlaceatMe effect and bringing them to the player that way. problem there being that I cannot find any way to add a skeleton to a relationship with the player. I tried opening relationships but the skeletons are not even on the list of possible choices for Parent or Child... =/ Screwy Skyrim
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am

Post » Thu Jun 21, 2012 10:01 am

I have noticed a few strange things about "summonable" over other actors, for example you cannot in any way shape or form "Command" summoned minions like you can Ally's by making them wait at a pointed location or attack a target just by holding the action key. I tried for ages to get this to work with all sorts of new scripts, effects, quests, dialogues and even re-makling the vanilla summons but in the end I found as soon as I tick "Summonable" all that work is for naught.
Have you noticed in the vanilla reanimation spells the secondary effect lasts a second longer?
There must be some kind of hard coding for the reanimated actors because I couldn't see anything scripted that stated "If i go though a load screen turn me to ash" but Thrall's seam immune to it.
thats because the Thrall spell doesn't have the secondary effect on it, just a 999 day duration reanimate effect (which doesn't show up when using HasMagicEffect).
all the other reanimate spells have the secondary reanimate effect which behaves as stated in the Similar post 3 link above. Also the hit shader attached to the reanimate effect stops playing on the target after a load screen, meaning the effects of the actual reanimate spell get removed as well, which is entirely baffling.

I'm gonna end up having to manage this in a quest script like the guy in Similar post 3 did.
User avatar
Genocidal Cry
 
Posts: 3357
Joined: Fri Jun 22, 2007 10:02 pm

Post » Thu Jun 21, 2012 12:45 am

Yeah Leonfenten I just tried adding this to one of my summons in my mod.. While I was able to open their inventory I couldnt get them to equip anything. possibly because skeletons just simply are not able to equip that and don't have the ability at all just as you cannot give them certain items in the creation kit even.

For the equipment fix item, did you use an armor piece or a weapon? You might try using a weapon. The item I'm using is a daedric dagger with 0 value 0 weight and 1 damage. My thoughts are, since skeletons can't equip armor, adding a random armor piece to them won't "fix" them.

Also, if anyone cares, I have gotten my little work around to a fairly consistent state now. I can reanimate a thrall and have continuous access to their inventory without having to repeatedly cast spells on them/kill them.
User avatar
Unstoppable Judge
 
Posts: 3337
Joined: Sat Jul 29, 2006 11:22 pm


Return to V - Skyrim