Force an Actor to evaluate and equip items?

Post » Wed Jun 20, 2012 3:00 am

Actually this is one of two problems.

I have an actor that is placed at the feet of a dying actor. I then call removeinventory on the dead actor and place that inventory in the new actor, but I can't get the new actor to equip MOST of the items that were in the dead actors inventory. They do equip a sword that the dead actor had, but nothing else. I want them to equip any available armor as well.

Secondary to the problem, the base actor contains a PlayerFollower package but the actor placed at the dead victims feet will not follow the player.

Here's the code, this script event is triggered on the death of the original actor.

Event OnDeath(Actor akKiller)Trace("Actor Dead")ObjectReference SoulServantTrace("Target Race is " + TargetRace)if(TargetRace == ArgonianRace || TargetRace == ArgonianRaceVampire || TargetRace == DarkElfRace || TargetRace == DarkElfRaceVampire || TargetRace == HighELfRace || TargetRace == HighELfRaceVampire || TargetRace == ImperialRace || TargetRace == ImperialRaceVampire || TargetRace == KhajiitRace || TargetRace == KhajiitRaceVampire || TargetRace == NordRace || TargetRace == NordRaceVampire || TargetRace == OrcRace || TargetRace == OrcRaceVampire || TargetRace == RedguardRace || TargetRace == RedguardRaceVampire || TargetRace == WoodElfRace || TargetRace == WoodElfRaceVampire || TargetRace == BretonRace || TargetRace == BretonRaceVampire || Target.IsInFaction(IsGuardFaction))  if(Targetsix == 0)   Trace("Actor Male")   SoulServant = Target.PlaceAtMe(mm_BeluaSoulServantMale) as Actor   utility.wait(1)  elseif(Targetsix == 1)   Trace("Actor Female")   SoulServant = Target.PlaceAtMe(mm_BeluaSoulServantFemale) as Actor   utility.Wait(1)  EndIf  Trace("Soul Servant is: " + SoulServant)  Target.RemoveAllItems(SoulServant, false,false)EndIf

Thanks,

-MM
User avatar
Milad Hajipour
 
Posts: 3482
Joined: Tue May 29, 2007 3:01 am

Post » Wed Jun 20, 2012 10:53 am

Why don't you make an Outfit in the CK then use:
Actor.SetOutfit(Outfit)
Much better and more reliable way to do this :)
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Wed Jun 20, 2012 2:05 pm

Hey dudster,

Primarily because the actor that's dying could be anyone and I want a new actor to take and equip its weapons, armor and shield. I can force equip weapons and shields, but I can't figure out the armor.

-MM
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am


Return to V - Skyrim