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

[Solved] 2D Board in Warcraft 3

Status
Not open for further replies.
Level 13
Joined
Jun 20, 2014
Messages
479
Im trying to make a 2d board in warcraft 3 and i got an initial code below but somehow it doesnt behave the way i want it. i havent mod i dont know maybe a year or two now. pls help me. thanks.

  • Initialization
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set WIDTH = 14
      • Set HEIGHT = 13
      • Set _initialPoint = (Position of Summer Tree Wall 0000 <gen>)
      • For each (Integer _widthLooper) from 0 to (WIDTH - 1), do (Actions)
        • Loop - Actions
          • For each (Integer _heightLooper) from 0 to (HEIGHT - 1), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Footman for Player 1 (Red) at (Point(((X of _initialPoint) + ((Real(_widthLooper)) x 512.00)), ((Y of _initialPoint) + ((Real(_heightLooper)) x 512.00)))) facing Default building facing degrees
ill also attach the test map
 

Attachments

  • board experiment.w3x
    17.2 KB · Views: 24

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
Works fine, just you are placing the grid off the top of the map. The grid reference corner (lower left) is placed at the top left of the map.

North -> Positive Y
East -> Positive X
South -> Negative Y
West -> Negative X

The following kind of makes a grid of footmen
  • Initialization
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set WIDTH = 14
      • Set HEIGHT = 13
      • Set _initialPoint = (Position of Summer Tree Wall 0000 <gen>)
      • For each (Integer _widthLooper) from 0 to (WIDTH - 1), do (Actions)
        • Loop - Actions
          • For each (Integer _heightLooper) from 0 to (HEIGHT - 1), do (Actions)
            • Loop - Actions
              • Unit - Create 1 Footman for Player 1 (Red) at (Point(((X of _initialPoint) + ((Real(_widthLooper)) x 512.00)), ((Y of _initialPoint) + ((Real(_heightLooper)) x -512.00)))) facing Default building facing degrees
Changing the Y axis step from 512 to -512 makes the grid appear fully on the map.

Alternatively you could move the reference point to the lower left of the map.
 
Status
Not open for further replies.
Top