How to amplify floor damage?

Status
Not open for further replies.

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
Pretty much the title. I want floors to do roughly the same amount of damage, regardless of level.
How would I do this?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
That's what it does already. By default, the floor does 10 HP damage, regardless of your level, DEF, MDF, etc. The only way it is affected is by the FDR stat.
 

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
That's what it does already. By default, the floor does 10 HP damage, regardless of your level, DEF, MDF, etc. The only way it is affected is by the FDR stat.
Is there no way to make it do damage based on a percentage?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Not without a script. I don't know of any right now that do this, though I doubt it would be too hard to implement.
 
Last edited by a moderator:

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
Not without a script. I don't know of any right now that do this, though I doubt it would be too hard to implement.
Okay, thank you. That's all I needed to know.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
NP. If you are curious, this script snippet should do it for you (untested, but should work as far as I can tell). Note this will overwrite anything else that computes the floor damage, so put it at the bottom of all of your scripts (but still about Main)


Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end



Change 0.01 to whatever percentage of max HP you want floor damage to do.
 
Last edited by a moderator:

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
NP. If you are curious, this script snippet should do it for you (untested, but should work as far as I can tell). Note this will overwrite anything else that computes the floor damage, so put it at the bottom of all of your scripts (but still about Main)



Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end



Change 0.01 to whatever percentage of max HP you want floor damage to do.
Beautiful.
Greatly appreciated, bgillisp. Thanks.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Just let me know if it causes any problems. I'm home with a cold so there might be a silly error I made. Otherwise, if it works well, let us know and we can close this topic for you.
 

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
Just let me know if it causes any problems. I'm home with a cold so there might be a silly error I made. Otherwise, if it works well, let us know and we can close this topic for you.
This is what I get.

Edit:
Line 9, I added what it was expecting and it works.
Thank you!


Screenshot_191.png
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
That's because I made the dumbest mistake ever and left out one word. Try this one (which is also tested, and worked in a blank project for me):

Code:
class Game_Actor < Game_Battler
                         
    def execute_floor_damage
    	damage = (self.mhp * 0.01 * fdr).to_i
    	self.hp -= [damage, max_floor_damage].min
    	perform_map_damage_effect if damage > 0
  	end
  
end
 

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
That's because I made the dumbest mistake ever and left out one word. Try this one (which is also tested, and worked in a blank project for me):



class Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.01 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

end
It also works with this:
 


Game_Actor < Game_Battler

def execute_floor_damage
damage = (self.mhp * 0.80 * fdr).to_i
self.hp -= [damage, max_floor_damage].min
perform_map_damage_effect if damage > 0
end

$end


What does class do differently?
(I added '$end' because the error told me that's what it was expecting on line 9... I'm not sure if that's a good thing or bad thing, lol. I know nothing about scripting.
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I'm kind a novice, but I think if you do it with the $end it might not work as we except? I'd use the original with the word class so that it is associated with the Actor like it should be, and therefore it should work with other scripts you might wish to use.
 

PhoenixX92

The Light Bearer
Veteran
Joined
Jun 28, 2015
Messages
219
Reaction score
95
First Language
English
Primarily Uses
RMMV
I'm kind a novice, but I think if you do it with the $end it might not work as we except? I'd use the original with the word class so that it is associated with the Actor like it should be, and therefore it should work with other scripts you might wish to use.
Okay, I'll use yours just to be safe, then.
Tested with all my scripts and it works.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Great. I'll close out this thread then.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top