• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[AI] A.I tiered buildings.

Status
Not open for further replies.
Level 27
Joined
Nov 25, 2021
Messages
484
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?
 
Status
Not open for further replies.
Top