How to make a Difficulty Selector in a Map

Level 19
Joined
Aug 1, 2022
Messages
239
Ok, so I’ve been studying the Dialogue Box Selector (Choices), and I want to implement a Difficulty Selector in my Warcraft 3 maps, similar to how Tunro does it.


My question is: how do I make the chosen difficulty actually affect the game through triggers? For example, if a player chooses Hard, how do I ensure the game is set to Hard?


Also, will this automatically apply to my JassCraft AI code, or do I need to adjust that separately?
 

So you can adjust the Easy, Medium, Hard, and Insane difficulties at runtime. After doing that you can run a different AI Script depending on the Difficulty, or maybe just reference some Variables in your existing AI script (I don't know how AI scripts work exactly, can you reference a Trigger Editor-variable inside of them?).

Anyway, I attached a map with a simple example of some basic AI that will have advantages depending on the difficulty.

In my example the Difficulty_Chosen integer variable will represent the Difficulty you've chosen. 0 = Easy, 1 = Medium, 2 = Hard, 3 = Insane. So you could reference this in your Triggers and possibly even your AI scripts. It's wise to use this Integer in combination with Array variables, which you can see me doing with the Gold, Lumber, and Handicap variables. That'll keep things organized and efficient.
 

Attachments

Last edited:
Back
Top