• 🏆 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!

[Spell] Very Basic Trigger Error

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2011
Messages
27
Clean map, nothing else but this on it.
Create 1 Mountain King unit each for Player 1, 2 and 6.

Why, oh God why would this return "2 2 2" in the chat?

  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to (Random player from (All enemies of (Owner of (Casting unit))))
            • Then - Actions
              • Game - Display to (All players) the text: 1
            • Else - Actions
              • Game - Display to (All players) the text: 2
Edit: Added Map
 

Attachments

  • Error.w3x
    16.4 KB · Views: 44
Level 3
Joined
Jul 27, 2011
Messages
27
First of all, it displays three sets of strings because there are 3 units, not players :p

And the problem is that it should display "1 1 2" since both Player 2 and 6 are enemies.
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
First of all, it displays three sets of strings because there are 3 units, not players :p

Yeah, I read it wrongly.
Anyway, two things. The player slots for blue and orange are empty, therefore they are not enemies but empty slots.
Secondly you are picking a random player, thus if the randomed player is not the owner of the picked unit it will return 2 anyway.
 
Level 3
Joined
Jul 27, 2011
Messages
27
a simple Boolean Comparisson, which checks if player is an enemy or not.
  • ((Owner of (Picked unit)) is an enemy of (Owner of (Triggering unit))) Equals True

Ah yeah, thanks guys! Been a while since I've mapped.
 
Status
Not open for further replies.
Top