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

Random trigger "bugs"

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
I have a couple of triggers in my map that are supposed to fire when a unit belonging to an enemy of player 12 enters a certain region. But for some reason these triggers sometimes fire at random when no unit meeting the condition is near. It's as if an invisible unit is teleporting around the map and entering the regions. The weird thing is that this only happens sometimes, and other playthroughs of the map everything works perfectly. Sometimes units that are removed via a trigger action such as "Unit - Remove BOSS_SPIRIT from the game" aren't completely removed; rather the model and shadow disappear but the unit itself is still there, invisible and untargetable and attacks other units from its invisibility.

Here are some example triggers:

This trigger has turned itself off at random without executing the other actions:

  • Gauntlet pull 10 start
    • Events
      • Unit - A unit enters Gauntlet pull 10 <gen>
    • Conditions
      • ((Entering unit) belongs to an enemy of Player 12 (Brown)) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Add all units of Gauntlet_pull_10 to Gauntlet_respawn_units
      • Unit Group - Pick every unit in Gauntlet_pull_10 and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Unpause (Picked unit)
          • Set GEN_TEMP_POINT_1 = (Center of Gauntlet bottom <gen>)
          • Unit - Order (Picked unit) to Attack-Move To GEN_TEMP_POINT_1
          • Custom script: call RemoveLocation(udg_GEN_TEMP_POINT_1)
This trigger has activated the visibility emitter when the units who can enter the region to fire the trigger have been at the other end of the map.

  • Visibility gauntlet 1
    • Events
      • Unit - A unit enters Visibility gauntlet 1 <gen>
    • Conditions
      • ((Entering unit) belongs to an enemy of Player 12 (Brown)) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Player Group - Pick every player in P_PLAYER_GROUP and do (Actions)
        • Loop - Actions
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Visibility gauntlet 1 <gen>
This trigger has also fired when units are at the opposite end of the map

  • Hostage 01 rescue
    • Events
      • Unit - A unit enters Hostage 01 rescue <gen>
    • Conditions
      • ((Entering unit) belongs to an enemy of Player 12 (Brown)) Equal to True
      • (TIMED_EVENT_hostg01 is alive) Equal to True
      • (BOSS01 is dead) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Special Effect - Destroy TIMED_EVENT_net_effect01
      • Special Effect - Destroy TIMED_EVENT_talk_to_me01
      • Set Q_TimeTrial_hostgs_rescued = (Q_TimeTrial_hostgs_rescued + 1)
      • Quest - Mark Q_TimeTrial_savehostage01 as Completed
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Q_TimeTrial_hostgs_rescued Equal to 4
        • Then - Actions
          • Quest - Mark Q_qTimeTrial as Completed
          • Quest - Display to (All players) the Quest Completed message: |cffffcc00QUEST COM...
        • Else - Actions
          • Trigger - Run Timed event Time Trial quest update <gen> (checking conditions)
What could be the cause of this and how do I fix it so triggers don't fire randomly without a reason?
 
Level 5
Joined
May 20, 2008
Messages
138
I think you should search for the problem somewhere else cuz imo these triggers are way too simple to generate such problems:D post other trigges to give people better view of you map so thay can give you better help

or upload map

The question is what triggers I should post since my map has over 600 of them :p

Hmm... Try making a new map and paste your triggers there. See if it happens the same way.

I exported my triggers, erased them from the map, saved the map, and then imported the same triggers again. Now I am getting two compile errors "Expected a variable name" in this function (posted below) on the gg_unit lines. I don't understand why I didn't get a compile error there before. Or why that would affect the other triggers. So obviously something is wrong with the triggers but what and why?

Code:
//===========================================================================
function CreateUnitsForPlayer10 takes nothing returns nothing
    local player p = Player(10)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'n006', -9292.5, -4167.0, 63.524 )
    call SetUnitColor( u, ConvertPlayerColor(0) )
    set u = CreateUnit( p, 'e00G', -8946.8, -3493.6, 28.874 )
    set u = CreateUnit( p, 'n009', -256.0, 3104.0, 270.000 )
    set u = CreateUnit( p, 'n009', 5440.0, 12128.0, 270.000 )
    set u = CreateUnit( p, 'n009', -5984.0, 6784.0, 270.000 )
    set u = CreateUnit( p, 'n009', 5184.0, 6752.0, 270.000 )
    set u = CreateUnit( p, 'n009', -256.0, 13728.0, 270.000 )
    set u = CreateUnit( p, 'n009', -6976.0, 14976.0, 270.000 )
    set gg_unit_e001_0116 = CreateUnit( p, 'e001', 133.4, 1018.7, 109.350 )
    set u = CreateUnit( p, 'e008', 650.6, -4285.3, 15.063 )
    set u = CreateUnit( p, 'e009', 1408.2, -4949.7, 231.174 )
    set u = CreateUnit( p, 'e00A', 1490.4, -5188.9, 230.648 )
    set u = CreateUnit( p, 'n009', 1183.8, -4977.7, 262.779 )
    set u = CreateUnit( p, 'e00O', 1249.5, -4632.9, 67.866 )
    set u = CreateUnit( p, 'e00P', 721.5, -4955.7, 327.524 )
    set gg_unit_e000_0224 = CreateUnit( p, 'e000', 768.7, -4594.0, 184.898 )
    set u = CreateUnit( p, 'e002', 6577.8, 7353.8, 180.000 )
    set u = CreateUnit( p, 'e003', -6676.6, 5353.4, 90.000 )
    set u = CreateUnit( p, 'e005', -7286.6, 13798.1, 0.000 )
    set u = CreateUnit( p, 'e004', 5172.9, 11882.4, 90.000 )
    set u = CreateUnit( p, 'o018', 812.0, -3982.3, 136.630 )
    set u = CreateUnit( p, 'o018', 319.2, -4359.5, 268.020 )
    set u = CreateUnit( p, 'o018', 436.2, -5015.7, 81.993 )
    set u = CreateUnit( p, 'e00Q', 680.2, -5017.1, 42.526 )
    set u = CreateUnit( p, 'o018', 1798.7, -5078.3, 309.483 )
    set u = CreateUnit( p, 'o018', 812.4, -5625.4, 38.475 )
    set u = CreateUnit( p, 'e006', 1006.5, -4543.5, 256.895 )
    set u = CreateUnit( p, 'e007', 900.8, -5241.1, 292.593 )
    set u = CreateUnit( p, 'e00B', -3350.2, 15050.1, 247.847 )
endfunction

 
Status
Not open for further replies.
Top