Jump to content

Papyrus Script Help +1


Recommended Posts

Ok, So basically what I am trying to accomplish, Is that I want every time an effect is triggered, it will add +1 to a global Value. When dispelling the magic effect, it will -1. My mod is set up to allow you to recruit Minutemen. Basically I want it to work as you recruit each Minutemen, You add +1, and set a maximum level so you can only have a certain amount of Minutemen with you at any time.

 

Here's what I have so far for each effect, Now If I put in -1, it works just fine. If I put in say "1-2-3-4" just a number for set value, it works just fine. But there is no way to do +1, So what is the proper format or function to add +1 to the global variable ?

Event OnEffectStart(Actor akTarget, Actor akCastor)
akTarget.setplayerTeammate(true)
akTarget.SetCommandState(true)
akTarget.setcandocommand(true)
akTarget.AddKeyword(DontUseAmmo)
SoldiersRecruited.SetValue(+1)
EndEvent

 


Event OnEffectStart(Actor akTarget, Actor akCastor)
akTarget.setplayerTeammate(false)
akTarget.SetCommandState(false)
akTarget.setcandocommand(false)
akTarget.RemoveKeyword(DontUseAmmo)
SoldiersBuilt.SetValue(-1)
EndEvent

 

Link to comment
Share on other sites

Yes! You are my hero :smile: haha ty -1 for some reason will work with: SoldiersBuilt.SetValue(-1) but the +1 wouldn't work. Just woke up to your message and you just saved me some time so tyvm!

It's likely that the SetValue(-1) is setting it to absolute "-1" not subtracting 1.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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