Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
Hey guys so you know when you are far in a game and your party is all beefed up with super high defense and armor and such and you decide to wonder off to an earlier stage of the game. These foes are far weaker than you and every attack they land does absolutely no damage. How do I set it up so that weak attacks will do at least 1 damage? Thank you :) .

-JAD
 

Hollow

(◡‿◡✿)
Veteran
Joined
Jul 14, 2012
Messages
519
Reaction score
442
First Language
English
Primarily Uses
RMMV
Just add "+ 1" to the end of your damage formula. :)
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,887
First Language
English
Primarily Uses
RMVXA
Adding 1 to your damage formula won't work since the total result could still be negative.  You could add a "max" function to each damage skill in the game, and that would get closer, but things like Guarding could still reduce the damage to zero.  So we'll need to do some super-basic scripting.

Go to the make_damage_value method in Game_Battler.

Right before this line:

@result.make_damage(value.to_i, item)Add this:

if value > 0.0value = [value, 1.0].maxendAnd that should do it.
 
Last edited by a moderator:

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
@wavelength

I'm getting a syntax error:

unexpected tIDENTIFIER, expecting key_word then or ';' or '\n'
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,533
Reaction score
16,419
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


That code shouldn't cause that error, so maybe you've keyed it in wrong.


Can you copy/paste that method so we can see what you've done?
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
Here is where I put the script:

syntax.png
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,887
First Language
English
Primarily Uses
RMVXA
It appears like you typed it in correctly, but I just pasted it in to a mostly clean project myself, and can't reproduce the error you're getting.  The fact that it's asking for a "then", semicolon, or new line makes me think that you somehow entered an incorrect line break.

  • Comment out those lines (add a # sign at the beginning of each line) and try again.  If the bug still happens, my code is not what is causing the error.  If the bug disappears, these new lines have somehow caused this error.  Remember to restore the lines by removing the # sign before proceeding...
  • Try deleting and manually re-typing it.  Preferably, do the same with the lines above and below, too.  If that doesn't work, delete it and paste it directly from what I entered above.
  • Check to make sure you don't have any other scripts that alias or overwrite this method.
  • Play around and see if it always happens or only under certain conditions (like an attack where the damage would be increased to 1), and let me know when it does and doesn't happen.
Anyone have any other ideas?  This is definitely a strange error.
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

That code shouldn't cause that error, so maybe you've keyed it in wrong.

Can you copy/paste that method so we can see what you've done?
Lmao im sorry Shaz! I'm so bad at posting in the right forum section!
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
It appears like you typed it in correctly, but I just pasted it in to a mostly clean project myself, and can't reproduce the error you're getting.  The fact that it's asking for a "then", semicolon, or new line makes me think that you somehow entered an incorrect line break.

  • Comment out those lines (add a # sign at the beginning of each line) and try again.  If the bug still happens, my code is not what is causing the error.  If the bug disappears, these new lines have somehow caused this error.  Remember to restore the lines by removing the # sign before proceeding...
  • Try deleting and manually re-typing it.  Preferably, do the same with the lines above and below, too.  If that doesn't work, delete it and paste it directly from what I entered above.
  • Check to make sure you don't have any other scripts that alias or overwrite this method.
  • Play around and see if it always happens or only under certain conditions (like an attack where the damage would be increased to 1), and let me know when it does and doesn't happen.
Anyone have any other ideas?  This is definitely a strange error.
ok so I commented out the lines, then deleted them. The error went away however the damage from a weak attack still does 0 damage.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,887
First Language
English
Primarily Uses
RMVXA
ok so I commented out the lines, then deleted them. The error went away however the damage from a weak attack still does 0 damage.
Okay, so now you know that those lines were the offenders.  But you still don't know why (and the fact that the code worked for me means that it's probably something that had to do with the input, or a script incompatability, or a specific situation).  Try all of the other things I suggested, and see what happens...
 

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
Okay, so now you know that those lines were the offenders.  But you still don't know why (and the fact that the code worked for me means that it's probably something that had to do with the input, or a script incompatability, or a specific situation).  Try all of the other things I suggested, and see what happens...
yeah so I did the other things on the list and nothings working for me. The damage still does 0. Thanks though :)
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,114
Reaction score
5,887
First Language
English
Primarily Uses
RMVXA
yeah so I did the other things on the list and nothings working for me. The damage still does 0. Thanks though :)
You have to restore the lines (un-comment them) before doing anything else.

If you DID restore them before the other things on the list, and tried my script snippet in a clean project, and are still getting 0 damage, then I'm out of ideas on how to help you, sorry :(
 
Last edited by a moderator:

Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
193
First Language
English
Primarily Uses
RMMV
You have to restore the lines (un-comment them) before doing anything else.

If you DID restore them before the other things on the list, and tried my script snippet in a clean project, and are still getting 0 damage, then I'm out of ideas on how to help you, sorry :(
Yeah I removed the hashtags but it didnt work still. But hey I really appreciate the help and effort :)  
 

Latest Threads

Latest Profile Posts

Oh error that I cannot pin point and that does not consistently occur. You have caused me to start from... the beginning.
gCcZIwO.gif

Expressions! Curse GIFs color limitation.
Collecting Stream thumbnails, don't mind me. :kaopride:



now you can smash up cars on the street lol...
finally got the right prompt for stable diffusion
1679983618086.png

Forum statistics

Threads
129,901
Messages
1,206,108
Members
171,084
Latest member
ondik55
Top