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

A.I. - how to make it build custom buildings ?

Status
Not open for further replies.
Level 3
Joined
Jan 26, 2015
Messages
38
hello all!

i made a custom building derived from the orc Vodoo Lounge (item purchasing shop)

the custom building is called Coral Reef (id: ovln )

i did this for my custom naga race

even tho i can use the Ai to make it behave quite realistically ...i cant seem to make the AI build custom buildings

i am using JassCraft, and when programming, even using the item ID, it still wont work! :(

here is my beggining of my code:

Code:
   globals
        player MyVictim = Player( 0 )
    endglobals
     
    function ConfigureAI takes nothing returns nothing
        call SetSlowChopping( false )
        call SetPeonsRepair( true )
    endfunction
     
    function main takes nothing returns nothing
        call CampaignAI( 'nnfm', null )
        call ConfigureAI( )
        // **********************************
        // *      Building Strategy         *
        // **********************************
       
    call SetBuildUnitEx( 1, 1, 1, 'nntt' )  // nntt = Temple of tides 
    call SetBuildUnit( 10, 'nmpe')          // nmpe = Mur'Gul Slave
    call SetBuildUnitEx( 1, 1, 1, 'nnfm' )  // nnfm = Coral Bed  (supply)
[B][U]    call SetBuildUnitEx( 1, 1, 1, 'ovln' )  // ovln = Coral Reef  ( CUSTOM building)[/U][/B]
    call SetBuildUnitEx( 1, 1, 1, 'nnsg' )  // nnsg = Spawning Grounds
    call SetBuildUnitEx( 1, 1, 1, 'nnad' )  // nnad = Altar of the Depths
    call CampaignDefenderEx( 1, 2, 2, 'nnmg' ) // <==(2)    nnmg = Mur'Gul Slave
    endfunction

i have underlined the custom building above!

if i take that line out of the AI, the Ai builds just fine ....but if i leave it in, it bugs out - it piles up a ton of workers at the gold mine :(((

i need the custom building, because its a requirement for Spawning Grounds (the naga barracks) -- i added this requirement to slow the naga down and balance it out with the regular races, so i really need this to work !

anyone has a clue how to solve this ?

i will gladly share my Ai once i finished it ...thanks
 
Level 3
Joined
Jan 26, 2015
Messages
38
also..do you know how to code for randomness?

i.e. how to code the Ai so it RANDOMLY choses which hero to build 1st :), like 30% chance to choose 1st hero, 30% chance to choose 2nd hero, 30% chance to choose 3rd

many many thanks
 
Status
Not open for further replies.
Top