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

How to WorldBounds

Status
Not open for further replies.
  • Custom script: if GetLocationX(udg_Orbit_loc2) > WorldBounds.maxX then
  • Custom script: call SetUnitX(udg_Orbit_orbiter, WorldBounds.maxX)
  • Custom script: else
  • Custom script: if GetLocationX(udg_Orbit_loc2) < WorldBounds.minX then
  • Custom script: call SetUnitX(udg_Orbit_orbiter, WorldBounds.minX)
  • Custom script: else
  • Custom script: call SetUnitX(udg_Orbit_orbiter, GetLocationX(udg_Orbit_loc2))
  • Custom script: endif
  • Custom script: endif
  • Custom script: if GetLocationY(udg_Orbit_loc2) > WorldBounds.maxY then
  • Custom script: call SetUnitY(udg_Orbit_orbiter, WorldBounds.maxY)
  • Custom script: else
  • Custom script: if GetLocationY(udg_Orbit_loc2) < WorldBounds.minY then
  • Custom script: call SetUnitY(udg_Orbit_orbiter, WorldBounds.minY)
  • Custom script: else
  • Custom script: call SetUnitY(udg_Orbit_orbiter, GetLocationY(udg_Orbit_loc2))
  • Custom script: endif
  • Custom script: endif
Am I doing this right??? Is that how you're supposed to use WorldBounds? I figured I'd compare the values to it's min/max X and Y and set the X and Y to the WorldBounds values if they're beyond them.
 
Status
Not open for further replies.
Top