• 🏆 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!

[Solved] Trees are generated strangely

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
316
I have this trigger to generate trees in order in a region.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Random_point_tree = (Center of (Playable map area))
      • Set Random_point_tree_2 = (Random_point_tree offset by (((Real((Random integer number between -5 and 5))) x 200.00), ((Real((Random integer number between -5 and 5))) x 200.00)))
      • Set Region_tree = (Region(Random_point_tree, Random_point_tree_2))
      • Game - Display to (All players) for 999.00 seconds the text: (Width: + (String((Width of Region_tree))))
      • Game - Display to (All players) for 999.00 seconds the text: (Height: + (String((Height of Region_tree))))
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Region_tree
      • For each (Integer A) from 1 to ((((Integer((Width of Region_tree))) / 200) + 1) x (((Integer((Height of Region_tree))) / 200) + 1)), do (Actions)
        • Loop - Actions
          • Game - Display to (All players) for 999.00 seconds the text: (X_minus: + (String(X_minus)))
          • Set Specific_point = (Point(((Max X of Region_tree) - X_minus), ((Max Y of Region_tree) - Y_minus)))
          • Set debug_points[(Integer A)] = Specific_point
          • Destructible - Create a Summer Tree Wall at Specific_point facing (Random angle) with scale 1.00 and variation (Random integer number between 0 and 9)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • X_minus Not equal to (Width of Region_tree)
            • Then - Actions
              • Set X_minus = (X_minus + 200.00)
            • Else - Actions
              • Set X_minus = 0.00
              • Set Y_minus = (Y_minus + 200.00)
              • Game - Display to (All players) for 999.00 seconds the text: (Y_minus: + (String(Y_minus)))
      • Custom script: call RemoveLocation (udg_Random_point_tree)
      • Custom script: call RemoveLocation (udg_Random_point_tree_2)
But when I run the map the trees are generated like this. Altough, it shows me that the distance between 1. and 2. row is the same as between 2. and 3. row, so I don't understand how it is possible.
WC3ScrnShot_071617_192656_01.tga
 

Attachments

  • WC3ScrnShot_071617_192656_01.tga
    7.9 MB · Views: 57
Level 11
Joined
Jun 2, 2004
Messages
849
Trees are placed on a grid (sort of like buildings). IIRC the blocks are 32 (maybe 64) distance units in width and height, so your distances between trees should be a multiple of that.

So instead of 200 distance units between trees try 128 or 256.
 
Status
Not open for further replies.
Top