[Ace] Difficulty Script v5.0 **UPDATED****NEW**

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
I have been wanting to write a difficulty script for a long time now. With the help of Dekita it has finally happened. While it is extremely simple right now, I do plan on having some more features. I just don't know what to add really.
 
I will post the script here as it's very short, but if I end up do adding stuff, and it gets too long it will be put on pastebin, or something like that.

 
Here is the script:

#=============================================================================##Script By: Bloodmorphed#Difficulty Script v3.5##Change Log:#v5.0# This is a decently big change. This version completely enables full#customization. There is no longer set in stone rules, if you want higher then#4 difficulties all you have to do is add them! I have also enabled you to use#more then 4 battlers for difficulties. You just have to change it where it#is needed.#It's Located in Script: Game_Party (Line 72) Change the return 4 to whatever.## Now a little bit how it works now.#    Param_Settings = { #don't touch#     Corresponding Params:#               MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK#      :easy => [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],#      :normal => [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],#      :hard => [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],#      :insane => [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],#      } #don't touch# This is the old way I have it, it will stay the same... unless you want to#change it. You can even change the name of them, for example :easy could be#renamed to :normal### Here is an example:#    Param_Settings = { #don't touch#     Corresponding Params:#               MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK#      :normal => [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],#      :medium => [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],#      :hard => [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],#      :insane => [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],#      :impossible = > [6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0],#      } #don't touch## See how I changed the name of two, AND created another one? Yup that works.#Now, while this will work seamlessly for using the Party, very easily, you#have to know what the variable you will be corrisponds to what.##```NOTICE````NOTICE!!!!!!#If you change ANYTHING on one thing, you MUST change it on everything! #(otherwise you will either get errors, or weird changes)#If you re-name :easy in one thing, you must re-name it in all things. if you also#make a new difficulty, such as :impossible above, you MUST make it every where else, as well.#Everything must have the same order as well! If it is:#:normal :medium :hard in one category it must be the same for every category.#For example you cant have it like this :medium :normal :hard in one category and the other way in another!### Let's say this is our Enemy settings, which is set to 99 variable by default.## When this is set to 0 it pulls from :normal# 1 = :medium# 2 = :hard# See, easy, right? So be sure to if you do this by events and not party to#use the right setting you want to!###v4.0#Condensed the script down some (reduced some line lengths.)#Added an option to use the party size for the difficulty.##v3.6#Removed the "+1" from gold and XP to avoid confusion and so that if you put#0 in the database for XP or Gold it will be 0 rather then 1.##v3.5#Added TP Settings. CAUTION: Try not to set them higher then 5! It will get#broken past that! Based on actor getting hit only!###v3.0#I've added Actor params, and you can now disable Actor edits, and Enemy edits.#Putting these both to false will disable the script, if needed.## Note:#   You can use this script as you please, as long as you give credit! This#   script was made possible by massive help from Dekita.##=============================================================================##=============================================================================## Param_Settings is each param that will be modified. You may edit these as# you please. Keep in mind I have added something that will NEVER make these# reach 0.## Exp_Settings is the experience gained based on difficulty, normally people# use higher Experience the lower the difficulty, but this your choice!## Gold_Settings increases or decreases gold gain. Again most peopel would give# more gold the lower the difficulty, but again, it is your choice!## Keep in mind everything is MULTIPLIED! Not ADDED. To go lower, use 0.9 and# lower. For example## gold * 0.5 will be HALF of what it used to be.#=============================================================================#module Blood  #-----------------------------------------------------------------------------  #Putting these both to false will disable the script, if you ever need to.  #If you are going to use Use_Party, Use_Enemy must also be true!  #  #Note: If you use party for difficulty you do not need to setup a event!  #-----------------------------------------------------------------------------  Use_Enemy = true         #Use enemy edits? Default is true  Use_Actor = false        #Use actor edits? Default is false  Use_Party = false        #Use Party? Default is false  module Enemy    Param_Settings = { #don't touch      # Corresponding Params:      #        MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK      :easy => [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],      :normal => [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],      :hard => [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],      :insane => [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],      } #don't touch    Exp_Settings = { #don't touch      :easy => 2,               :normal => 1,             :hard => 0.8,      :insane => 0.5,    } #don't touch    Gold_Settings = { #don't touch    :easy => 2,    :normal => 1,    :hard => 0.8,    :insane => 0.5,    } #don't touch  end #ends Enemy  module Actor#=============================================================================## Param_Settings is each param that will be modified. You may edit these as# you please. Keep in mind I have added something that will NEVER make these# reach 0.## This part people usually go higher the easier difficulty, lower the higher.#=============================================================================#    Param_Settings = { #don't touch      # Corresponding Params:      #        MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK      :easy => [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],      :normal => [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],      :hard => [0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8],      :insane => [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5],      } #don't touch         #=========================================================================      # TP Settings scales QUICKLY, do not go over 5, if you do it gets pretty      # broken. I didn't test this exstensively but it works well. This only      # effects the CHARGE of TP (Getting hit)      #      # easy default = 2      # normal default = 1      # hard default = 0.8      # insane default = 0.5      #=========================================================================    TP_Settings = { #don't touch      :easy => 2,      :normal => 1,      :hard => 0.8,      :insane => 0.5,      } #don't touch  end #ends Actor  #============================================================================#  # Variable to use. This variable will be used for the difficulty setting  #============================================================================#  module Variable    Enemy_Variable = 99  # Which to use for enemy/party. Default is 99    Actor_Variable = 100 # Which to use for actor. Default 100  end #ends variableend #ends Blood#==============================================================================## Do not edit anything past this point, unless you know what you are doing# edit at your own risk, just know that if you have no idea what you are doing,# you could break it.#==============================================================================#if Blood::Use_Party == true#===============================================================================  class Scene_Map < Scene_Base#===============================================================================  alias bloody_update update      #-------------------------------------------------------------------------      #Updates our party difficulty      #-------------------------------------------------------------------------      def update        bloody_update        update_difficulty      end #ends update      #-------------------------------------------------------------------------      #Increases, or decreses the Enemy_Variable based on party members      #-------------------------------------------------------------------------    def update_difficulty      @old_size = 0 if @old_size.nil?        if @old_size != $game_party.battle_members.size          $game_variables[Blood::Variable::Enemy_Variable] =            [$game_party.battle_members.size - 1,$game_party.max_battle_members].min          @old_size = $game_party.battle_members.size        end #ends if    end #ends update_difficulty  end #ends classend #ends if Use_Partyif Blood::Use_Enemy == true#===============================================================================  class Game_Enemy#===============================================================================  #-----------------------------------------------------------------------------  # List Of Aliased Methods  #-----------------------------------------------------------------------------  alias :bloody_param :param  #-----------------------------------------------------------------------------  # Method to determine value of enemies params based on difficulty.  #-----------------------------------------------------------------------------    def param(param_id)      eps = Blood::Enemy::param_Settings      diff = eps.keys[$game_variables[Blood::Variable::Enemy_Variable]]      return (bloody_param(param_id) * eps[diff][param_id] + 1).to_i    end #ends def  #--------------------------------------------------------------------------  # * Get Experience  #--------------------------------------------------------------------------    alias :blood_exp :exp    def exp      ees = Blood::Enemy::Exp_Settings      diff = ees.keys[$game_variables[Blood::Variable::Enemy_Variable]]      return (blood_exp * ees[diff]).to_i    end #end def  #--------------------------------------------------------------------------  # * Get Gold  #--------------------------------------------------------------------------    alias :blood_gold :gold    def gold      egs = Blood::Enemy::Gold_Settings      diff = egs.keys[$game_variables[Blood::Variable::Enemy_Variable]]      return (blood_gold * egs[diff]).to_i    end #ends def  end #ends classend #ends ifif Blood::Use_Actor == true#===============================================================================  class Game_Actor#===============================================================================  #-----------------------------------------------------------------------------  # List Of Aliased Methods  #-----------------------------------------------------------------------------  alias :bloody_param :param  #-----------------------------------------------------------------------------  # Method to determine value of actors params based on difficulty.  #-----------------------------------------------------------------------------    def param(param_id)      aps = Blood::Actor::param_Settings      diff = aps.keys[$game_variables[Blood::Variable::Actor_Variable]]      return (bloody_param(param_id) * aps[diff][param_id] + 1).to_i    end #ends def     #    # TP Regen    #    def charge_tp_by_damage(damage_rate)      calc = self.tp += 50 * damage_rate * tcr      ats = Blood::Actor::TP_Settings      diff = ats.keys[$game_variables[Blood::Variable::Actor_Variable]]      return (calc * ats[diff]).to_i    end #ends def  end #ends classend #ends if
You need an event like this, before your game starts.

 
Features:-Full Customization

-You can now use your battle members for difficulty, now also able to change the max easily (even past 4!)

-Individual editing of each parameter.

-Experience editing.

-Gold Editing.

-Actor Param edits

-Enabaling and disabling the use of Actor, and Enemy edits. Putting both to false will disable the script, if needed.

-Added TP Settings (This is based on the actor getting hit, not the actor hitting!)

Future Features:

I'm not too sure what else to put in here. If you have suggestions please let me know. I'm new to scripting and scripting something this simple is a BIG help, you have no idea.

 
Credit:
Bloodmorphed for writing it.
Dekita for his major guidance in the process.
 
Use it as you please, with credits of course.

I'm going to add this:

I would like to thank Dekita and others for their support and help through this, they have been patient with me! You guys are awesome!
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
Update v2.0!

Now there is no longer just a straight multiplication, you can choose each parameter to multiply by. For example you can multiple MAx HP by 2, but multiply max MP by 1.5. ETC ETC.

There is now an Experience edit.

There is now an Gold edit.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,498
Reaction score
12,779
First Language
English
Primarily Uses
RMVXA
Did you want to borrow my idea of also letting people affect JP earned based on difficulty? If so, go ahead.
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
I'll have to do that later, as my game won't be using JP, I'd have to test it in a different project, but I will keep it in mind. Thank you.
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
Update v3.0!

I have added Actor edits, with this edit I have made it possible to enable, or disable the Actor edits, or the Enemy edits. disabling both will disable the script, if needed.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,600
Reaction score
2,359
First Language
French
Primarily Uses
interesting script dear vampire : D 

it is interesting to see how you work the script !

also for the .to_i I advise you to change it for something less Power_grudge I only know the to_s method how to change but 

for increase the eficacity of you script!

but if you want you can keep this I don't think the to_i will lag the game

also it will be cool for have the change of how many item you get by the dificulty!
 
Last edited by a moderator:

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
All to_i is make it into a whole number instead of a decimal... 
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
UPDATE 3.5!

This update brings the TP Settings!

This setting goes off the actor getting hit (Charge of the TP, not regeneration). I would like to Caution anyone that uses this setting to NOT go over 5, as past that the rate TP charges is broken. If you actually need an extremely fast charge, then so be it :p
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
You could have made a max TP setting too, if you already meddle with TP. :p


But that is not why I am here.


Did you test what happens when you set your actors' HP/MP to a lower value for a difficulty and select that difficulty at the start?


It will exceed the max limit.


Did you find any way to solve this? I am trying, but no luck so far. >.>
 

EternalShadow

Veteran
Veteran
Joined
Sep 16, 2012
Messages
5,805
Reaction score
1,049
First Language
English
Primarily Uses
A suggestion, if possible: additional possible item drops from enemies based on dfficulty level?
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
You could have made a max TP setting too, if you already meddle with TP. :p

But that is not why I am here.

Did you test what happens when you set your actors' HP/MP to a lower value for a difficulty and select that difficulty at the start?

It will exceed the max limit.

Did you find any way to solve this? I am trying, but no luck so far. >.>
I've never actually tested the Actor stuff. I knew it would work for the most part, but at the start of the game, make sure nothing is in the party, at all. Then after the difficulty is picked, put your main character in the party. This should fix your problem

A suggestion, if possible: additional possible item drops from enemies based on dfficulty level?
I plan on doing this and enemy actions based on difficulty, but these scripts will be later, and each script will be separate, but can also be add-ons to this.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
I am using a different script for difficulty.


That one did not come with actor stat changes, but after I saw your script, I was kinda tempted to make that option in that script too. :D


My problem is not that simple to fix, because I want to allow difficulty change during the game itself too. I already made an option for it in my 'Game Settings' scene.


Well, I guess I could just not change the HP/MP values, and modify the rest of the stats only if I can't find a solution for this.


But that will kill the meaning of 'Impossible' in my difficulty settings, because that difficulty would make all HP max values to exactly 1 for all enemies and for actors too (bosses excluded). >.>


Ohh, well, I will get back to this once I finish the stuffs I started.
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
I am using a different script for difficulty.

That one did not come with actor stat changes, but after I saw your script, I was kinda tempted to make that option in that script too. :D

My problem is not that simple to fix, because I want to allow difficulty change during the game itself too. I already made an option for it in my 'Game Settings' scene.

Well, I guess I could just not change the HP/MP values, and modify the rest of the stats only if I can't find a solution for this.

But that will kill the meaning of 'Impossible' in my difficulty settings, because that difficulty would make all HP max values to exactly 1 for all enemies and for actors too (bosses excluded). >.>

Ohh, well, I will get back to this once I finish the stuffs I started.
Hm, doing the calculations on this shouldn't be too hard. In the script (or common event) you can have it do HP - MHP then subtract the difference from HP. That should work in theory, lol.
 

Lunawyn

Villager
Member
Joined
Oct 24, 2014
Messages
8
Reaction score
0
First Language
German
Primarily Uses
Cool script! :D

My only problem is when I kill a monster and won the battle an error message pops up:

Script 'Game_Troop' line 191: TypeError occurred.

nil can't be coerced into Fixnum


I want most enemies to NOT drop any gold. I've tried a few things to get rid of it but nothing worked so far (didn't really edit anything big in any script as I don't have any experience with that)
No one seems to have the same problem either so Google was not a very good friend this time ._.
 

Gothic Lolita

YouTube Starlet
Veteran
Joined
Oct 21, 2014
Messages
1,132
Reaction score
197
First Language
German
Primarily Uses
RMMV
Got the same problem like "Lunawyn", tried if it works in a clean RPG project.
If I use the Variable 100 = 0, everything is fine.
But if the Variable 100 = 1 ~ 3, the game crashes with that error message from the spoiler. (\s/)

I know, there are tons of Difficulty scripts here, but your's is the most useful.
Because it add's Gold & Exp too. :) /)
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
A quick scan through the script makes me assume that the error comes from a minor typo.


Find the 'def gold' definition in this script.


See all those 'when' statements? Notice the numbers besides them, something feels wrong, right?


Yeah, a minor typo can screw up the entire game, a bit annoying. :D


Anyway, just change the number orders to be 0, 1, 2 and 3 instead of 0, 2, 3, and 4, and it should work.


I did not test this, but in theory... :p
 

Gothic Lolita

YouTube Starlet
Veteran
Joined
Oct 21, 2014
Messages
1,132
Reaction score
197
First Language
German
Primarily Uses
RMMV
Now it works, thank you. You helped a lot. :D /)
And now I'm really hard blushed, because I fixed such a similar problem in an other script.  :unsure:  (\s/)
 
 

Bloodmorphed

Dungeon Fanatic
Veteran
Joined
Sep 17, 2012
Messages
1,466
Reaction score
143
First Language
English
Primarily Uses
i fixed it in the script inside the thread. not the download. ill probably take out the download link as it serves no purpose anyway.

thank you sixth for helping them in my absense
 

Lunawyn

Villager
Member
Joined
Oct 24, 2014
Messages
8
Reaction score
0
First Language
German
Primarily Uses
Ok it doesn't give me the error anymore, thanks :D

Now I've got the only problem that when I don't want an enemy to drop gold, I set it to 0 in the Enemy section of course, but when I win a battle it still drops 1 gold.

I tried setting it to 0 in the script, too but that didn't work somehow. >_>

Am I doing something wrong? ._.
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
The gold gain is scripted to get at least 1 gold, even if your database got gold set to 0.


Thou, to be honest, that is not necessary there.


It is understandable to put that fail-proof for stats, but for gold and XP, it is not needed, because that prevents the maker to create battles which give 0 XP or 0 gold.


To get rid of it, head over to the 'def gold' definition and remove the +1 at the end of each 'when' statements (just before the ').to_i' part).


Do the same with the 'def exp' definition to enable the ability of getting 0 XP for an enemy, if you want.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I am dead tired but at the same time I really wanna write a tutorial x_x
Looked out side and couldn't see the neighbor's house through the snow. That age old Christmas song started going through my head. "It's a lovely day to say the heck at home."
Last year, I planted a bunch of spinach, and one plant wasn't doing well, so I transferred it to a separate pot. All its kin died while it hibernated over winter. Now it thrives. I've named it Prince Spinach.
Scooby Doo on Zombie Island is anime and you cant change my mind.
I guess the concept of friendship has changed :") Today I saw a very quiet boy getting bullied by his 'friends' because he wasn't talking. They made a circle and made him sit in the middle and were nagging him saying hey talk, sing a song, do this tongue twister etc. etc. And I could totally see the discomfort in the boy's face. Glad I don't have 'friends' lmao

Forum statistics

Threads
93,371
Messages
911,733
Members
122,863
Latest member
muhlijem
Top