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.
 
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)
 
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
 
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.
 
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.
Back
Top