• 🏆 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] Weird crash regarding Pathing Map/AI

Status
Not open for further replies.
Level 27
Joined
Nov 25, 2021
Messages
481
In one of my maps, I have a computer-controlled base for Player(24) (let's call it P24Base for simplicity's sake) and everytime Player(24) tries to rebuild (with call SetBuildUnitEx in its AI file), the game crashes.

After a painstaking session of testing, I found out that the issue is not in buggy Triggers or Player Properties, but instead lies in one custom building in P24Base that has its Pathing Map set to None. I knew that's the case because I reset its Pathing Map to default and nothing crashes anymore.

So, what I want to ask is, why is the combination of SetBuildUnitEx and Pathing Map - None results in a crash?
 
Level 12
Joined
Jan 10, 2023
Messages
191
Totally guessing:

The AI tries to place it, checks where it will fit, and it fits anywhere/ no where because it has no pathing.

A blank pathing (.tga) file may be your best bet.

Make it a 4 pixel x 4 pixel empty image for something farm sized

2x2 is the smallest blank .tga file, if you make a 1x1 it will make a 2x2 and put your 1x1 at the bottom-left of a blank .tga
(so in this case where the 1x1 is also blank you won't notice, but just keep that in mind)

If you make a 3x3 I'm guessing it will put it at the bottom-left of a 4x4 pixel .tga

EDIT: I believe the editor has a blank .tga/ pathing map for the unit called "Zone Indicator"
If you find that object, use its pathing map so you don't need to import
 
Last edited:
Level 27
Joined
Nov 25, 2021
Messages
481
EDIT: I believe the editor has a blank .tga/ pathing map for the unit called "Zone Indicator"
If you find that object, use its pathing map so you don't need to import
Yep, I just noticed that there is the Zone Indicator thing in Pathing Map. Thanks for bringing it to my attention.

The AI tries to place it, checks where it will fit, and it fits anywhere/ no where because it has no pathing.

A blank pathing (.tga) file may be your best bet.

Make it a 4 pixel x 4 pixel empty image for something farm sized

2x2 is the smallest blank .tga file, if you make a 1x1 it will make a 2x2 and put your 1x1 at the bottom-left of a blank .tga
(so in this case where the 1x1 is also blank you won't notice, but just keep that in mind)

If you make a 3x3 I'm guessing it will put it at the bottom-left of a 4x4 pixel .tga
Also, I now know how Pathing Map actually works, so thank you as well.

As for the weird bug itself, the structure that causes crash (I'll call it StructureC also for simplicity) is not the one the A.I is trying to build. StructureC is only there as a Neutral Passive unit for gameplay reason, while the A.I only tries to build vanilla structures like Barracks or Blacksmith. Simply because of the fact that StructureC exists in their base, the game crashes. When I (User) tries to build, it's also fine. When I move Player(24)'s base to a different location away from StructureC, everything also works fine.

Guess I just chalk this up to another stupid bug of Warcraft, instead of trying to figure out the logic behind such fuckery.
 
Level 12
Joined
Jan 10, 2023
Messages
191
Glad it partly worked out for you.

The only other thing I could think of you might check is to change the terrain in the position of that building to something walkable but not buildable, like stone or tiles, can't make any promises and it sounds like we're over it anyway, but maybe they are trying to build on top of it ?

Thinking if the spot isn't buildable it might not have an issue, but for all I know there could be a million and one things the AI script doesn't like, I've never worked with them before...
 
Status
Not open for further replies.
Top