BeowulfMKII Posted August 2, 2016 Posted August 2, 2016 I want to make some NPCs gain more better outfits as time passes (in order to simulate some progress), and add a condition that checks if they are being used as followers, is so, the script doesn't run. So far i have: Scriptname UpdateOutfit Extends Actor Event OnInit() RegisterForUpdate(7200) EndEvent Event OnUpdate() NPCHere.SetOutfit(NPCOutfit) endEVENT Outfit Property NPCOutfit Auto What i want to achieve: A script that applies the effect to any actor that it is attached to, and updates it's outfit without i needing to add the actor/outfit property in the script. Any help is greatly appreciated.
Guest Posted August 2, 2016 Posted August 2, 2016 Really not good idea to add a script to all actors. Couple of advises/answers: If you don't want to put a property, you can get the Outfit from a line like: Outfit of = Game.GetForm(12345) as Outfit ; Where 12345 is the id of the outfit In your script "NPCHere" can be changed to Self. But then you have to attach this script to all Actors of Skyrim. Really a bad idea. Use a vector of outfits. Then scan the actors around the player, if they have an outfit in your vector, replace it with the next one.
BeowulfMKII Posted August 2, 2016 Author Posted August 2, 2016 Really not good idea to add a script to all actors. Couple of advises/answers: If you don't want to put a property, you can get the Outfit from a line like: Outfit of = Game.GetForm(12345) as Outfit ; Where 12345 is the id of the outfit In your script "NPCHere" can be changed to Self. But then you have to attach this script to all Actors of Skyrim. Really a bad idea. Use a vector of outfits. Then scan the actors around the player, if they have an outfit in your vector, replace it with the next one. Not all actors. In the moment there's only 4. Any way to make they update their current outfit instead of getting a new one? Their outfits all contain leveled lists, so when the script fires they get equipment that matches their level.
Guest Posted August 2, 2016 Posted August 2, 2016 Then just remove the outfit, and then re-equip it. The actor should update it from the leveled list.
thor Posted August 3, 2016 Posted August 3, 2016 The leveled lists are updated automatically by the game when the actor is re-loaded. You don't need a script for that. But, if you put a script with an OnUpdate event on the actor, the actor will stay in memory until the update is stopped. So it will never re_load and will not update the leveled outfit. if you still want to make a script, use OnPlayerLoadgame on a player alias in a quest. Build a formlist with the actors you want to update and cycle through the list. You can use : (MyFormlist.GetAt(index) as Actor).SetOutfit((MyFormlist.GetAt(index) as Actor).GetBaseActor().GetOutfit()) to refresh the outfit
Recommended Posts
Archived
This topic is now archived and is closed to further replies.