Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Item that reduces max SP

I'm new at RMXP. Is there an easy way to make it so that whenever a character equips a certain accessory, her max SP will be either be reduced to one fifth, or to twice her current level (whichever is higher). I tried a simple (ha ha) script using a "while" and "until" loop, but I don't think I know how to use $game_actors correctly. Also, I think this can be done just using events--although I'm not adverse to scripting.

Any ideas?
 
Note that this is theoretical.  I did not test this, but this should be easily done with events.  We'll need a common event that collects the variables necessary and the sp multiplier of the item:

Code:
#These are our major variables
control variables [character 1 sp] == char1 sp

#Here's our fraction
control variables [numerator] == 1
control variables [denominator] == 5

now we will need a conditional branch for the action to occur:
Code:
conditional branch: [char1] is [sp draining item] equipped
#here we make our fraction dividing our numerator into our denominator
control variables [numerator] /= [denominator]

#Now we multiply our char sp by our new number
control variables [character 1 sp] *= [numerator]

#now we change the parameter by subtracting from the character's sp with our new variable
change parameters: [char1], [MaxSP] - variable [character 1 sp]

That's a good start for you.  You will likely need to have a good else statement that restores your character back to normal else the reduction will be permanent.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top