Difference between Event and Condition

XxMayhemxX

New Member
Reaction score
6
For triggers, whats the difference between Events and Conditions?

Can i have a Condition and an Action without listing an Event?

the event im looking for isnt listed.. thats why i ask... But im almost certain the condition is...
 

ZugZugZealot

New Member
Reaction score
33
Well if you want to treat conditions as an event, you'll need to use a periodic event.

Though, what exactly is the event you can't find?
 

XxMayhemxX

New Member
Reaction score
6
Well idk... it's kinda hard to explain unless i explain it all...

I sort of touched on it in another thread..

I'll try to explain my problem...
I got a defense map which sends waves..
Basically i got a trigger that is sending the waves nonstop.

So once all enemies are defeated... the new wave starts in 10 seconds..
the Event for that one is Any Unit Dies. It counts the kills and awards points for kills, and if computer has 0 men and wavestart == false, it kicks in the next wave.

I also have a leak trigger when enemies get to the end, I lose 1 life for each leak. But i cant get the 2 to work together. So when i leak.. i can remove the units ot kill units.. but then I cant start the next round. and when i tried Remove
Unit on the leaks.. then the next wave didnt work. I don't know , it's confusing... at one point i leaked... and the timer for the next wave started counting backwards.. -1, -2, -3 etc., nonstop. I also tried kill units for leaks.. and the leaks counted as points for me player 1. I tried moving them to a new region, then having a computer cannon kill them, but i can't find an action to issue order attack.

i tried if then else statements... i can form the idea in my head of how they will work, but when i start clicking in the GUI, i lose track of where im at and focus and get confused.
 

sqrage

Mega Super Ultra Cool Member
Reaction score
514
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - Any Unit Enters LEAK
    • Local Variables
    • Conditions
      • ((Unit type of (Triggering unit)) count for badguy, counting Complete) == 0
      • (Owner of (Triggering unit)) == badguy
    • Actions
      • Timer - Start Timer as a One Shot timer that will expire in 5.0 Game Time seconds


What about something similar to that? Make one for all the leak regions.
 

XxMayhemxX

New Member
Reaction score
6
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - Any Unit Enters LEAK
    • Local Variables
    • Conditions
      • ((Unit type of (Triggering unit)) count for badguy, counting Complete) == 0
      • (Owner of (Triggering unit)) == badguy
    • Actions
      • Timer - Start Timer as a One Shot timer that will expire in 5.0 Game Time seconds


What about something similar to that? Make one for all the leak regions.

oh so 5 seconds will pass before the other trigger registers 0 enemies?
 

Advice D.

New Member
Reaction score
11
I also have a leak trigger when enemies get to the end, I lose 1 life for each leak. But i cant get the 2 to work together. So when i leak.. i can remove the units ot kill units.. but then I cant start the next round. and when i tried Remove
Unit on the leaks.. then the next wave didnt work.
You can have multiple events, so you can make the next wave trigger on both kills and removals or you can make your leak trigger run your next wave trigger.
 

sqrage

Mega Super Ultra Cool Member
Reaction score
514
oh so 5 seconds will pass before the other trigger registers 0 enemies?

No i meant the timer as the timer for the next wave/round.

What happens is: a unit enters the region. It checks to make sure the entering unit belongs to the bad guy. And it also checks that the bad guy has 0 units remaining. If these are both true then it starts the timer for the next round.

You can also take D's advice, might lead you to a simpler solution.
 

XxMayhemxX

New Member
Reaction score
6
I wonder if this will work...

Code:
Unit - Any Unit Enters End
    Local Variables
    Conditions
        (Owner of (Triggering unit)) == 15
    Actions
        Unit - Remove (Triggering unit) from the game
        Variable - Modify Lives: - 1
        Leaderboard - Set Leaderboard item text at column 4 and row 1 to (Text(Lives))
        General - Wait for (Conditions), checking every 1.0 Game Time seconds
            Conditions
                (Number of Living units in (Any units in (Entire map) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
This way.. after a unit leaks.. it gets removed.. THEN checks for == 0 men

Idk tho..

Nope.. off to try something else...
 

sqrage

Mega Super Ultra Cool Member
Reaction score
514
That looks good. I dunno about the checking every 1 second though. Wouldnt that run once every second for the rest of the game and then once every second everytime the trigger is run causing it to run like 38594 times a second some time into the game?
 

wingdnosring

New Member
Reaction score
16
You could also make this easier on yourself and set population costs to all of the incoming enemies. I'm not sure what the population limit is called in SC2 (it was food in warcraft), but you can make a trigger with the event:

Events:
"A player's <current population> has changed"

Then add conditions:
"Triggering Player is equal to <your hostile unit owner>"
"<Population limit> of triggering player is equal to 0"

Perhaps another condition to make sure the round is done spawning so it doesn't switch rounds halfway through creation of the last round's units

I haven't actually used an event like that yet, myself, but I'm sure it would get the job done with less lag.
 

punwisp

New Member
Reaction score
34
For triggers, whats the difference between Events and Conditions?

Can i have a Condition and an Action without listing an Event?

the event im looking for isnt listed.. thats why i ask... But im almost certain the condition is...

event= This occurs

condition= has to happen first


Example

event: he walks outside

Condition: Door has to be open (Cant walk outside if its closed)

Action: Goes outside (Because the condition was met)

Hoped that help :p
 

XxMayhemxX

New Member
Reaction score
6
No i meant the timer as the timer for the next wave/round.

What happens is: a unit enters the region. It checks to make sure the entering unit belongs to the bad guy. And it also checks that the bad guy has 0 units remaining. If these are both true then it starts the timer for the next round.

Well my Wave Trigger and Kill Triggers runs constantly.... It's always running... it's firing nonstop... each unit that comes out is a looped trigger thats runs constantly...

Spawn Waves
Create 1 unit Wave 1
wait 1 second
Trigger - Run Spawn Waves

As a round is cleared, the kill trigger takes over... Unit Dies. Condition All enemies == 0, it gives you money, puts up a 7 second timer or so.. and starts firing the wave trigger all over again for round 2.

So if i kill all the units in a wave, another wave comes in 6,5,4... everythings kosher... BUT, if theres a leak... it gets complicated.

If i use Remove Unit to get rid of a leak, it removes the unit... and the next wave timer starts.. -1, -2, -3, -4, -5, -6 to infinity...

If i use Kill Unit to get rid of the leak, it works great... another wave starts soon because all enemies are considered == 0. The only bummer with this one is you gain points for each killed leak.

I tried both Events at once... with very strange results... units on the tracks would remove instead of dieing after their hp got to 0 lol(Would work great for a wizard spell.. targeted teleporting without spells, just remove and relocate.) The timer would do the -1, -2, -3, -4 thing... the best of both triggers indeed...

I tried to Move Unit, to relocate the leaked unit to a side area where it would be swiftly killed by a nuetral unit. This way it would dodge any imcompatibilities with those other triggers... Only problem here is i can't find any Action Triggers that attack another unit. Not sure if i just can't find it, or if its not in the game yet... No attack order? Yes i have found Issue Orders.. but there no attack there.. it looks pretty limited...

I have tried doing some sort of "if then else" statement, but my brain explodes...

Event -Move to Region LEAK
Condition - Units move to LEAK
If Enemy owns units >=1
Then remove triggered unit
Modify add 1 to Leaks
else
Spawn Wave Trigger

You see the problem here?
There will always be a problem.. unless... i create 2 wave spawners... which are nearly identical.. except one minor difference...

one goes off of all units cleared... and one that goes off of a leaked round...

Theres probably an easier answer... probably involving remaking the spawner so each round is on a timer or something...but i dont really want to redo the wave spawner...

I wish i had more Events to choose from... Thats why the subject of this thread basically was Whats the difference between Events and Conditions... Is it possible to make a trigger with conditions and actions, with no Events... and the trigger fires based on the condition, and not the lame event.. which the event list is severely limited... Maybe it's because this is beta... Why no issue Order attack also?
 

krainert

Member
Reaction score
10
From a general programming perspective:
  • Event listeners, which react to events occurring, are seen as notes
  • Some operations performed by some objects result in events occurring
  • Objects have a "bulletin board" for each operation causing events to occur
  • When a note/listener is created, it is placed on the bulletin board belonging to the relevant procedure
  • Whenever a procedure to which a bulletin board belongs is executed, the associated bulletin board is searched for notes/listeners, and for each found note/listener, the actions it describes are performed

In GE "GUI" that becomes:
  • Events are listeners listed in a Trigger, and each of these listeners listen to some event in the game
  • Any of the events listened to by any Event listed in a Trigger will cause the Trigger to initiate execution
  • If all Conditions of the Trigger sequentially evaluate to true, the Actions of the Trigger are performed, also sequentially

So:
  • Events are what cause the Trigger to initiate execution
  • Conditions are what must be satisfied for the Trigger to perform its Actions
In other words:
  • Events are WHEN
  • Conditions are IF
 

Advice D.

New Member
Reaction score
11
I wish i had more Events to choose from... Thats why the subject of this thread basically was Whats the difference between Events and Conditions... Is it possible to make a trigger with conditions and actions, with no Events... and the trigger fires based on the condition, and not the lame event.. which the event list is severely limited... Maybe it's because this is beta... Why no issue Order attack also?
I wouldn't say the events list is limited or that retail will bring many new events. For Issue Order, you need to set the order type to either a point target (for attack-move, move, patrol, AOE spells etc.) or a unit target (follow-move, attack, single target spells etc.), by clicking the left bracket on the action and changing it.

As for your problem, there's not much I can do without a map, sorry.
 

XxMayhemxX

New Member
Reaction score
6
<SNIP>
In other words:
  • Events are WHEN
  • Conditions are IF

Ahhh so Events are needed...



I wouldn't say the events list is limited or that retail will bring many new events. For Issue Order, you need to set the order type to either a point target (for attack-move, move, patrol, AOE spells etc.) or a unit target (follow-move, attack, single target spells etc.), by clicking the left bracket on the action and changing it.

As for your problem, there's not much I can do without a map, sorry.

I wish there were more of them... there isnt alot... I'll have to look at the list again to see if i can use another one.
As for attack orders.. ok i'll have a look at those.. i seen the point target and unit target there, but was unsure exactly what they meant. I'll have to play around with them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top