RPG Maker Forums

I am using todd's Difficulty Selection script, contained in this post (not a separate download) http://forums.rpgmakerweb.com/index.php?/topic/2789-difficulty-selection/?p=99001

I see from a post that Todd has now more or less retired from scripting, which leaves a problem I posted about unresolved, and so am wondering if anyone else can help.

When you select a difficulty other than 'Normal' the script multiplies all enemy stats, Exp gained and gold dropped by a percentage.  The problem is that this means that the player is told they have just gained e.g. 28.5899952 exp and 30.5 gold.

I would like to be able to show this as rounded figures.  deilin also spotted this and proposed the following:

since you are multiplying decimals, you are getting decimals in outcomes. You need to add some .to_i if possible.

class Game_Enemy < Game_Battler #-------------------------------------------------------------------------- # * Get Base Value of Parameter #-------------------------------------------------------------------------- def param_base(param_id) case $difficulty when 0 (enemy.params[param_id] * TODDDIFFICULTY::EASYM).to_i when 1 enemy.params[param_id] when 2 (enemy.params[param_id] * TODDDIFFICULTY::HEROICM).to_i when 3 enemy.params[param_id] * TODDDIFFICULTY::HARDM else enemy.params[param_id] end endendor in the other case:

#--------------------------------------------------------------------------113. # * Get Base Value of Parameter114. #--------------------------------------------------------------------------115. alias todd_difficulty_gmen_param_base param_base116. def param_base(param_id, *args)117. n1 = todd_difficulty_gmen_param_base(param_id, *args)118. n2 = case $game_system.todd_difficulty119. when 0 then TODDDIFFICULTY::EASYM120. when 1 then 1121. when 2 then TODDDIFFICULTY::HEROICM122. when 3 then TODDDIFFICULTY::HARDM123. end124. return (n1 * n2).to_i125.endI think the first part of the suggestion is for the earlier version of the script, as mine lacks that section entirely, and I have tried altering what he suggests for line 124, but it still returns large decimals.

Does anyone have any idea how this might be fixed?

Thanks

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,447
Members
137,820
Latest member
georg09byron
Top