• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Items randomly dont spawn

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey guys...

I was trying to make some kind of custom resources...Now for some reason...i have no idea why, my items randomly dont spawn. It drives me absolutely crazy, because i cant find the error....
anyone able to solve this?

  • Wood
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Tree
    • Actions
      • Item - Create Wood at (Position of (Dying destructible))
      • Item - Set charges remaining in (Last created item) to (Random integer number between 1 and 5)
  • Stone
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
      • (Destructible-type of (Dying destructible)) Equal to Rocks
    • Actions
      • Item - Create Stone at (Position of (Dying destructible))
      • Item - Set charges remaining in (Last created item) to (Random integer number between 1 and 5)
P.S.: for some reason the trees work absolutely fine, but the rocks dont....
 
Level 18
Joined
Nov 21, 2012
Messages
835
your solution will work only for small regions with not more then 64 destructables inside, use this method instead:
  • init1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Trigger - Add to summertreeDies <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
  • summertreeDies
    • Events
    • Conditions
    • Actions
      • Item - Create Tome of Experience at (Position of (Dying destructible))
 
Level 7
Joined
Sep 19, 2012
Messages
204
your solution will work only for small regions with not more then 64 destructables inside, use this method instead:
  • init1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Trigger - Add to summertreeDies <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
  • summertreeDies
    • Events
    • Conditions
    • Actions
      • Item - Create Tome of Experience at (Position of (Dying destructible))

+rep (Edit: the hive wont let me do this a 2nd time in a row -.-)

Thank you very much :)
id never come to an idea like that Oo Can you explain me why this works and the other way not? i guess its just another strange world editor behaviour thingy huh? :ogre_icwydt:
 
Level 14
Joined
Nov 30, 2013
Messages
926
Can you explain me why this works and the other way not? i guess its just another strange world editor behaviour thingy huh? :ogre_icwydt:

It would add the picked destructibles into the 2nd trigger as an event of a destructible dies like that. (Like variable)
That way, the trigger will worked fine when one of the destructibles dies.

Like ZiBitheWand3r3r stated, that event only picks up any destructibles with a maximum of 64 of them.

However, if you tried to remove the destructible that was already added into the trigger, it will leak as that event of that destructible that had already removed, remains though.
 
Status
Not open for further replies.
Top