• 🏆 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] 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....
 
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