Jump to content

Recommended Posts

I have a variation of this thread posted in the LE section, but I really need to understand this sooner rather than later.

 

I am trying to make some active effects (custom perks for the player in this case) vanish after a set amount of time. The perks are given via dialogue, and so far they are applied correctly and they work fine--but even though I tried to use the BladesBlessing ability as a guide to setting this up, they (unlike the BladesBlessing) do not go away after the set amount of time has elapsed.

 

The good news is, the effects don't stack. But I need these perks to vanish so that they can be reapplied when the proper dialogue option is chosen.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I duplicated and modified the following to put these together: BladesAbBlessing (magic effect), BladesBlessingAbility (spell), and MQBladesBlessing (perk).

 

Now, BladesBlessingAbility (spell) has the time set for 5 days. There is a TimeAbilityScript attached to BladesAbBlessing (magic effect), but it does not seem to be working--so I know I must be missing something. The only other thing I can find that seems like it might be linked is the BladesBlessingTimer (global), but it does not seem to be connected to by any script or mentioned directly by any of the Blades entries I mentioned above.

 

I am at a loss as to how to proceed would appreciate any insight. If I am going in the wrong direction and there's a better way to get these perks to vanish after a set amount of time, then please tell me.

 

 

Thank you for reading.

 

 

 

Link to comment
Share on other sites

What you can do is attach a custom script to your quest that the dialogue is on, in the scripts tab, and use that to do the timer. The script would look something like this:

 

Scriptname MyQuestScript extends Quest 

Perk Property akPerk Auto 
Float Property HoursToWait Auto 

Function StartTimer() 
    Game.GetPlayer().AddPerk(akPerk)
    RegisterForSingleUpdateGameTime(HoursToWait)
EndFunction 

Event OnUpdateGameTime()
    Game.GetPlayer().RemovePerk(akPerk) 
EndEvent 

Then in your dialogue fragment you can put:

(Self.GetOwningQuest() as MyQuestScript).StartTimer()

Change the MyQuestScript name in both places and don't forget to fill properties in the CK after attaching your script to the quest.

Link to comment
Share on other sites

What you can do is attach a custom script to your quest that the dialogue is on, in the scripts tab, and use that to do the timer. The script would look something like this:

 

Scriptname MyQuestScript extends Quest 

Perk Property akPerk Auto 
Float Property HoursToWait Auto 

Function StartTimer() 
    Game.GetPlayer().AddPerk(akPerk)
    RegisterForSingleUpdateGameTime(HoursToWait)
EndFunction 

Event OnUpdateGameTime()
    Game.GetPlayer().RemovePerk(akPerk) 
EndEvent 

Then in your dialogue fragment you can put:

(Self.GetOwningQuest() as MyQuestScript).StartTimer()

Change the MyQuestScript name in both places and don't forget to fill properties in the CK after attaching your script to the quest.

 

Thank you for this! I shall test this as soon as possible.

 

I forgot something rather important where duplicated/copied magic effect sector was concerned. I had neglected to change the ability from the script's Properties section over to the new custom one. I fixed that and started a new game to test, but the ability is still not being removed after five days, so I am really hoping that I can put your suggestion to use.

 

I'll respond back when I know how this turns out.

 

 

 

~~~~~~~~~~~~~~~

EDIT:

 

I don't want to screw this up, so l might return all the sooner with some questions. Papyrus and I are still rather shy acquaintances at this point in time, so please bear with me. :sweat:

 

~~~~~~~~~~~~~~~~

EDIT 2:

 

Okay, the new script seems to have turned out fine, but the dialogue fragment bit is not going well. I keep getting the compilation failed warning.

 

The script was named: FTW_Physician_TempPerk

 

This is the part I pasted in:

 

(Self.GetOwningQuest() as FTW_Physician_TempPerk).StartTimer()

 

 

This is the result:

 

Scripts\Source\temp\_FTW_TIF__04000D68.psc(9,23): cannot convert to unknown type ftw_physician_tempperk

Scripts\Source\temp\_FTW_TIF__04000D68.psc(9,23): cannot cast a quest to a ftw_physician_tempperk, types are incompatible

Scripts\Source\temp\_FTW_TIF__04000D68.psc(9,50): ftw_physician_tempperk is not a known user-defined type

 

 

What did I do wrong?

Edited by Lollia
Link to comment
Share on other sites

Does you FTW_Physician_TempPerk script extend Quest and is it on the same quest as your dialogue fragment? Also, if compiling with SSE, you have to make sure the source .psc file is in the correct location. Bethesda changed it in SSE to Data/Source/Scripts where in LE it was Data/Scripts/Source. To keep it simple, I would just copy the source .psc file and make sure it's in both locations.

Link to comment
Share on other sites

Does you FTW_Physician_TempPerk script extend Quest and is it on the same quest as your dialogue fragment? Also, if compiling with SSE, you have to make sure the source .psc file is in the correct location. Bethesda changed it in SSE to Data/Source/Scripts where in LE it was Data/Scripts/Source. To keep it simple, I would just copy the source .psc file and make sure it's in both locations.

 

 

Yes. It is set to extend the Quest and it is on the same quest as the dialogue fragment. I actually am doing this on LE's Creation Kit. I can barely get SSE to run, so I make all of my mods on LE and then convert them over to SSE.

Link to comment
Share on other sites

Huh, strange, it should be working. Make sure you compile the FTW_Physician_TempPerk script first, and also make sure the FTW_Physician_TempPerk.pex is in Data/Scripts and FTW_Physician_TempPerk.psc is in Data/Scripts/Source.

 

 

I really appreciate you taking the time to try and help me. I'm still not having any luck, but I did come up with some other ideas to make the scripting snafus work in the mod's favor.

 

I have attached some extra effects to the dialogue. These effects are also linked to perks, but they are based more alchemy effects rather than the perks found in the vanilla perk trees, which makes it much easier to control their duration. So the way it will be set up is like this:

 

The perk tree-based perks will still be given to the player, but they will be the player's to keep forever once given (unless I finally figure what the issue is and decide to make a separate version of the mod). The secondary effects (the alchemy-based perks) will last for a specific time frame and then be removed until the appropriate dialogue line is run again. I will also condition the dialogue to only appear if none of the secondary effect perks are presently applied to the player. That should keep the player from being overpowered. :thumbsup:

 

I think the interaction that comes from the dialogue trees is what's going to be the main appeal of this mod, but the perks are a nice bonus. The main idea is to make Skyrim's marriage and adoption system have more appeal and to enhance the player's level of interaction with their spouse and adopted children in a very wholesome and lore-friendly way. I think it has a good chance of doing just that, so--scripting snafus notwithstanding--I'm happy with it. :happy:

Edited by Lollia
Link to comment
Share on other sites

As long as you're happy with it, that's what counts :smile: for future reference, I use SSEScript for scripting: https://www.nexusmods.com/skyrimspecialedition/mods/43691 which you can use for main scripts, I'd still use the CK for dialogue and other script fragments.

 

 

I hope you're still around, dylbill. I had an epiphany a few hours ago. My brain was nearly convinced that it had found a solution to getting around the scripting snafu (you see, even when I say I'm content with stuff, I still can't stop thinking about it). Unfortunately, my idea did not pay off. My dastardly idea was this:

 

The permanent perks (custom variants based on the vanilla perk trees) would no longer be permanent--instead, I would condition them to check the player for the presence of certain passive perks (which are small increases to health, stamina and magicka respectively) before affecting the player in their turn.

 

The passive perks are set as abilities (they are based off of and linked to other copies of things like "EnchFortifyStamina" and so forth), but they (unlike their original counterparts) have been ticked so they can have a duration set. For some reason, the duration is not kicking in properly. Both the permanent and passive perks are being applied and doing what they are supposed to do, but the passive perk refuses to ever go away. Using the in-game Wait command and even just playing them game naturally has no effect. The countdown never begins. I even backtracked on my dastardly idea and removed the condition check between the passive and permanent perks, but the result is the same. :wallbash:

 

This is a bad thing because the dialogue is currently conditioned to check for the presence of the passive perks--it can only appear if none of the passives are currently affecting the player. If the countdown was working properly and the passive perk would go away after its time was up, then the dialogue options would unlock once again and the player would gain the chance of receiving a new passive perk. But since the passives are determined to be the exact opposite, I'm in a bit of a bind. :wacko:

Edited by Lollia
Link to comment
Share on other sites

I would still recommend to use a script to add / remove the perk. Try giving it a go again. Try installing the SSEScript that I posted above and using that.

 

Actually I tried compiling the script as FTW_Physician_TempPerk and got an error. The compiler didn't like that name for some reason, so I changed it to FTW_PhysicianTempPerk and it compiled fine. Try that and see if it works. The steps are:

 

1. Compile this script:

Scriptname FTW_PhysicianTempPerk extends Quest

Perk Property akPerk Auto 
Float Property HoursToWait Auto 

Function StartTimer() 
    Game.GetPlayer().AddPerk(akPerk)
    RegisterForSingleUpdateGameTime(HoursToWait)
EndFunction 

Event OnUpdateGameTime()
    Game.GetPlayer().RemovePerk(akPerk) 
EndEvent 

Verify that FTW_PhysicianTempPerk.pex is in Data/Scripts and FTW_PhysicianTempPerk.psc is in Data/Scripts/Source.

 

2. Attach the script to your quest in the creation kit. Fill the properties, click OK to save your quest, then save the ESP.

 

3. Open the quest again and In your dialogue fragment (that's on the same quest) put (Self.GetOwningQuest() as FTW_PhysicianTempPerk).StartTimer()

 

See if that compiles and test it out in game.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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