Jump to content

Making a perk/ability that increases amount of crafted item?


Recommended Posts

Solved! Here's what I did:

 

I created a new perk called "xx_DummyXPDisabler" and a new global variable called "xx_DummyXPDisablerEnabled".

The perk has a "modify skill use" multiplier of 0 with the condition that the global variable has a value of 1.

When the player enters the workbench, I give them the perk and set the global to 1 to disable XP.

Then when it's time to award XP, I'm simply doing this:

xpDisableVar.SetValue(0)                                                 ;make the perk's condition fail
float valMult = 1 + ((akBaseItem.GetGoldValue() as float) - 25)/300      ;calculate xp multiplier depending on gold value
Game.AdvanceSkill(useSkill,xpGain*valMult)                               ;award XP (using variables and properties set earlier)
xpDisableVar.SetValue(1)                                                 ;make the perk's condition apply again

Using the global variable is important. I tried using RemovePerk() and AddPerk() before and after awarding XP, but the game seems to take some time to update whether the player has the perk or not, so then it was possible to spam E and Y to craft items super fast to bypass the perk's effect. With the global variable controlling the perk's condition, spamming no longer bypassed it

Edited by Mornedil
Link to comment
Share on other sites

  • Recently Browsing   0 members

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