Exoclyps Posted March 25, 2015 Share Posted March 25, 2015 So I started messing with a mod that replaces a few NPC's outfits to give a better theme to the faction. However one of the NPC's joins the faction after a quest is finished and thus changing their clothes beforehand is something I'd like to avoid. I googled around and figured it'd be possible to have an NPC change outfit with a quest, but I have no idea how this is done as I've yet to do anything quest/script related besides modding some property names in scripts. So my question is, how would I do so that the game checks for a certain quest to be done and then have the NPC of choice change outfit?Thanks in advance Link to comment Share on other sites More sharing options...
dangman4ever Posted March 25, 2015 Share Posted March 25, 2015 Look at the quest for Boone. 4 Link to comment Share on other sites More sharing options...
ArronDominion Posted March 25, 2015 Share Posted March 25, 2015 (edited) Here is what I envision as the steps you need for doing this: First: Find the quest you want to check for being finished (I.E. DLC1MQ01)Second: In your script have the quest as a Quest PropertyThird: Have your outfit as an Outfit PropertyFourth: Have your NPC as an Actor Propety (might not need if you attach the script to the NPC)Fifth: Decide on an attachment point for your script. I personally think your NPC will be the appropriate place for the script based on the current information, although there are other ways to do it. Here is an implementation I see, going to run with DLC1MQ01 as the example (forgive me if that is not the exact name of that quest): Scriptname EXOCNpcOutfitChangeAfterQuestScript extends Actor ;The quest we are listening for Quest Property DLC1MQ01 Auto ;The faction outfit you want to give Outfit Property EXOCNpcFactionOutfit Auto ;The Actor NPC you are giving the outfit to Actor Property EXOCNpcToAdd Auto Event OnInit() ;Register for an update event game time for every 2 min in-game ;A lot faster than waiting for real-time updates RegisterForSingleUpdateGameTime(0.03) EndEvent Event OnUpdateGameTime() ;Check to see if the quest is done via quest stages ;Have no idea in this example if this is the right stage number...just approximating if (DLC1MQ01.GetStage >= 60) ;Set our NPC outfit EXOCNpcToAdd.SetOutfit(EXOCNpcFactionOutfit) ;In all other cases Else RegisterForSingleUpdateGameTime(0.03) EndIf EndEvent Note: It will change their outfit immediately once that quest is finished. So if you wanted to do this through NPC dialogue, you will need to call akSpeaker.SetOutfit(YourOutfit) in the End script fragment. Hope this helps out. Edited March 25, 2015 by Arron Dominion Link to comment Share on other sites More sharing options...
Exoclyps Posted March 27, 2015 Author Share Posted March 27, 2015 Thank you for your reply! Will check this out. If I got this right, this script runs at start, automatically, then every 2 minutes check if the quest have been done?While I appreciate this, I wonder if there is no way to say, edit said quest instead to run the script once it reached the last stage? Never been a fan of rotating scripts to be honest. Link to comment Share on other sites More sharing options...
Mattiewagg Posted March 28, 2015 Share Posted March 28, 2015 Look at the quest for Boone. 4This is for Skyrim. ;) Link to comment Share on other sites More sharing options...
Ceruulean Posted March 28, 2015 Share Posted March 28, 2015 Maybe you can check out the blades recruitment quest, FreeformSkyhavenTemple or something like that. Link to comment Share on other sites More sharing options...
ArronDominion Posted March 28, 2015 Share Posted March 28, 2015 Thank you for your reply! Will check this out. If I got this right, this script runs at start, automatically, then every 2 minutes check if the quest have been done?While I appreciate this, I wonder if there is no way to say, edit said quest instead to run the script once it reached the last stage? Never been a fan of rotating scripts to be honest. To clarify it will run every 2 in-game minutes, and in real time much less. It is definitely possible to change the outfit after a particular quest stage. Here are the steps for doing this (Note you will probably want to edit so you can reuse the script or reduce on properties): 1) Make sure you have a ReferenceAlias to your NPC2) In your quest, there will be a Scripts tab.3) Create a quest script with a ReferenceAlias property to your NPC and Outfit property to your outfit4)Write a function that looks something like this: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Inputs: None ; ;The purpose of this function is to set the NPC's outfit when the appropriate quest stage is called ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function SetFactionOutfit() EXOCNpcToAddRef.GetActorRef().SetOutfit(EXOCNpcFactionOutfit) EndFunction 5) In your quest stage, set kmyQuest to this script. If you have another script in use for kmyQuest, you will want to remove your new script and add the changes to that script6) Call the following in the quest stage script block: kmyQuest.SetFactionOutfit() That should be it for the basics, but again you probably want to redo for your mod's needs. Link to comment Share on other sites More sharing options...
Exoclyps Posted March 28, 2015 Author Share Posted March 28, 2015 Thank you very much! Will try this out! Link to comment Share on other sites More sharing options...
Deleted39115125User Posted March 31, 2017 Share Posted March 31, 2017 (edited) I'm trying to achieve the same effect in a script, I've attempted the first example resolution:Scriptname EXOCNpcOutfitChangeAfterQuestScript extends Actor ;The quest we are listening for Quest Property DLC1MQ01 Auto ;The faction outfit you want to give Outfit Property EXOCNpcFactionOutfit Auto ;The Actor NPC you are giving the outfit to Actor Property EXOCNpcToAdd Auto Event OnInit() ;Register for an update event game time for every 2 min in-game ;A lot faster than waiting for real-time updates RegisterForSingleUpdateGameTime(0.03) EndEvent Event OnUpdateGameTime() ;Check to see if the quest is done via quest stages ;Have no idea in this example if this is the right stage number...just approximating if (DLC1MQ01.GetStage >= 60) ;Set our NPC outfit EXOCNpcToAdd.SetOutfit(EXOCNpcFactionOutfit) ;In all other cases Else RegisterForSingleUpdateGameTime(0.03) EndIf EndEventWhen attached to the NPC it simply gives errors on compilation: Starting 1 compile threads for 1 files...Compiling "CW_VignarClothes"...C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CW_VignarClothes.psc(18,18): GetStage is not a property on script quest or one of its parentsC:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CW_VignarClothes.psc(18,27): cannot compare a none to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\CW_VignarClothes.psc(18,27): cannot relatively compare variables to None No output generated for CW_VignarClothes, compilation failed.Basically I can't get around that. I've also tried to sneak into an vanilla script to make the changes, all to no effect at all... I'm pretty confused because the way scripts work in this engine are quite illogical... It's a "can't do this can't do that" feast...I'm also confused towards the second example... What on earth is that supposed to mean?HALP PLOX! Edited April 1, 2017 by Guest Link to comment Share on other sites More sharing options...
Recommended Posts