Lunawolfcomics

The Omega
Veteran
Joined
Feb 18, 2014
Messages
662
Reaction score
192
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,859
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
192
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
44,647
Reaction score
15,738
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
192
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,859
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
192
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
192
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,859
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
192
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,859
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
192
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 Posts

Latest Profile Posts

Marketing seems to be about reducing dependence on luck to sell a product, as well as expanding the number of avenues in which luck can play a role in selling a product.
So, I've been wanting to do this randomized logic puzzle in my game for years now. I finally figured out how to do it by using arrays and a few small script calls. It's based on the Einstein Fish Puzzle! :D Though, I have no idea how to actually have the player put in answers.... might start a thread about it.

The projectiles shown in this video are as follows:
1, Basic Triple
2, 30-Degree Arc
3, Randomized Blast Wave
4, 8-way
5, 8-way Double
6, 8-way Slowness
7, 120-Degree Arc Repetitive
8, Projective Triple
9, Split 8-way
10, 2-way Split Randomized Arc
11, HP-MP Split Arc
12, Split Laser
13, Shock
14, Cosine
Drop shadows and water reflections tests in RPG Maker VX Ace


BgI3F80.png
I'm doing a fairy tale project Little Red Riding Hood and the Woodsman. I'm almost done with the demo in my native language and I intend to make a demo version in English as well. I'm just going to use the translator because I don't know the pronunciations very well, I only know how to say "Hey" and nothing else.. :kaoswt2:

Forum statistics

Threads
118,622
Messages
1,117,406
Members
155,706
Latest member
gaoumaru
Top