• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Cant get trigger 2 run

Status
Not open for further replies.
Level 7
Joined
Apr 3, 2007
Messages
293
I want a trigger to only run after all spacific units r dead, but what I cant seem to do is make the trigger run... Im pretty sure its the event that is messing me up sence there is no event that says "run when turned on." is there any other way 2 do this?
 

Attachments

  • 1.jpg
    1.jpg
    34.9 KB · Views: 178
  • 2.jpg
    2.jpg
    35.5 KB · Views: 95
  • 3.jpg
    3.jpg
    15.8 KB · Views: 163
Level 3
Joined
Mar 27, 2007
Messages
23
Well first of all the event for the map initialization only runs the trigger once unless looped so i suggest making a trigger that checks if the cin2 variable or whatever it was is = to 1 by using the event for every 0.1 seconds and then turn the trigger off and start the next trigger that runs after 0.1 seconds game time, i forget the exact names of the events but they should be easy to find. Hope this helps


-HellsAngel
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,229
Please read below fully before commenting. Since you submitted the triggers as screenshots instead of as text in trigger tags, I checked each one individually so some of wha I say may contridict what I said eariler.

Trigger on left

You preform the action only if a variable is equal to 1 at the map beginning (as soon as the player finishes loading but before time starts). Thus I believe the problem is that variable is not equal to 1 at the time the even is run. To fix this, simply run the actions that set that variable in the trigger itself or remove it all together.

Trigger in middle
You check if unit variables are set to null every 0.5 seconds. If they previously contained a value (like a living unit), you have to manually set them to no unit (null) or they simply reference an empty unit slot (so the variable comparison still missmatches). You then also use a "Do Nothing" action, this does like the name says absolutly nothing but waste CPU power and is un needed totally (has no positive affect on your trigger in any way). Finally you set a variable that is used on map into to a value at a time there is nothing to use it at. That makes no sense at all and I recomend you redo that trigger.

Trigger on right
This Trigger should work properly and cover the no unit (null) problem mentioned eariler, but only for one of the 5 ghosts. You need 4 more like it (1 for each ghost) if you want it to work correctly.

General help
I think what you are after is using the middle trigger to run the left one. To do this simply remove the event that the left trigger has. Then all that is needed for you to do is, in the middle trigger, create the action in the appropiate place which is a "Trigger" action (the one that runs a trigger). Very simple and in JASS you would even more simply make that trigger on the left a defined function which you then call.

Tip
WC3 Arrays start at index 0, thus 0 is a valid location to store an item just like index 1, 2, 3, . . . ect.
 
Status
Not open for further replies.
Top