• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How to make a Difficulty Selector in a Map

Level 19
Joined
Aug 1, 2022
Messages
240
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