• 🏆 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!

Triggers: Many small or One big?

Status
Not open for further replies.
Level 2
Joined
Jan 4, 2011
Messages
22
Hello Hive :) I was wondering... I am making a drop system that finds out what type of unit a mob is and drops certan items after it, but i was wondering is it besdt with 1 big or many small?

Also i would like to know how to put a little "warning ring" on the map so that the player knows where to go, not like the one you can do on ALT + G but, i hope you know what i mean? :D
 
1st part:
Maybe like this:
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ItemType[1] = Claws of Attack +15
      • Set ItemType[2] = Crown of Kings +5
      • Set ItemType[3] = Kelen's Dagger of Escape
      • Set ItemType[4] = Mask of Death
      • ------------------------------------------------
      • Set ItemType[99] = Wand of Neutralization
And now drop trigger!
  • Item Drop
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set IDTempPoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Footman
              • (Unit-type of (Triggering unit)) Equal to Knight
        • Then - Actions
          • Item - Create ItemType[1] at IDTempPoint
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Rifleman
        • Then - Actions
          • Item - Create ItemType[2] at IDTempPoint
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Priest
        • Then - Actions
          • Item - Create ItemType[3] at IDTempPoint
        • Else - Actions
      • -------- -------------------------------- --------
      • Custom script: call RemoveLocation(udg_IDTempPoint)
2nd part:
You mean this ↓
  • Actions
    • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 1.00 seconds
    • Cinematic - Ping minimap for (All players) at (Center of (Playable map area)) for 1.00 seconds, using a Simple ping of color (100.00%, 100.00%, 100.00%)
 
Level 2
Joined
Jan 4, 2011
Messages
22
Thank you for the help in the trigger even tho i know how to make it drop :) i just wanted to know if you mean it should be 1 trigger or many small? like one trigger for each mob? :D

And thank you very much for the Ping minimap :D
 
Level 8
Joined
Dec 12, 2010
Messages
280
i just wanted to know if you mean it should be 1 trigger or many small? like one trigger for each Mob?

I would say definitely one trigger would be better than many. One thing its a lot easier to work with. Its less clutter. And probably the best reason imo its more efficent in game. As the game would have to process each trigger seperately. And if they all have the same event that could add up to a lot of processes with many triggers firing one after another and could potentally even cause some lag.
 
Level 2
Joined
Jan 4, 2011
Messages
22
I would say definitely one trigger would be better than many. One thing its a lot easier to work with. Its less clutter. And probably the best reason imo its more efficent in game. As the game would have to process each trigger seperately. And if they all have the same event that could add up to a lot of processes with many triggers.

So many triggers with same events = lag? :)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
What Kobas told you does work, but you should put those if/then/elses inside each other so it won't make all those checks. And store the unit type into a variable.

This is also one option:
  • Untitled Trigger 029
    • Events
    • Conditions
    • Actions
      • Set p1 = (Position of (Triggering unit))
      • Set UnitType = (Unit-type of (Triggering unit))
      • For each (Integer loopA) from 1 to 14, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UnitType Equal to UType[loopA]
            • Then - Actions
              • Item - Create IType[loopA] at p1
              • Custom script: call RemoveLocation(udg_p1)
              • Skip remaining actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_p1)
You just need to set the unit types and item types into variable arrays. Then loop from the first index to the last used index.
 
Level 2
Joined
Jan 4, 2011
Messages
22
Hey guys Thank you for inspiration <3!!!! This trigger is much easier :)
I use these two triggers now:

  • Setting items
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DropItem[1] = Pig meat
      • Set DropUnit[1] = Pig
      • Set DropItem[2] = Murloc Potion
      • Set DropUnit[2] = Murloc Tiderunner
  • Dropping
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to DropUnit[(Integer A)]
            • Then - Actions
              • Item - Create DropItem[(Integer A)] at (Position of (Dying unit))
            • Else - Actions
AND SERIUSLY THANK YOU!!!! :grin:
 
Status
Not open for further replies.
Top