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

Default Orc AI interpretation

Status
Not open for further replies.
Level 4
Joined
May 1, 2011
Messages
81
Hello there. When I found out the pattern of the Orc AI (meaning how does the computer building their base) extracted from the war3.mpq, then when I open the orc.ai under the war3mpq/scripts, I found this:

JASS:
// need a peon or nothing will get built
    //
    if c_great_hall_done >= 1 then
        set peons = 6 - GetWood() / 200
        if peons < 3 then
            set peons = 3
        endif
        if c_mines < 2 or c_great_hall_done < 2 then
            set peons = peons + 5
        else
            set peons = peons + 10
        endif
        if peons > 15 then
            set peons = 15
        endif
        call SetBuildNext( peons, PEON )
    endif


I want to imitate into my new Orc AI script but with different unit-type, so can anybody explain what is this talking about mentioned above?
 
JASS:
// need a peon or nothing will get built
    //
    //this line checks if there is aleady a great hall present
    if c_great_hall_done >= 1 then
        //here we set the number of peons
        set peons = 6 - GetWood() / 200
        //if the peons from the above formula is less than three, we make it three
        if peons < 3 then
            set peons = 3
        endif
        //if the player has below 2 mines or below 2 great halls, we set the number of peons to 5
       //else we set it to 10
        if c_mines < 2 or c_great_hall_done < 2 then
            set peons = peons + 5
        else
            set peons = peons + 10
        endif
        //if peons where above 15, we reduce them to 15
        if peons > 15 then
            set peons = 15
        endif
        //Not sure, but I believe this line makes the engine process the building settings
        call SetBuildNext( peons, PEON )
    endif
 
Level 4
Joined
May 1, 2011
Messages
81
I saw there was a MELEE_NEWBIE difficulty in this ai script. I'm going to set the Misc - Melee Difficulty Level under the AI editor's condition. So what will be the integer for MELEE_NEWBIE difficulty?
 
Status
Not open for further replies.
Top