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

[AI] A.I tiered buildings.

Level 27
Joined
Nov 25, 2021
Messages
481
Let's say I have three buildings of tier 1,2,3 respectively: CUSTOM_HALL, CUSTOM_KEEP, CUSTOM_CASTLE.

But since the common.ai's TownCountEx function doesn't think of them as the same building, if I declare something like:

JASS:
    call SetBuildUnitEx( 1,1,1, CUSTOM_HALL                    )
    call SetBuildUnitEx( 1,1,1, CUSTOM_KEEP                    )
    call SetBuildUnitEx( 1,1,1, CUSTOM_CASTLE                )

The A.I will build 3 seperate buildings instead. Is there a way to edit common.ai (I'm on 1.31) to add lines like these to the TownCountEx function:

JASS:
    elseif unitid == CUSTOM_HALL then
        set have_qty = have_qty + GetUnitCountEx(CUSTOM_KEEP,false,townid) + GetUnitCountEx(CUSTOM_CASTLE,false,townid)
    elseif unitid == CUSTOM_KEEP then
        set have_qty = have_qty + GetUnitCountEx(CUSTOM_CASTLE,false,townid)

or is there a way to add them directly to my .ai files?
 
Top