Jump to content

Outfit replacer script


Crendagord

Recommended Posts

Posted

Hello everyone!

 

I would like to create a script modifying outfit for the actor base, instead of modifying a ref in a cell; which is better for NPC such as Aela, Skjor and so on. Here is what I've written so far:

Scriptname OutfitReplacer extends Quest  

ActorBase Property SkyrimNPC  Auto
Outfit Property NewOutfit  Auto

Function SetOutfit(Outfit NewOutfit, bool abSleepOutfit = false)
    SkyrimNPC.SetOutfit(NewOutfit)
EndFunction

The script compiles well. But whether I attach it to a quest or a spell (with filled properties) nothing happens in game

 

Has anyone some idea of what could be missing?

Posted

Outfits are loaded directly (the indirect in levelItemoutfits) upon entering the encounter zone. The player level is used as a trigger.

So your script works, but has no effect.
You could read the armors in the new outfit and force the NPC with equipitem.
However, it is questionable whether it will not disappear again (unequitp) - after zones change or reload the game.

Posted

Can I ask how and when you call the function you defined?

Posted

Thanks for quick answers

 

1 hour ago, Andy14 said:

Outfits are loaded directly (the indirect in levelItemoutfits) upon entering the encounter zone. The player level is used as a trigger.

So your script works, but has no effect.
You could read the armors in the new outfit and force the NPC with equipitem.
However, it is questionable whether it will not disappear again (unequitp) - after zones change or reload the game.

If I understand you well, what NPC wears is generated when it is loaded. I was aware of that fact that is why I would like to directly change the base outfit. And yes, as you say, some times followers reset to their default outfit when dismissed. That's the reason I try modify the actor base and not the actor ref with an "equipitem" method

1 hour ago, CPU said:

Can I ask how and when you call the function you defined?

First time to a quest. Second to a spell. I used the transmute ore spell as a base. I joined screens

Replacer quest.jpg

Replacer spell.jpg

Posted
1 hour ago, Crendagord said:

...

OK, your script is not invoked because it does not respect the interface of magic effects (and it is quite useless attached to a quest.)

 

Change it into:

 

Scriptname OutfitReplacer extends ActiveMagicEffect  

ActorBase Property SkyrimNPC  Auto
Outfit Property NewOutfit  Auto

Event OnEffectStart(Actor caster, Actor target)
    SkyrimNPC.SetOutfit(NewOutfit)
EndEvent

 

Keep it to the magic effect, remove it from the quest.

Posted

Good that it works. :)

Please keep in mind: It only works for followers and normal "non-level" NPC's (citizens, like Ysolda, etc.) It will not work for NPC's who level with the player (except Follwower).

Posted

NPC levelling with player, you mean like bandits? Cause of leveled lists, right?

 

I only intended to change citizens outfits, that's enough work ?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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