• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Difficulty System - The Easy Way

Level 9
Joined
Jun 1, 2008
Messages
180
Hey there!
This is a short tutorial I've just set together. It's about adding a difficulty system to your map. I think it's a really easy way to do it and to modify it later on, as it is based on simple spells.
Here we go:

  • Difficulty System
    • Events
      • Player - Player 1 (Red) types a chat message containing -easy as An exact match
      • Player - Player 1 (Red) types a chat message containing -normal as An exact match
      • Player - Player 1 (Red) types a chat message containing -hard as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Matched chat string) Equal to -easy
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
            • Loop - Actions
              • Unit - Remove Attack (HARD) from (Picked unit)
              • Unit - Remove Attack (NORMAL) from (Picked unit)
              • Unit - Remove Max HP (HARD) from (Picked unit)
              • Unit - Remove Max HP (NORMAL) from (Picked unit)
              • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected easy mode.)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Matched chat string) Equal to -normal
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
                • Loop - Actions
                  • Unit - Add Attack (NORMAL) to (Picked unit)
                  • Unit - Add Max HP (NORMAL) to (Picked unit)
                  • Unit - Remove Attack (HARD) from (Picked unit)
                  • Unit - Remove Max HP (HARD) from (Picked unit)
                  • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected normal mode.)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Matched chat string) Equal to -hard
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
                    • Loop - Actions
                      • Unit - Add Attack (HARD) to (Picked unit)
                      • Unit - Add Max HP (HARD) to (Picked unit)
                      • Unit - Remove Attack (NORMAL) from (Picked unit)
                      • Unit - Remove Max HP (NORMAL) from (Picked unit)
                      • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected hardl mode.)
                • Else - Actions
This is the whole trigger for your difficulty system. I'll start witch the description of the previously mentioned spells.
You must go to the object editor and start watching through the spells in special/items (well, this is what I think is best for this). You'll find different spells here, like extra attack, extra HP, some regeneration, defense - these are the basic skills that you should include in your difficulty system. Just create new spells using these, but don't forget to set them to unit abilities, instead of item ones. You could even created special abilities for different modes, like an evasion for hard mode, or even damage reduction!
After creating your abilities (it's a good idea to give them names like X - HARD or X - NORMAL, so you know which ones you should add to which mode), it's time for the trigger.

  • Events
    • Player - Player 1 (Red) types a chat message containing -easy as An exact match
    • Player - Player 1 (Red) types a chat message containing -normal as An exact match
    • Player - Player 1 (Red) types a chat message containing -hard as An exact match
The event is really simple, for my trigger, I used a player event, an entered chat message will decide which mode we want. Of course, it's up to you to come up with different ways, you could start it with a dialog buttong click, or even a specific ability that's been created to set the difficulty.
In my trigger, there is no need for a condition, as I've added them in my if-then-else actions. If you are working with 3 triggers for the 3 (or more of course) different modes, then it's best to leave out the if-then-else part and add the condition to where it belongs.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Matched chat string) Equal to -easy
    • Then - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Remove Attack (HARD) from (Picked unit)
          • Unit - Remove Attack (NORMAL) from (Picked unit)
          • Unit - Remove Max HP (HARD) from (Picked unit)
          • Unit - Remove Max HP (NORMAL) from (Picked unit)
Coming to actions, you will notice that for each mode, you need to remove and re-add the abilities you wish to have. The reason for this is following: if I have set the difficulty to hard, but want to set it back to normal, it has to remove the abilities that were added in normal mode. Otherwise, it would all stay as it is. This is only needed if you want to allow the players to set the difficulties whenever and as many times as they want it to be. If you turn off the trigger at the end, then you can skip the "remove ability" part.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Matched chat string) Equal to -easy
    • Then - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Remove Attack (HARD) from (Picked unit)
          • Unit - Remove Attack (NORMAL) from (Picked unit)
          • Unit - Remove Max HP (HARD) from (Picked unit)
          • Unit - Remove Max HP (NORMAL) from (Picked unit)
          • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected easy mode.)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Matched chat string) Equal to -normal
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
You can see how I've set the if-then-else actions, once you're done with the first mode's setting, the next mode will continue inside the first one, using the "then - actions" function. This is my version, but you can also create seperate if-then-else actions to make it even easier for you (if you do that, just leave the "then - actions" as they are, or select the "do nothing" function.

  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
      • Loop - Actions
Redmarine told me that the unit group part should be done like this, I can't really comment this, as I don't really know how these custom scripts work (yet), but he's more experienced, so let's all trust him hehe!

At the end, you can add some fancy stuff to your trigger, like I did with the text message. This is just a simple example for it.
If you want to make your mode even more "visible", you can create 3 spells for the 3 modes (or more, jeez...) based on auras. This means, the monsters must have the spells as buffs. The buff they have will have the name and the description of the mode (this way, if you select an enemy and have your mouse on the buff that it has, you will see which mode you are playing). You could even include a special effect, but that would be rather disturbing in a crowd. Note: do not forget to turn every value in the ability to 0, if you don't want your enemies to have those extra points the aura would basically offer!

Please note that this is just an example, I simply wanted to help people get into the right way if they happened to want to create a difficulty system for their maps. I'm also sorry if there was a tutorial like this before. I know that for the experienced people this might be really simple (well, it is, but why would we make it too complicated if we don't have to?), but I hope I could help some people new to triggering.

In this map I've included the spells that you could see in the triggers, and an aura I've been talking about as well!
Now it also contains an example for the dialog version, as it was requested.
 

Attachments

  • Difficulty System - The Easy Way.w3x
    15.5 KB · Views: 484
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
Remember to destroy the unit group leaks.

Create an action called Custom Script and paste this line in it:
set bj_wantDestroyGroup = true

This should be implemented just before the group trigger like this:
Custom Script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)

Make sure that you do that to every unit group action.
 
Level 9
Joined
Jun 1, 2008
Messages
180
Remember to destroy the unit group leaks.

Create an action called Custom Script and paste this line in it:
set bj_wantDestroyGroup = true

This should be implemented just before the group trigger like this:
Custom Script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)

Make sure that you do that to every unit group action.

Woah, I have no idea what custom scripts are, bah... Is this actually a variable? Is there a custom script to randomize the "random number betwee X and Y" number?!! ;o
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Woah, I have no idea what custom scripts are, bah... Is this actually a variable? Is there a custom script to randomize the "random number betwee X and Y" number?!! ;o

Add this custom script before your group actions to destroy the group leak:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
      • Loop - Actions
Here is the GUI code to randomize a real number between 0 and 1000.00
  • Set RandomReal = (Random real number between 0.00 and 1000.00)
This can also be done using integers.
 
Level 9
Joined
Jun 1, 2008
Messages
180
Add this custom script before your group actions to destroy the group leak:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
      • Loop - Actions
Here is the GUI code to randomize a real number between 0 and 1000.00
  • Set RandomReal = (Random real number between 0.00 and 1000.00)
This can also be done using integers.

Yea right, but when I did this, it acted like REALLY strange. I mean, I tested a map several times, and when I was using random numbers, the first random number was (let's call it) X, second was Y, third was Z. When I tested it the second time, it gave me the exact same numbers. And the same happened in the other tests.

Ok, I'll add that to the tutorial. Thanks.
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Yea right, but when I did this, it acted like REALLY strange. I mean, I tested a map several times, and when I was using random numbers, the first random number was (let's call it) X, second was Y, third was Z. When I tested it the second time, it gave me the exact same numbers. And the same happened in the other tests.

Ok, I'll add that to the tutorial. Thanks.

That is because you have to reset the variable each time you want another random number. If you don't want to store the value then just randomize within the action.

An Example:
  • Unit - Create 1 Footman for Player 1 (Red) at ((Center of (Playable map area)) offset by ((Random real number between 0.00 and 1.00), 0.00)) facing Default building facing degrees
 
Level 9
Joined
Jun 1, 2008
Messages
180
That is because you have to reset the variable each time you want another random number. If you don't want to store the value then just randomize within the action.

An Example:
  • Unit - Create 1 Footman for Player 1 (Red) at ((Center of (Playable map area)) offset by ((Random real number between 0.00 and 1.00), 0.00)) facing Default building facing degrees

And that's how I did it - I randomized it again and again - and it worked in the same game.
But when I restarted the map, it gave me the same numbers.
Example:
Game A
number 1: 5
number 2: 10
number 3: 1

Game B
number 1: 5
number 2: 10
number 3: 1

Game C
number 1: 5
number 2: 10
number 3: 1

So the problem was not in the same game, but in several games. It gave me the same random number EVERY time I launched the game. And that is pretty weird...
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
And that's how I did it - I randomized it again and again - and it worked in the same game.
But when I restarted the map, it gave me the same numbers.
Example:
Game A
number 1: 5
number 2: 10
number 3: 1

Game B
number 1: 5
number 2: 10
number 3: 1

Game C
number 1: 5
number 2: 10
number 3: 1

So the problem was not in the same game, but in several games. It gave me the same random number EVERY time I launched the game. And that is pretty weird...

That only happens when you're testing the map using the World Editor's test feature. Try starting the game manually.
 
Level 31
Joined
May 3, 2008
Messages
3,155
You are using more trigger call than you need it for.

The right way to code it should be like this (Exclude the group leak).

  • Difficulty System
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -easy
        • Then - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
            • Loop - Actions
              • Unit - Remove Attack (HARD) from (Picked unit)
              • Unit - Remove Attack (NORMAL) from (Picked unit)
              • Unit - Remove Max HP (HARD) from (Picked unit)
              • Unit - Remove Max HP (NORMAL) from (Picked unit)
              • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected easy mode.)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to -normal
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
                • Loop - Actions
                  • Unit - Add Attack (NORMAL) to (Picked unit)
                  • Unit - Add Max HP (NORMAL) to (Picked unit)
                  • Unit - Remove Attack (HARD) from (Picked unit)
                  • Unit - Remove Max HP (HARD) from (Picked unit)
                  • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected normal mode.)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Entered chat string) Equal to -hard
                • Then - Actions
                  • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 2 (Blue)) and do (Actions)
                    • Loop - Actions
                      • Unit - Add Attack (HARD) to (Picked unit)
                      • Unit - Add Max HP (HARD) to (Picked unit)
                      • Unit - Remove Attack (NORMAL) from (Picked unit)
                      • Unit - Remove Max HP (NORMAL) from (Picked unit)
                      • Game - Display to (All players) for 10.00 seconds the text: ((Name of (Triggering player)) + has selected hard mode.)
                • Else - Actions
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Septimus, his is case insensitive, yours is not. Thus yours does not function the same as his.

Anyway, this is hardly a difficulty selection method. Firstly it always works for some reason with Player(0) Red, which seems stupid as there is nothing special about him that the other players cant be. Secondly it only is influenced by one player.

Eithor make it a multiple player voting system, or else make it that it asks the game host.

An example of a propper difficulty selection system is seen in my Green Circle TD, for choosing difficulty. It asks with labled dialogs, is efficent and reasonably accurate (boundaries untested).
 
Level 9
Joined
Jun 1, 2008
Messages
180
Septimus, his is case insensitive, yours is not. Thus yours does not function the same as his.

Anyway, this is hardly a difficulty selection method. Firstly it always works for some reason with Player(0) Red, which seems stupid as there is nothing special about him that the other players cant be. Secondly it only is influenced by one player.

Eithor make it a multiple player voting system, or else make it that it asks the game host.

An example of a propper difficulty selection system is seen in my Green Circle TD, for choosing difficulty. It asks with labled dialogs, is efficent and reasonably accurate (boundaries untested).

In the example map I've included a dialog version. Check it out if you're interested at least a bit...
And I'm not sure that "host" can select the modes, as this stuff is about players. What if the host decides to move down to blue, teal, purple? How will I decide which one the host is?
That's why red can decide - in most of the cases, the host gets the red slot and remains there if he doesn't want to switch for some reason. I don't know about any method that can make the game decide which one the host is... There most possibly is one, I'm simply a newbie. But the system works and is great for newcomers like me - they were my targeted audience.
 
Level 31
Joined
May 3, 2008
Messages
3,155
Septimus, his is case insensitive, yours is not. Thus yours does not function the same as his.

At least it use lesser call. :p

In the example map I've included a dialog version. Check it out if you're interested at least a bit...
And I'm not sure that "host" can select the modes, as this stuff is about players. What if the host decides to move down to blue, teal, purple? How will I decide which one the host is?
That's why red can decide - in most of the cases, the host gets the red slot and remains there if he doesn't want to switch for some reason. I don't know about any method that can make the game decide which one the host is... There most possibly is one, I'm simply a newbie. But the system works and is great for newcomers like me - they were my targeted audience.

There is a system to detect who is the host. So no matter which side it choose, it would automatically select the same host.
 
Level 3
Joined
May 3, 2009
Messages
37
Re-uploaded the map with the requested changes.
Thanks for the reputation, redmarine! (although I have no idea what it's good for)

You'll Know soon enuff.

Just fix the leaks and it will be alll fine. :D. I usually save leak fixing till the end of a map. So you can have all the fun while brainstorming. Remember, leak fixing can boost your map performance by alot .
 
Level 10
Joined
Jan 28, 2009
Messages
442
And that's how I did it - I randomized it again and again - and it worked in the same game.
But when I restarted the map, it gave me the same numbers.

I experience the same frequently... with the random numbers not being random, you know. But I know that it still works.
Thing is: Have you ever wondered why every time you place a Paladin or any other melee hero, it has the exact same name
every time you test the map. That's because all maps use the same random seed every time they are launched from the World Editor.
Try and run it by opening the game and playing it in Custom Game. Change the user away from WorldEdit just to be sure.
I'm not sure how it works exactly.

The unitGroup thing. It's true. Remember to do "custom script: set bj_wantDestroyGroup = true"... (it's JASS) OR set a unitgroup
variable to the unitgroup you want to use (call it TempGroup or something similar), and then afterwards do "custom script: call DestroyGroup(udg_TempGroup)".

You have to remove points, unit groups, player groups, special effects, regions, etc. if they are dynamically created through your triggers.
As a rule of thumb, use a temporary variable, and destroy it afterwards. It will not destroy the object, but its handle, thus releasing more
memory by preventing memory leaks, and thus improving your map's speed and decreasing risks of program crashes and such.

Read the tutorials about memory leaks if you don't know anything about this. It's important. If you allready knew this, sorry.
I was quite surprised the first time I ever heard about memory leaks. But they are in fact one of the most common problems you get when
programming in almost any object-oriented language. Though, my pa claims he's never experienced a single memory leak in his hobby/work
programs. I think there are languages in which you don't or very rarely get leaks.

Integers, reals, and booleans don't leak. Strings may leak at a microscopic level, I've heard.

Yea, but you'd have to add the upgrades to the monsters in the object editor... Which could mean a lot of work if there were a lot of creeps or/and a lot of upgrades.

Think about the system first. Make at least one template creep with necesary upgrades and such to CnP and base each creep type on.
And the easiest difficulty system I know is to use a trigger to set Handicap for all creeps, and add some to the primary attribute(s) of the hero(es). Why not? It's so easy.
 
Level 9
Joined
Jun 1, 2008
Messages
180
Well instead of changing the max hp, can't you just play with the handicaps?

The best thing to do would be playing with the handicap and using my idea together. For example, you could use a 150% handicap combined with a 30% evasion and 30% attack speed increase for a medium difficulty, and 200% handicap combined with a 60% evasion and 60% attack speed increase for a hard difficulty. Don't forget that these extra things are applied to the monsters, I'm not stupid. ><
 
Level 9
Joined
Jun 1, 2008
Messages
180
Ok I'm a little confused how to make the trigger run again like do I say add Event to Trigger every X seconds run this trigger? Cause if that's true then he has to type -easy, -normal or hard all the time lol.

Not really. You could create a variable. Call it let's say... "Difficulty". It could be a string or integer variable. When the host types -easy, then the variable (Difficulty) should be set to "easy" (if your variable is a string variable), or "1" (if it's an integer variable). This is one trigger.
The next trigger does the actual thing, you should simply do it like on the first post (include the help we got from other members), but there has to be no event, and the requirements in the "IF" parts should be all about your little variable. For example: if "Difficulty" equals to "easy", then do..., else do...
Whenever the host types the command to set the difficulty, you should make it run the actual trigger at the end. So, AFTER setting the variable, you must add "Run Trigger: XY" (whatever you called your trigger that adds the abilities and such).

I know it got a little bit confusing, but yea... Hope it helps. If it doesn't, tell me what's not clear and I'll find an easier way to tell you.
 
Level 9
Joined
Jun 1, 2008
Messages
180
I think I get what you mean but just incase, throw in some triggers that I should be using, so I don't screw up anywhere.

Here you go:

First one is the chat message, setting the difficulty.
  • chat message
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -easy
        • Then - Actions
          • Set Difficulty = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to -medium
            • Then - Actions
              • Set Difficulty = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Entered chat string) Equal to -hard
                • Then - Actions
                  • Set Difficulty = 3
                • Else - Actions
      • Trigger - Run add abilities <gen> (checking conditions)
Second one is the trigger that I called "add abilities" - which applies the selected difficulty.
  • add abilities
    • Events
    • Conditions
    • Actions
      • Player - Set Neutral Hostile handicap to ((Real(Difficulty)) x 100.00)%
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Unit - Remove Damage (Easy) from (Picked unit)
          • Unit - Remove Damage (Medium) from (Picked unit)
          • Unit - Remove Damage (Hard) from (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Difficulty Equal to 1
            • Then - Actions
              • Unit - Add Damage (Easy) to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Difficulty Equal to 2
                • Then - Actions
                  • Unit - Add Damage (Medium) to (Picked unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Difficulty Equal to 3
                    • Then - Actions
                      • Unit - Add Damage (Hard) to (Picked unit)
                    • Else - Actions
      • Custom script: bj_wantDestroyGroup=true
And the third one - in your case - is the monster spawn. This is a very basic setup, just to show you an example.
  • spawn
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 10 Footman for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
      • Trigger - Run add abilities <gen> (checking conditions)
Triggers: chat message, add abilities, spawn
Variables: Difficulty (integer - but it could also be real type)

Hope this helps.
 
Level 11
Joined
May 11, 2008
Messages
830
Yeap makes sense now thanks +rep also one tiny problem.

  • Difficulty Given
    • Events
    • Conditions
    • Actions
      • Player - Set Player 12 (Brown) handicap to (Real((Difficulty x 100)))%
      • Custom script: bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Difficulty Equal to 1
            • Then - Actions
              • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Difficulty Equal to 2
                • Then - Actions
                  • Unit - Add Attack (NORMAL) to (Picked unit)
                  • Unit - Add Max HP (NORMAL) to (Picked unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Difficulty Equal to 3
                    • Then - Actions
                      • Unit - Add Attack (HARD) to (Picked unit)
                      • Unit - Add Max HP (HARD) to (Picked unit)
                    • Else - Actions
                      • Do nothing
I got a error from this one saying Expected 'set' on call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(11)), function Trig_Difficulty_Given_Func003A )
 
Last edited:
Level 9
Joined
Jun 1, 2008
Messages
180
Yeap makes sense now thanks +rep also one tiny problem.

  • Difficulty Given
    • Events
    • Conditions
    • Actions
      • Player - Set Player 12 (Brown) handicap to (Real((Difficulty x 100)))%
      • Custom script: bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Difficulty Equal to 1
            • Then - Actions
              • Do nothing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Difficulty Equal to 2
                • Then - Actions
                  • Unit - Add Attack (NORMAL) to (Picked unit)
                  • Unit - Add Max HP (NORMAL) to (Picked unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Difficulty Equal to 3
                    • Then - Actions
                      • Unit - Add Attack (HARD) to (Picked unit)
                      • Unit - Add Max HP (HARD) to (Picked unit)
                    • Else - Actions
                      • Do nothing
I got a error from this one saying Expected 'set' on call ForGroupBJ( GetUnitsInRectOfPlayer(GetPlayableMapRect(), Player(11)), function Trig_Difficulty_Given_Func003A )

Yea sorry, I forgot the 'set ' word from the beginning. :D
 
Level 6
Joined
Feb 12, 2008
Messages
207
That only happens when you're testing the map using the World Editor's test feature. Try starting the game manually.

Why not to try by going to "File > Preferences..." and then just going to the "Test Map" tab and unchecking the "Use Fixed Random Seed" from the options? Then you shouldn't get the same randoms all the time :grin:
 
Level 13
Joined
Oct 1, 2009
Messages
592
But I've got a problem, i have a map with spawn system and i did like your dialog version, and i take the same things that hunaxelnl showed. But it doesn't work, for example: when I do "create 1 footman at center of blablabla" and then the " Run X trigger (checking conditons)" it doesn't work. But I did another thing different from yours, Instead of taking "add ability to blablabla" I set the abilities to the units default abilities and instead took "remove ability from blablabla" and that worked too with the units were already placed at the map but not for the ones who was spawned. Plz help me with my problem and i rep+
 
Last edited:
Level 9
Joined
Jun 1, 2008
Messages
180
But I've got a problem, i have a map with spawn system and i did like your dialog version, and i take the same things that hunaxelnl showed. But it doesn't work, for example: when I do "create 1 footman at center of blablabla" and then the " Run X trigger (checking conditons)" it doesn't work. But I did another thing different from yours, Instead of taking "add ability to blablabla" I set the abilities to the units default abilities and instead took "remove ability from blablabla" and that worked too with the units were already placed at the map but not for the ones who was spawned. Plz help me with my problem and i rep+

Sorry for the late reply, do you still need help?
 
Top