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

Triggers not running properly

Status
Not open for further replies.
Level 5
Joined
Dec 22, 2007
Messages
103
I'm aware of my ineptitude at triggering, so optimization would be
appreciated. In my campaign I have revenants that spawn souls upon death,
which fly back to their bodies once freed. I have made 3 of these so far, but
the first 2 have issues and the 3rd doesn't run at all. I would suggest you
open up the campaign to view the problem, but heres the layout of the first
instance, which runs at an almost acceptable level.
  • Events
    • Unit - Soul Warder (Frost) 0053 <gen> Dies
  • Conditions
    • ((This trigger) is on) Equal to True
  • Actions
    • Trigger - Turn off (This trigger)
    • Unit - Create 1 Soul (Standard) for Player 4 (Purple) at (Position of (Triggering unit)) facing Default building facing degrees
    • Set Soul1 = (Last created unit)
    • Wait 1.00 seconds
    • Unit - Order Soul1 to Attack Prisoner (Corrupted) 0005 <gen>
  • Events
    • Unit - Prisoner (Corrupted) 0005 <gen> Dies
  • Conditions
    • ((This trigger) is on) Equal to True
  • Actions
    • Trigger - Turn off (This trigger)
    • Unit - Kill Soul1
    • Unit - Move Resident01 instantly to (Position of (Triggering unit)), facing (Facing of (Triggering unit)) degrees
    • Trigger - Turn on Resident 01 <gen>
  • Events
    • Unit - A unit comes within 600.00 of Resident (Male) 0092 <gen>
  • Conditions
    • ((This trigger) is on) Equal to True
    • (Triggering unit) Equal to Darium
  • Actions
    • Trigger - Turn off (This trigger)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Cell02 <gen> contains Resident01) Equal to True
      • Cell02Gate Equal to False
    • Then - Actions
      • Game - Display to APG1 the text: |cffffcc00Resident:...
      • Cinematic - Ping minimap for APG1 at (Position of Resident01) for 3.00 seconds
      • Wait until (Cell02Gate Equal to True), checking every 0.10 seconds
      • Unit - Order Resident01 to Move To (Center of Resident01 <gen>)
      • Wait until ((Resident01 <gen> contains Resident01) Equal to True), checking every 0.10 seconds
      • Unit - Make Resident01 face 0.00 over 0.50 seconds
      • Item - Create Tome of Agility at ((Position of Resident01) offset by (25.00, 0.00))
      • Set TomeofAgility = (Last created item)
    • Else - Actions
      • Do nothing
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Cell02 <gen> contains Resident01) Equal to True
      • Cell02Gate Equal to True
    • Then - Actions
      • Game - Display to APG1 the text: |cffffcc00Resident:...
      • Cinematic - Ping minimap for APG1 at (Position of Resident01) for 1.00 seconds
      • Unit - Order Resident01 to Move To (Center of Resident01 <gen>)
      • Wait until ((Resident01 <gen> contains Resident01) Equal to True), checking every 0.10 seconds
      • Unit - Make Resident01 face 0.00 over 0.50 seconds
      • Item - Create Tome of Agility at ((Position of Resident01) offset by (25.00, 0.00))
      • Set TomeofAgility = (Last created item)
    • Else - Actions
      • Do nothing
  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • ((This trigger) is on) Equal to True
    • (Triggering unit) Equal to Darium
    • (Item being manipulated) Equal to TomeofAgility
  • Actions
    • Trigger - Turn off (This trigger)
    • Game - Display to APG1 the text: |cffffcc00Resident:...
    • Unit - Order Resident01 to Move To (Center of ShrineExit <gen>)
    • Wait until ((ShrineExit <gen> contains Resident01) Equal to True), checking every 0.10 seconds
    • Unit - Remove Resident (Male) 0092 <gen> from the game
    • Special Effect - Create a special effect at (Center of ShrineExit <gen>) using Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
    • Set SFX17 = (Last created special effect)
    • Wait 1.00 seconds
    • Special Effect - Destroy SFX17
The issues I'm having with the instance shown is the text is displayed twice
for unknown reasons and the text shown doesn't match the one in the
trigger. Running the mission would give you a better understanding I'm Sure.
I'm currently working on Garthang_02.5, or Saving Orlidon in game.
 

Attachments

  • TombOfGarthang.w3n
    5.6 MB · Views: 24
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
  • ((This trigger) is on) Equal to True
There's no use for this condition, unless you use "Run trigger checking conditions" from another trigger. Wich you're not. If you are never going to use (by run or turning on) any of those triggers after turning them off, i'ts better if you use the following custom script
JASS:
call DestroyTrigger(GetTriggeringTrigger())

You must know that Wait Actions are not accurate, they're not precise, they can have more or less 0.3 seconds added or removed from the time you want. It's much better if you find another way to chieve what you want with those waits.

You also have plenty of leaks wich would stack up untill making your game so laggy it's unplayable.
Whenever you use a location, use a Point variable, declare the point you want, and then use this as a custom script when you no longer need the point again during that trigger
JASS:
call RemoveLocation(udg_YourPointVariableName)
Avoid wait actions between variable setting and variable destroying (with the custom script)

WHy do you need the Tome of AGility Variable? What are you using it for?
Where are you setting the "Darium" unit?
 
Level 5
Joined
Dec 22, 2007
Messages
103
Accidentally left a trigger out, as for the other stuff mentioned, I have no scripting knowledge. I am not experiencing any of the aforementioned lag, but I'm assuming you didn't open up the campaign. either way thank you for the suggestions.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I know you're not experienced, that's why I gave you those tips that gives you a bit of Wc3 triggering knowledge.

I forgot to mention that "Do Nothing" action isn't neccesary, in fact, it's better if you leave it blank.

Your third trigger can be optimized. You have 2 independent If/Then/Else wich shares one condition. You could improve it by creating 1 If/then/else that contains the " (Cell02 <gen> contains Resident01) Equal to True" condition. Then, in the actions, add another If/then/else with the second condition wich is: " Cell02Gate Equal to False" In the "Then" actions of that second if/then/else statements, do the actions if the Cell02Gate Equal to False, in the ELSE block, do the action of the " Cell02Gate Equal to true" without having to add it.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Cell02 <gen> contains Resident01) Equal to True
    • Then - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Cell02Gate Equal to False
        • Then - Actions
          • Do your thing
        • Else - Actions
          • Do your thing. These will happen if Cell02Gate Equal to true.
    • Else - Actions
      • Leave this blank
Also, you have 2 of these actions in different triggers. There are the only ones related to Displaying a game message. The problem is for sure related to one of the triggers wich envolves a message being displayed. Check them and see if both are triggering at the same time, or the same is triggering twice.

  • Game - Display to APG1 the text: |cffffcc00Resident:...
NOTE: I'm not saying that your map is laggy, i'm saying that your triggers has some flaws known as "leaks" (memory leaks) wich stack up untill the game becomes laggy. It's a good practice to avoid using Points (using X/Y is better) and avoid/clean memory leaks.
 
Level 5
Joined
Dec 22, 2007
Messages
103
Goodness, I've realized my issue. For some reason opening my campaign up via the shortcut I created doesn't allow it to save. So the changes I've been making haven't been implemented, explaining the game text inaccuracies and triggers not running. I will definitely implement the changes you've suggested to make the game run more smoothly, but it seems I've created and solved my issue
 
Status
Not open for further replies.
Top