Jump to content

Recommended Posts

Posted

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 1
Scriptname TIF__000AD3C2 Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
PerkInvestorBalimundGV.Value=0
(GetOwningQuest() as PerkInvestorQuestScript).GoldTransfer(AKSpeaker)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

globalvariable 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__000AD3C2

Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
PerkInvestorBalimundGV.Value=0
HMVendor1.SetFactionRank(HMFaction, 1)
HMVendor2.SetFactionRank(HMFaction, 1)
(GetOwningQuest() as PerkInvestorQuestScript).GoldTransfer(AKSpeaker)
EndFunction

Actor 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!

Posted

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.

Posted

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.

Posted
  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!

  • Recently Browsing   0 members

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