• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 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