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

[Trigger] Help to my system pls

Status
Not open for further replies.
Level 4
Joined
Jun 23, 2017
Messages
74
Hello everyone,

i'm trying make one system, but i'm infrented some problem and i don't know how to identify.
Well, first, the system is made so that when 2 units enter 1 construction, have the chance to generate another unit.
I have it:
  • Events
    • Unit - A unit Is loaded into a transport
  • Conditions
    • (Unit-type of (Transporting unit)) Equal to Barrow Den
  • Actions
    • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of (Loading unit)) Equal to Demon Hunter
            • (Unit-type of (Loading unit)) Equal to Warden
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • RepIntegerPorcent Less than or equal to 100
          • Then - Actions
            • Unit - Create 1 Furion for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
          • Else - Actions
      • Else - Actions
(Ignore the "Game - Display ..." I put this just to make it easier to locate where I am going wrong in the triggers)
RepIntegerPorcent Less than or equal to (100 = FOR TEST)
RepIntegerPorcent = (Random integer number between 1 and 100)

This:
  • And - All (Conditions) are true
    • Conditions
      • (Unit-type of (Loading unit)) Equal to Demon Hunter
      • (Unit-type of (Loading unit)) Equal to Warden
Do not let this work:
  • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RepIntegerPorcent Less than or equal to 100
      • Then - Actions
        • Unit - Create 1 Furion for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
But if I do this:
  • If - Conditions
    • (Unit-type of (Loading unit)) Equal to Demon Hunter
Its work.
But I dont understand what's happening with the AND. I need the 2 units to be inside, not just 1
If anyone knows what happens there. Please help me.
Thanks in advance
 
Level 4
Joined
Jun 23, 2017
Messages
74
I'm sure it's because the trigger doesn't recognize two loading unit at once. The trigger only recognizes the last unit that got loaded. How about playing around with Unit Group? Though, I'm not sure myself how. I'll try take a look at it from WE view later.
I tested 2 different triggers, however the problem remains. I have not tested the Unit Group because (I believe that) the problem is happening in the condition.
Edit: Well, now I've tested, but not knowing how to use it I've been stirring, but nothing I did with it worked.
____________________________________________________________________________________________

The (Loading unit) is the same unit in a single thread. Its impossible for a unit to be two unittypes simultaenously.
Well, in that case, how do I get the 2 units needed for the action to work?
 
Last edited:
Level 4
Joined
Jun 23, 2017
Messages
74
Ok, I'll take a look at GUI Unit Event, see what I can do and tomorrow I'll come back! Thanks again!
 
Level 4
Joined
Jun 23, 2017
Messages
74
Hi men,
I started to study the GUI Unit Event yesterday but there are a lot of things in it that I do not understand, especially JASS, I do not know anything, but in the GUI part I had a question:All variables are disabled and it is recommended to remain so for better system copy, but why?

To be honest, I was lost in the middle of such a trigger, that set the same variable with different values. I did not understand the reason, but I moved on. I was looking around for about 2 hours trying to decide where I could implement my system, I decided to put it in this part of "test -> On Load"
Unit Event.png
I tried in several ways, but the only one that worked, was this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • UnitTypeOf[UDex] Equal to Footman
    • Then - Actions
      • Game - Display to (All players) the text: TEST
      • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Else - Actions
Worked!
When i load Footman in Zeppelin, create 1 hero.
When i make it:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • UnitTypeOf[UDex] Equal to Footman
          • UnitTypeOf[UDex] Equal to Rifleman
    • Then - Actions
      • Game - Display to (All players) the text: TEST
      • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Else - Actions
No longer works. :/
 
Last edited:
Level 4
Joined
Jun 23, 2017
Messages
74
Well, today I can not stay until 6 in the morning, trying different things to see if it will work, because tomorrow I need to get up early.
After reading what Bribe said
  • Unit CargoTransportUnit[(Custom value of Transported unit)] - The unit who is carrying it (if any) such as Zeppelin or Meat Wagon.

  • Unit Group CargoTransportGroup[(Custom value of Transporter)] - A unit group which holds all of the cargo of a transporting unit.
Here are some attempts I've made:
All without results
  • Reproduction
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Transporting unit)) Equal to Goblin Zeppelin
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • UnitTypeOf[(Integer(UnitTypeEvent))] Equal to Footman
        • Then - Actions
          • Game - Display to (All players) the text: TEST2
          • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions
_________________________________________
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoEvent Equal to (Real((Supply used by Footman)))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
_________________________________________
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoEvent Equal to (Real((Custom value of CargoTransportUnit[(Supply used by Footman)])))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
_________________________________________
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoEvent Equal to (Real((Custom value of CargoTransportUnit[(Number of units in CargoTransportGroup[(Supply used by Footman)])])))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
_________________________________________
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Number of units in (Last created unit group)) Equal to (Number of units in (Units of type Footman))
    • Then - Actions
      • Game - Display to (All players) the text: TEST2
      • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Else - Actions
____________________________________
  • Actions
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
        • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of CargoTransportUnit[(Number of units in CargoTransportGroup[(Number of units in (Last created unit group))])]) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
___________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • UnitTypeOf[(Number of units in CargoTransportGroup[(Custom value of (Transporting unit))])] Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
____________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • UnitTypeOf[(Number of units in CargoTransportGroup[(Custom value of (Loading unit))])] Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
_____________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of CargoTransportUnit[(Custom value of (Loading unit))]) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
______________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
______________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
_______________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of CargoTransportUnit[(Custom value of (Loading unit))]) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
________________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoTransportUnit[(Custom value of (Loading unit))] Equal to CargoTransportUnit[(Integer((String(Footman))))]
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
________________________________________
  • Actions
    • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoTransportUnit[(Custom value of (Loading unit))] Equal to CargoTransportUnit[(Supply used by Footman)]
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
________________________________________
  • Conditions
    • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Goblin Zeppelin
________________________________________
  • Conditions
    • UnitTypeOf[(Number of units in CargoTransportGroup[(Custom value of CargoTransportUnit[(Custom value of (Transporting unit))])])] Equal to Goblin Zeppelin
________________________________________
  • Conditions
    • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Goblin Zeppelin

Here are some things I tried to do, but I got the same result as before. (When I started to make the system)
  • Actions
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Game - Display to (All players) the text: TEST
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of (Loading unit)) Equal to Footman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
It's WORK! But
ITS:
  • Actions
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Game - Display to (All players) the text: TEST
        • Unit Group - Add (Loading unit) to (Last created unit group)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Unit-type of (Loading unit)) Equal to Footman
            • (Unit-type of (Loading unit)) Equal to Rifleman
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
Don't work.
____________________________________

  • Actions
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
        • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Number of units in (Last created unit group)) Equal to (Integer((String(Footman))))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
Its WORK! But
  • Actions
    • Unit Group - Pick every unit in CargoTransportGroup[(Custom value of (Transporting unit))] and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Loading unit) to (Last created unit group)
        • Game - Display to (All players) the text: TEST
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • (Number of units in (Last created unit group)) Equal to (Integer((String(Footman))))
            • (Number of units in (Last created unit group)) Equal to (Integer((String(Rifleman))))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions
Its don't work.
And here, Appears in load any unit:
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • And - All (Conditions) are true
          • Conditions
            • CargoEvent Equal to (Real((String(Footman))))
      • Then - Actions
        • Game - Display to (All players) the text: TEST2
        • Unit - Create 1 Blood Mage for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Else - Actions

I really do not know how to proceedm, I really enjoy learning how things work in World Editor, but this is not working, because I do not know how to do it.
If you can show me the right way to do it, I'm sure I'll study on it, but trying tirelessly hundreds of thousands of ways without result, I will not get anywhere. :/
 
Level 4
Joined
Jun 23, 2017
Messages
74
First off, you should use the right event: CargoEvent == 1 for load and CargoEvent == 2 for unload events
Ok, i use it.
Next, iterate through the loaded units of the cargo and check if the two unittypes are inside.
Now, how do I do these?

I did:
  • Conditions
  • (Number of units in (Units of type Footman)) Equal to 1
When someone enters the cargo, every 5 seconds he spawns a new unit
And it,
  • Conditions
  • (Number of units in (Units of type Goblin Zeppelin)) Equal to ((Integer((String(Footman)))) + (Integer((String(Rifleman)))))
it,
  • If - Conditions
    • (Unit-type of CargoTransportUnit[(Custom value of (Loading unit))]) Equal to Footman
    • (Unit-type of CargoTransportUnit[(Custom value of (Loading unit))]) Equal to Rifleman
or it
  • If - Conditions
    • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Footman
    • (Unit-type of CargoTransportUnit[(Custom value of (Transporting unit))]) Equal to Rifleman
Between some triggers of the previous post that I also tested
Don't work.
 
Level 4
Joined
Jun 23, 2017
Messages
74
ok, i understand ...
Well, I hope someone can finish this for me with a ['trigger'] ['/ trigger'] showing me how to do it.
Anyway, I'll try something else because I really want to finish this shit.

Thank you for your time and sorry to bother you.
 
Level 4
Joined
Jun 23, 2017
Messages
74
Yeah, I quitting, I've tried in several ways, without success.
I tried to use boolean to "check" the transport
  • ((Loading unit) is loaded into (Triggering unit)) Equal to True
But it seems that where "(Triggering Unit)" only worked something when I selected the unit already placed on the map.
Use OR, not AND condition.
Yes, I'll do it like this, since it's going to be a small percentage of the chance of any unit being born.

Thanks all and, sorry for importuning.
 
Status
Not open for further replies.
Top