Region triggers

DonMushroom

Member
Reaction score
4
I have a trigger that shares vision if a hero dies. Cant seem to get it to work with the all points held shared vision.

Events
Unit - Any Unit dies
Local Variables
Rev = 0 <Integer>
Conditions
((Unit type of (Triggering unit)) is Hero) == True
(Player j is giving player i Shared Vision) == False
Actions
UI - Display "You have been revealed" for (Player group((Triggering player))) to Error area
General - For each integer Rev from 1 to 10 with increment 1, do (Actions)
Actions
Player - Turn player (Triggering player) Shared Vision On towards player Rev

How would i edit the conditions so when the hold all points shared vision is on the hero dieing reliever does not work/show? :)

So if shared vision (from all points being held) is on. Hero dieing/ being revived has no effect on shared vision.
If shared vision (from all points being held) is off. Hero dieing being revived works/shows.
 

DonMushroom

Member
Reaction score
4
The unit leaves region / unit dies works perfectly for the the loses region trigger in the editor test.

As soon as its published i get a trigger error saying "Execution took to long". It comes up whenever a unit leaves a region and when a unit dies :p

Im not sure why this is happening :(

Does anyone know of a condition that would stop this activating if tit does not need to. :) (When shared vision is not on)

So if all the regions are not held by a team it does not check if they have left or have died in a region (as there is no reason to) :)
 

Dave312

Censored for your safe viewing
Reaction score
269
That is rather weird. Do a single player map test (via the Test Document function in the editor), type TrigDebug into the Chat to open up the Trigger Debugger (you have to be in Windowed screen mode, not Fullscreen), go across to the Triggers tab, and what is the Average Run Time (ms) and Average Fail Time (ms) values?

I can probably come up with another method which will decrease the amount of time it takes for the trigger to run but it will be more complicated. I'll post back when I have finished a test map for it.
 

DonMushroom

Member
Reaction score
4
Loses Region - Both are 0 000

The main problem i am having is when the team gets shared vision. The gains region trigger does the too long thing every time a unit enters a region :p

As soon as a too long error comes up the game has chronic lag from then on.
 

MissKerrigan

Active Member
Reaction score
23
Think I might have a solution for your problem Mushroom:

First create 4 unit groups which called 'revealer 1', 'revealer 2', 'revealer 3' and 'revealer 4'


Now create the next 3 triggers:

1. when a unit enters the region of 'revealer 1' add unit to unit group 'revealer 1' (do this with all 4 'revealers')

2. if a unit leaves region, then remove the unit from the current unit group it was in (if a unit dies, it doesn't count as 'unit leaves region')

3. hide 'revealer' when the number of living units in unit group is '0' (create this in condition)


I apologize if I am this wrong, but I just try to find a way to help you Mushroom, hope this works!

MissKerrigan
 

Dave312

Censored for your safe viewing
Reaction score
269
In trying to create another set of triggers to get this working, I came across the "Execution took to long" error. I did some research into the error and found that if you place a wait action inside a loop, it resolves the problem. So try adding a wait action (set the duration to 0.0625s such that you don't notice the wait) into the "Gains Region" trigger inside the first "For each player" loop:

Trigger:
  • Gains Region
    • Events
      • Unit - Any Unit Enters Region 001
      • Unit - Any Unit Enters Region 002
    • Local Variables
      • i = 0 &lt;Integer&gt;
      • j = 0 &lt;Integer&gt;
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Number of Living units in (Units in Region 001 having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • (Number of Living units in (Units in Region 002 having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
        • Then
          • Player Group - For each player j in (Enemies of player (Triggering player)) do (Actions)
            • Actions
              • General - Wait 0.0625 Game Time seconds
              • Player - Turn player j Shared Vision On towards player (Triggering player)
              • Player Group - For each player j in (Allies of player (Triggering player)) do (Actions)
                • Actions
                  • Player - Turn player j Shared Vision On towards player i
        • Else
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top