🏆 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!
So I'm making this unit move using SetUnitX/Y but whenever the unit goes out of the map boundaries(the black area) then the game suddenly crashes, so how can I *detect* if the unit is going out of map boundaries and teleport the unit away from it ?
You can check if if x/y is still in map.
In JASS for example you save max/min values of x/y of map bounds,
and then make comparisons if your x/y are in between.
Be aware that flying units directly at the border of the map have been known to crash even though they are still in map bounds. As such you really need a few tiles boundary around your map on top of the x/y inside map bounds.
In JASS for example you save max/min values of x/y of map bounds,
and then make comparisons if your x/y are in between.
It'll ensure that units will stay within the map boundaries. It is much more convenient than having to check map bounds every time you use SetUnitX/SetUnitY.
Sorry for the late reply xD,
I think I'll try to do it with GUI first, but if I can't then I'll try and use that vJass code PurgeandFire posted Thx guys
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.