• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Help with ore-dropping trigger

Status
Not open for further replies.
Level 9
Joined
Jun 4, 2007
Messages
206
Hey there, I made a simple trigger that gives a 70% chance to create a Iron Ore(item) when a Iron Rock(destructible) dies, but, don't matter how many times I try to get a Iron Ore, it never appears, please help with this trigger!

Code:
Iron Rock
    Events
        Destructible - A destructible within (Entire map) dies
    Conditions
        (Destructible-type of (Dying destructible)) Equal to Iron Rock
    Actions
        Set Random = (Random integer number between 1 and 10)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Random Less than or equal to 7
            Then - Actions
                Item - Create Iron Ore at (Position of (Dying destructible))
            Else - Actions
                Do nothing

What's wrong with my trigger?Ahhh and 'Random' is a integer variable.
 
Level 3
Joined
Jun 3, 2008
Messages
52
Maybe it has something to do with the fact that whenever you use "A destructible dies" event, it only monitors 64 (max) of those destructibles. I don't think there is a way of monitoring destructible's death for all of them on the map. Preferably, I think Iron Ore should have been a unit. (Just my own thought)
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
maybe you should leave out the "within entire region" thing as its unnecessary and check if you have the right type of rock selected as i guess there is more then one, and set random a number between 1 and 100 and use less or equal to 70, works better then 1-10 and 7
 
Level 17
Joined
Apr 13, 2008
Messages
1,609
First. Random number between 1 and 7 is much better than 1 and 70, so he did great.
What he didn't think of was this:
  • Destructible - A destructible within (Entire map) dies
Registers ONLY the first 64 destructible within the entire map.

I think your World Editor should warn you about this with tiny letters when you chose the event. If not get NewGen Pack.

The solution: use units. Make those iron rocks units and make a trigger with the event:
Generic event: unit dies.

Edit: oops, I just noticed that Freiddie already said that. Sorry for being redundant.
 
Level 8
Joined
Nov 2, 2007
Messages
160
u can also make an initialization trigger which adds all rocks deaths to the trigger as an event

  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Schleifen - Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Destructible-type of (Picked destructible)) is equal to (Your rock)
        • 'THEN'-Aktionen
          • Trigger - Add to Iron Rock <gen> the event (Destructible - (Picked destructible) dies)
        • 'ELSE'-Aktionen
 
Status
Not open for further replies.
Top