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.

Is it possible to...

Make a script where every step the character takes he gives up 1 hp? Can someone make me one like that. Also, let me be able to disable it. It sounds like an easy concept, but I don't know how to script. Please move this if it needs to be. Also, how do I implement the script into my game? All help appreciated.
 
First of all, wrong section..
This should be in the Script Requests, or maybe even RGSS/RGSS2 Support since this is such a simple edit.

Anyways,  so you want to make it so lets say, switch[1] is on, the character loose 1 hp every step?
Do you want the whole party to loose hp or just the leader?

Here is the script you need:
Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party.
#==============================================================================
class Game_Party
  alias loose_hp_every_step increase_steps
  def increase_steps
    loose_hp_every_step
    #This switch turns the "loose hp every step" ON
    if $game_switches[1] == true
    $game_party.actors[0].hp -= 1
    $game_party.actors[1].hp -= 1
    $game_party.actors[2].hp -= 1
    $game_party.actors[3].hp -= 1
   end
  end
end

This will make it so whenever switch number 1 is on, the whole party will loose 1 hp every step they take.
You can change the switch by changing the number in:

Code:
if $game_switches[1] == true

If you only want the leader to loose hp every step you take, just remove theese lines:
Code:
    $game_party.actors[1].hp -= 1
    $game_party.actors[2].hp -= 1
    $game_party.actors[3].hp -= 1

To insert the script, press F11 to open up the Script Editor. Then to the left, there is a long list of different scripts.  Go to the script at the bottom(Main) and right click on it, and choose Insert. Now, a new empty section should be available. press on it, then to the right paste the script that i gave you. Press OK and you're done!
 
That doesn't exactly work.I tried taking away the 3 lines to make just the leader take damage, and then I turn on switch 1. After that when I take a step an error occurs and crashes the game.
 
That's wierd.. :shock:
This is how it should be if you only want only the leader to take damage:
Code:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party.
#==============================================================================
class Game_Party
  alias loose_hp_every_step increase_steps
  def increase_steps
    loose_hp_every_step
    #This switch turns the "loose hp every step" ON
    if $game_switches[1] == true
    $game_party.actors[0].hp -= 1
   end
  end
end

This works just fine for me, may i ask what the error message said?
 
A joke? no, that's the only reason i can come up with. Since i have the legal version of rpg maker xp, and the script i have made doesn't work for you AND you can't play my demo.

If you also have the legal version, sry for accusing you but it does seem a little bit suspicious..  :shock:

Edit:
but I also looked at the pic of the event thing in your sig and your rpgm looks different

You mean my event steal system?
Yeah, When i took those pictures my windows "theme" was windows classic, like it was on windows 95,98 so it looks a little bit off.  but if you look at the first picture you can see that it looks normal.
 
No I have the 30 day trial....but anyway, I guess it won't work. Thanks for all of your help, though! Something must just be wrong with my rpgm. Thanks anyway though.

So much for my survival game lol...
 
No I have the 30 day trial....but anyway, I guess it won't work. Thanks for all of your help, though! Something must just be wrong with my rpgm. Thanks anyway though. :lol:

So much for my survival game lol...
 
No I have the 30 day trial....but anyway, I guess it won't work. Thanks for all of your help, though! Something must just be wrong with my rpgm. Thanks anyway though.

So much for my survival game lol...
 

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