HiveMaster Posted May 21, 2016 Posted May 21, 2016 So I guess my biggest question, just to lead off, would be: Is editing a vanilla quest's Papyrus script fragment as much of a faux pas as editing a full vanilla script? To elaborate. The mod I'm working on adds a faction to all investable merchants in the game. When said merchants are invested in, I need their rank in that new faction to go from 0 to 1. I can make this work perfectly if I alter the merchant's script fragment in their particular entry in the Player Directory of the PerkInvestor quest. But that seems like a no-no, so I've experimented with a child script. So using Balimund (my most frequent guinea pig for this mod) as an example, his papyrus fragment is: Quote ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 1Scriptname TIF__000AD3C2 Extends TopicInfo Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as Actor;BEGIN CODEPerkInvestorBalimundGV.Value=0(GetOwningQuest() as PerkInvestorQuestScript).GoldTransfer(AKSpeaker);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentglobalvariable Property PerkInvestorBalimundGV Auto So I then attach a new script to the TopicInfo for that same dialogue option that runs: Quote Scriptname HMInv1 extends TIF__000AD3C2Function Fragment_0(ObjectReference akSpeakerRef)Actor akSpeaker = akSpeakerRef as ActorPerkInvestorBalimundGV.Value=0HMVendor1.SetFactionRank(HMFaction, 1)HMVendor2.SetFactionRank(HMFaction, 1)(GetOwningQuest() as PerkInvestorQuestScript).GoldTransfer(AKSpeaker)EndFunctionActor Property HMVendor1 Auto Actor Property HMVendor2 Auto Faction Property HMFaction Auto So of course I set the value for 'PerkInvestorBalimundGV' to the same value as the vanilla script fragment. HMFaction is set to the new faction in question, HMVendor1 is Balimund and HMVendor2 is Asbjorn, since I want the effect to continue working even if Balimund is killed and Asbjorn takes his place. But then I go in and test it out, and while the basic functions of Investing still work, Balimund's rank in the new faction doesn't change. So I figure I'm missing something pretty fundamental about Papyrus Fragments, or Child scripts, or probably more likely, BOTH. If anyone can tell me what terribly obvious mistake(s) I'm making here, I would indeed be much obliged!
lofgren Posted May 21, 2016 Posted May 21, 2016 There's nothing wrong with editing vanilla scripts or fragments. You're editing these in the fragment window in the creation kit, right? Reason I ask is that you have included the entire script here, not just the fragment, and there is no reason you should have to open the script.
simtam Posted May 21, 2016 Posted May 21, 2016 I don't suppose script fragments work like events, which you can have handled by multiple scripts attached to the record the event is fired on - look up in "Advanced" tab of script fragment in Creation Kit for the name. You can edit it. Is it faux pas to edit vanilla fragment script name? Perhaps it is.
lofgren Posted May 21, 2016 Posted May 21, 2016 If you change the name then it will not overwrite the older script in game data. Basically it will be a new script.
HiveMaster Posted May 21, 2016 Author Posted May 21, 2016 On 5/21/2016 at 7:48 PM, lofgren said: If you change the name then it will not overwrite the older script in game data. Basically it will be a new script.Wow...that works perfectly! Thank you! To answer your previous question, I am just adding the two lines in the fragment window without opening the script. I just included the whole thing for the sake of completeness. Of course I've got to add and define the Faction and Actor properties in the properties window, but still not opening the script itself. So yes, thanks again! I guess this won't necessarily be compatible with another mod that alters the Investing mechanic in a similar way, but that's got to be a pretty tiny category. Sweet!
Recommended Posts