A script to learn: Difficulty System

One reason for making it a separate feature / separate script is because :

It is no longer a parameter script, it is an enemy AI script. 😉
I think if it is just for yourself and for practice, a separate script would not be needed. But if you want to share it with others, from what I've seen so far, most like it being a separate script just so they can pick and choose the scripts they want in the game.
Even if it's just for yourself, you should practice writing modular code.


People say "I'll do it when the time comes" but when the time comes they just do whatever they're comfortable with.
Even if it's just for yourself, you should practice writing modular code.

People say "I'll do it when the time comes" but when the time comes they just do whatever they're comfortable with.
Good point. But even still I don't have a lot of time on my hands, you know... one month challenge and all. But it won't be for me. When I start doing more complicated scripts then they may be just for me, but simple stuff like this, no real reason to keep it for myself.
I agree with what Tsukihime said. It'll also make editing your script later MUCH easier if things are modular
Good point. But even still I don't have a lot of time on my hands, you know... one month challenge and all. But it won't be for me. When I start doing more complicated scripts then they may be just for me, but simple stuff like this, no real reason to keep it for myself.
That is exactly the reason why a lot of people decide to write code that may not be very manage-able.


"I've got a deadline in 72 hours, I don't have time to think about how to write it in a very good way!"


And then they just throw something together that works...


And you feel sorry for the next guy that has to take over.
"I've got a deadline in 72 hours, I don't have time to think about how to write it in a very good way!"

And then they just throw something together that works...
^ This.

Even people who should know better can fall into this trap.

I have always written my code in seperate script pages. Like, if I modify one class, that will go into a seperate page from all other classes that my script modifies. I do it this way on purpose, but during the IGMC I knew I was on a short time frame and didnt always stick to this rule. I now regret that as I'm trying to work my way through tidying up and optimizing the coding.

One should find a style of writing code that they like and stick to it. It will make alot of things much easier when you are looking back through your old codes.
The difference is, I won't be using these scripts in the game I'm making. I also don't know how to do it yet, lol.

Lol, I am so lost!

module BLOOD  module VARIABLE    # AI_Variable will be going by the variable you want. It's default is 100    # if you are wanting to use Difficulty Settings with this make sure they are    # the same!    AI_Variable = 100  end #end variable   module DIFFICULTY    Easy = 0    Normal = 1    Hard = 2    Insane = 3  end #end difficulty   module ENEMY    Enemy_AI = /<?😀IFFICULTY|difficulty:[ ],  >/i
I'm trying to figure out how to use notetags, now Enemy_AI = /<?😀IFFICULTY|difficulty:[ ],  >/i that line is obviously it, but I'm lost on how to keep it like this:

<easy: 1, Always, 5>

so:

<difficulty: skill#, condition, rating>

Original thread: https://forums.rpgmakerweb.com/threads/a-script-to-learn-difficulty-system.31227/