• 🏆 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] Filling map with doodads

Status
Not open for further replies.
Level 2
Joined
Aug 27, 2012
Messages
18
Hi. I use this trigger to fill map with blocks:

  • Trigger
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • For Each (Integer B) from 0 to 78. do (Actions)
        • Loop - Actions
          • For Each (Integer A) from 0 to 78. do (Actions)
            • Loop - Actions
              • Set Random100 = (Random integer number between 1 and 100)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random100 Greater than 20
                • Then - Actions
                  • Set StartX = ((Min X of (Playable map area)) + 384.00)
                  • Set StartY = ((Min Y of (Playable map area)) + 384.00)
                  • Set Temp_Point = (Point((StartX + ((Real((Integer A))) x 128.00)), (StartY + ((Real((Integer B))) x 128.00))))
                  • Destructible - Create a Stone at Temp_Point facing 0.00 with scale 1.70 and variation 0
                  • Custom Script: call RemoveLocation (udg_Temp_Point)
                • Else - Actions
It fills only half of my map! Why?
I want to create less than 79*79=6241 destructibles. It should fill almost entire map!

I use NewGen.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
And where's the screenshot showing how your map is after this being done? If it doesn't fill the whole map, probably the random integer isn't allowing it.
 
Level 2
Joined
Aug 27, 2012
Messages
18
Thanks, adding 0sec TriggerSleepAction solved my problem! It takes a few seconds to generate, but it's OK.
 
Status
Not open for further replies.
Top