• 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.

Variable problem

Status
Not open for further replies.
Level 2
Joined
Feb 1, 2014
Messages
19
Hello boys , it's me again

Could anyone please explain me why this triggers dont work?

This is a Calculating of "humanity system" when u kill a zombie to add zombie kills count and humanity value to +500 of the value.

  • pricitani humanity
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set killer = (Killing unit)
      • Set obet = (Dying unit)
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of obet) Equal to zombici[(Integer A)]
            • Then - Actions
              • Set humanita[(Player number of (Owner of killer))] = (humanita[(Player number of (Owner of killer))] + 500.00)
              • Set zabil_zombies[(Player number of (Owner of killer))] = (zabil_zombies[(Player number of (Owner of killer))] + 1)
            • Else - Actions
              • Do nothing
This is trigger which say how much humanity u have when u say "-humanity"

  • zjistit humanitu
    • Events
      • Player - Player 1 (Red) types a chat message containing -humanity as An exact match
      • Player - Player 2 (Blue) types a chat message containing -humanity as An exact match
      • Player - Player 3 (Teal) types a chat message containing -humanity as An exact match
      • Player - Player 4 (Purple) types a chat message containing -humanity as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -humanity as An exact match
      • Player - Player 6 (Orange) types a chat message containing -humanity as An exact match
      • Player - Player 7 (Green) types a chat message containing -humanity as An exact match
      • Player - Player 8 (Pink) types a chat message containing -humanity as An exact match
      • Player - Player 9 (Gray) types a chat message containing -humanity as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -humanity as An exact match
    • Conditions
      • ((Triggering player) controller) Equal to User
    • Actions
      • Player Group - Add (Triggering player) to humanita_skupina
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked player) is in humanita_hrdinove) Equal to True
        • Then - Actions
          • Game - Display to humanita_skupina the text: (YOUR HUMANITY IS + (|c006969FF + ((String(humanita[(Player number of (Picked player))])) + |r)))
          • Player Group - Remove (Picked player) from humanita_skupina
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) is in humanita_banditove) Equal to True
            • Then - Actions
              • Game - Display to humanita_skupina the text: (YOUR HUMANITY IS + (|c00FF0000 + ((String(humanita[(Player number of (Picked player))])) + |r)))
              • Player Group - Remove (Picked player) from humanita_skupina
            • Else - Actions
              • Game - Display to humanita_skupina the text: (YOUR HUMANITY IS + (|c00FFFFFF + ((String(humanita[(Player number of (Picked player))])) + |r)))
              • Player Group - Remove (Picked player) from humanita_skupina
And this is trigger which will say to u how much kills on each type of units u have

  • zjistit humanitu Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing -kills as An exact match
      • Player - Player 2 (Blue) types a chat message containing -kills as An exact match
      • Player - Player 3 (Teal) types a chat message containing -kills as An exact match
      • Player - Player 4 (Purple) types a chat message containing -kills as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -kills as An exact match
      • Player - Player 6 (Orange) types a chat message containing -kills as An exact match
      • Player - Player 7 (Green) types a chat message containing -kills as An exact match
      • Player - Player 8 (Pink) types a chat message containing -kills as An exact match
      • Player - Player 9 (Gray) types a chat message containing -kills as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -kills as An exact match
    • Conditions
      • ((Triggering player) controller) Equal to User
    • Actions
      • Player Group - Add (Triggering player) to zjistit_killy
      • Game - Display to zjistit_killy the text: (BANDIT KILLS : + (String(zabil_bandit[(Player number of (Picked player))])))
      • Game - Display to zjistit_killy the text: (HERO KILLS : + (String(zabil_heroes[(Player number of (Picked player))])))
      • Game - Display to zjistit_killy the text: (SURVIVOR KILLS : + (String(zabil_survivora[(Player number of (Picked player))])))
      • Game - Display to zjistit_killy the text: (ZOMBIE KILLS : + (String(zabil_zombies[(Player number of (Picked player))])))
      • Player Group - Remove (Picked player) from zjistit_killy
But when i try it on test map it seems like the trigger with counting kills and humanity adding dont add it into variable
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
you should specifiy, what exactly is not working.

I am pretty sure, it is because of these nonsense group actions though.

Also, because you use the event response Picked Player, but there is no picked player, it cannot work properly.

I would say, change it to Triggering Player and remove the nonsense group actions and it will work.
Sry if there is any sense behing these group things but I cant see it.
 
Level 3
Joined
Dec 31, 2003
Messages
42
Like Emm-A- said it's quite hard to help when we don't know what the problem is or what you want. Here's some thoughts though:

Trigger 1: This one should work? Anyway, is there any reason why you loop? You could just use "Conditions - Any are true" and move them up to the conditions of the actual trigger. P.S. perhaps you intend to change it in the future but for now humanita is just 500*zabil_zombies
Trigger 2: I don't see why you'd make it so complicated. Just display the text to humanita_banditove or umanita_hrdinove?
Trigger 3: You didnt "Pick every player and ..:" so there is no picked player (I guess you copied)
 
Aquilla nailed it on this one. On the "-humanity" and "-kills" trigger, the index uses the player number of (Picked player), but you don't even have a Player group loop in either triggers. So the text zjistit_killy will see is whatever number is stored in zabil_bandit[0] (i think this would return a 0 if (Picked player) isn't found).

(Picked player) should be changed to (Triggering player). Your first trigger is fine, so just changing this should fix everything else.
 
Level 2
Joined
Feb 1, 2014
Messages
19
  • inicializace mapy
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --- SEZNAM HRDINU --- --------
      • Set hrdinove[1] = Monk
      • Set hrdinove[2] = Scientist
      • Set hrdinove[3] = Soldier
      • Set hrdinove[4] = Villager
      • -------- --- SEZNAM HRACU --- --------
      • Set hraci[1] = Player 1 (Red)
      • Set hraci[2] = Player 2 (Blue)
      • Set hraci[3] = Player 3 (Teal)
      • Set hraci[4] = Player 4 (Purple)
      • Set hraci[5] = Player 5 (Yellow)
      • Set hraci[6] = Player 6 (Orange)
      • Set hraci[7] = Player 7 (Green)
      • Set hraci[8] = Player 8 (Pink)
      • Set hraci[9] = Player 9 (Gray)
      • Set hraci[10] = Player 10 (Light Blue)
      • -------- --- SEZNAM SPAWN POZIC --- --------
      • Set spawn_pozice[1] = spawn1 <gen>
      • Set spawn_pozice[2] = spawn10 <gen>
      • Set spawn_pozice[3] = spawn11 <gen>
      • Set spawn_pozice[4] = spawn12 <gen>
      • Set spawn_pozice[5] = spawn13 <gen>
      • Set spawn_pozice[6] = spawn14 <gen>
      • Set spawn_pozice[7] = spawn15 <gen>
      • Set spawn_pozice[8] = spawn16 <gen>
      • Set spawn_pozice[9] = spawn17 <gen>
      • Set spawn_pozice[10] = spawn18 <gen>
      • Set spawn_pozice[11] = spawn19 <gen>
      • Set spawn_pozice[12] = spawn2 <gen>
      • Set spawn_pozice[13] = spawn20 <gen>
      • Set spawn_pozice[14] = spawn3 <gen>
      • Set spawn_pozice[15] = spawn4 <gen>
      • Set spawn_pozice[16] = spawn5 <gen>
      • Set spawn_pozice[17] = spawn6 <gen>
      • Set spawn_pozice[18] = spawn7 <gen>
      • Set spawn_pozice[19] = spawn8 <gen>
      • Set spawn_pozice[20] = spawn9 <gen>
      • -------- --- SEZNAM ZOMBIKU --- --------
      • Set zombici[1] = Zombie1
      • Set zombici[2] = Zombie2
      • Set zombici[3] = Zombie3
      • Set zombici[4] = Zombie4
      • Set zombici[5] = Zombie5
      • Set zombici[6] = Zombie6
      • Set zombici[7] = Zombie7
      • Set zombici[8] = Zombie8
      • Set zombici[9] = Zombie9
      • -------- --- NASTAVENI POCASI --- --------
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)
      • Set pocasii[1] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Light)
      • Set pocasii[2] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Northrend Snow (Heavy)
      • Set pocasii[3] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • Environment - Create at (Playable map area) the weather effect Dungeon Blue Fog (Heavy)
      • Set pocasii[4] = (Last created weather effect)
      • Environment - Turn (Last created weather effect) Off
      • -------- --- SYSTEM HUMANITY --- --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set humanita[(Player number of (Picked player))] = 10000.00
          • Set zabil_zombies[(Player number of (Picked player))] = 0
          • Set zabil_survivora[(Player number of (Picked player))] = 0
          • Set zabil_bandit[(Player number of (Picked player))] = 0
          • Set zabil_heroes[(Player number of (Picked player))] = 0
          • Player Group - Remove (Picked player) from (All players)
Here's map init , i thought everything is okay.

Like Emm-A- said it's quite hard to help when we don't know what the problem is or what you want. Here's some thoughts though:

Trigger 1: This one should work? Anyway, is there any reason why you loop? You could just use "Conditions - Any are true" and move them up to the conditions of the actual trigger. P.S. perhaps you intend to change it in the future but for now humanita is just 500*zabil_zombies
Trigger 2: I don't see why you'd make it so complicated. Just display the text to humanita_banditove or umanita_hrdinove?
Trigger 3: You didnt "Pick every player and ..:" so there is no picked player (I guess you copied)

Those 3 groups are necessary for this mod , cos when u became "Bandit" or "Hero" depends on how much humanity u have , and which benefits u could get.
 
Last edited by a moderator:
Level 2
Joined
Feb 1, 2014
Messages
19
Your map init trigger has nothing to do with the issue. Please reread what aquilla and I said.

  • pricitani humanity
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set killer = (Killing unit)
      • Set obet = (Dying unit)
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of obet) Equal to zombici[(Integer A)]
            • Then - Actions
              • Set humanita[(Player number of (Triggering player))] = (humanita[(Player number of (Triggering player))] + 500.00)
              • Set zabil_zombies[(Player number of (Owner of (Killing unit)))] = (zabil_zombies[(Player number of (Owner of (Killing unit)))] + 1)
            • Else - Actions
              • Do nothing
Did and tried almost everything still it has no effect.
 
Did you even read what I said?

Aquilla nailed it on this one. On the "-humanity" and "-kills" trigger, the index uses the player number of (Picked player), but you don't even have a Player group loop in either triggers. So the text zjistit_killy will see is whatever number is stored in zabil_bandit[0] (i think this would return a 0 if (Picked player) isn't found).

(Picked player) should be changed to (Triggering player). Your first trigger is fine, so just changing this should fix everything else.
 
Level 2
Joined
Feb 1, 2014
Messages
19
Did you even read what I said?


  • zjistit humanitu
    • Events
      • Player - Player 1 (Red) types a chat message containing -humanity as An exact match
      • Player - Player 2 (Blue) types a chat message containing -humanity as An exact match
      • Player - Player 3 (Teal) types a chat message containing -humanity as An exact match
      • Player - Player 4 (Purple) types a chat message containing -humanity as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -humanity as An exact match
      • Player - Player 6 (Orange) types a chat message containing -humanity as An exact match
      • Player - Player 7 (Green) types a chat message containing -humanity as An exact match
      • Player - Player 8 (Pink) types a chat message containing -humanity as An exact match
      • Player - Player 9 (Gray) types a chat message containing -humanity as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -humanity as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in humanita_hrdinove) Equal to True
        • Then - Actions
          • Game - Display to humanita_skupina the text: (YOUR HUMANITY IS + (|c006969FF + ((String(humanita[(Player number of (Triggering player))])) + |r)))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) is in humanita_banditove) Equal to True
            • Then - Actions
              • Game - Display to humanita_skupina the text: (YOUR HUMANITY IS + (|c00FF0000 + ((String(humanita[(Player number of (Triggering player))])) + |r)))
            • Else - Actions
              • Player Group - Add (Triggering player) to humanita_survivors
              • Game - Display to humanita_survivors the text: (YOUR HUMANITY IS + (|c00FFFFFF + ((String(humanita[(Player number of (Triggering player))])) + |r)))
              • Player Group - Remove (Triggering player) from humanita_survivors
  • zjistit humanitu Copy
    • Events
      • Player - Player 1 (Red) types a chat message containing -kills as An exact match
      • Player - Player 2 (Blue) types a chat message containing -kills as An exact match
      • Player - Player 3 (Teal) types a chat message containing -kills as An exact match
      • Player - Player 4 (Purple) types a chat message containing -kills as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -kills as An exact match
      • Player - Player 6 (Orange) types a chat message containing -kills as An exact match
      • Player - Player 7 (Green) types a chat message containing -kills as An exact match
      • Player - Player 8 (Pink) types a chat message containing -kills as An exact match
      • Player - Player 9 (Gray) types a chat message containing -kills as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -kills as An exact match
    • Conditions
      • ((Triggering player) controller) Equal to User
    • Actions
      • Player Group - Add (Triggering player) to zjistit_killy
      • Game - Display to zjistit_killy the text: (BANDIT KILLS : + (String(zabil_bandit[(Player number of (Triggering player))])))
      • Game - Display to zjistit_killy the text: (HERO KILLS : + (String(zabil_heroes[(Player number of (Triggering player))])))
      • Game - Display to zjistit_killy the text: (SURVIVOR KILLS : + (String(zabil_survivora[(Player number of (Triggering player))])))
      • Game - Display to zjistit_killy the text: (ZOMBIE KILLS : + (String(zabil_zombies[(Player number of (Triggering player))])))
      • Player Group - Remove (Triggering player) from zjistit_killy
I think this might be alright , resend the trigger if im wrong please , im kinda out with this one :d
 
Level 2
Joined
Feb 1, 2014
Messages
19
((Picked player) doesn't exist

That only works inside of a player group enumeration.

in case your still confused

  • ((Picked player) is in humanita_banditove) Equal to True

That line is the problem.

So...if i understand , the problem is the humanita_banditove enumeration and i should use it somehow differently , could u tell me how?:D

OMG , sorry guys juse noticed the problem, gonna try it.

the problem wasnt realy in the triggers , actualy it could be and thanks everyone for help but the trigger wont count humanity and zombie kills bcs i wasnt spawning the right units stored in the variable , now its fixed , thank yu boys.
 
Last edited:
Status
Not open for further replies.
Top