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

[AI] nomad cant build?

Status
Not open for further replies.

zzc

zzc

Level 3
Joined
Apr 25, 2016
Messages
20
Does ai always need pre placed buildings to start? all I put on the map is 2 workers and the 2 heroes. It wont start building.

JASS:
//============================================================================
//  $Id: u04x08.ai,v 1.1.2.2 2003/05/10 10:19:22 abond Exp $
//============================================================================
globals

    player target = Player( 1 )
	player target2 = Player( 9 )
	player target3 = Player( 0 )
	
	integer victim = 0
	
    constant integer GATE             = 'ndmg' 
	constant integer DEMON1             = 'ndqt' 
	constant integer DEMON2             = 'nfov' 
	constant integer DEMON3             = 'nina' 
	constant integer DEMON4             = 'nndr' 
	constant integer DEMON5             = 'nsll' 
	constant integer DEMON6             = 'nmmu' 
	constant integer DEMON7             = 'nmgd' 
	constant integer DEMON8             = 'nsrw' 
	constant integer NAGASUMMON             = 'nnsu' 
	

endglobals



//============================================================================
//  main
//============================================================================
function main takes nothing returns nothing
    call CampaignAI(NAGA_CORAL,null)

    set campaign_gold_peons = 0
    set campaign_wood_peons = 0

	
    //call SetCaptainHome(BOTH_CAPTAINS,2624,-6496)	




    call SetBuildUnitEx( 2, 2, 2, NAGA_TEMPLE   )
    call SetBuildUnitEx( 2, 2, 2, NAGA_SHRINE   )
    call SetBuildUnitEx( 2, 2, 2, NAGA_SPAWNING )
    call SetBuildUnitEx( 2, 2, 2, NAGA_ALTAR    )
    call SetBuildUnitEx( 5, 5, 5, NAGA_SLAVE    )
    call SetBuildUnitEx( 5, 5, 5, NAGA_GUARDIAN )
    call SetBuildUnitEx( 2, 2, 2, GATE   )
	
	call CampaignDefenderEx( 2,2,2, NAGA_MYRMIDON   )
	call CampaignDefenderEx( 5, 5, 5, NAGA_COUATL   )
	call CampaignDefenderEx( 2,2,2, NAGA_SNAP_DRAGON   )
	call CampaignDefenderEx( 5, 5, 5, NAGA_SIREN   )
	call CampaignDefenderEx( 5, 5, 5, NAGA_ROYAL   )
	call CampaignDefenderEx( 5, 5, 5, NAGASUMMON   )
	call CampaignDefenderEx( 2,2,2, DEMON1   )
	call CampaignDefenderEx( 2,2,2, DEMON2   )
	call CampaignDefenderEx( 2,2,2, DEMON3   )
	call CampaignDefenderEx( 2,2,2, DEMON4   )
	call CampaignDefenderEx( 2,2,2, DEMON5   )
	call CampaignDefenderEx( 2,2,2, DEMON6   )
	call CampaignDefenderEx( 2,2,2, DEMON7   )
	call CampaignDefenderEx( 2,2,2, DEMON8   )
	

	
    call SetBuildUpgrEx( 1,1,1, UPG_SIREN           )
    call SetBuildUpgrEx( 1,1,1, UPG_NAGA_ATTACK     )
    call SetBuildUpgrEx( 1,1,1, UPG_NAGA_ARMOR      )
    call SetBuildUpgrEx( 1,1,1, UPG_NAGA_ENSNARE    )
	
    call SetBuildUpgrEx( 2,2,2, UPG_SIREN           )
    call SetBuildUpgrEx( 1,1,1, UPG_NAGA_ABOLISH    )
    call SetBuildUpgrEx( 2,2,2, UPG_NAGA_ATTACK     )
    call SetBuildUpgrEx( 2,2,2, UPG_NAGA_ARMOR      )
	
    call SetBuildUpgrEx( 3,3,3, UPG_NAGA_ATTACK     )
    call SetBuildUpgrEx( 3,3,3, UPG_NAGA_ARMOR      )

    loop //Init the infinite attack loop
	
        call InitAssaultGroup()
        call CampaignAttackerEx( 5, 5, 5, NAGA_COUATL   )
		call CampaignAttackerEx( 1, 1, 1, NAGA_VASHJ        )
		call CampaignAttackerEx( 5, 5, 5, NAGA_SNAP_DRAGON   )
		call CampaignAttackerEx( 5, 5, 5, NAGA_SIREN   )
		call CampaignAttackerEx( 5, 5, 5, NAGA_TURTLE   )
		call CampaignAttackerEx( 5, 5, 5, NAGA_MYRMIDON   )
		call CampaignAttackerEx( 5, 5, 5, NAGA_ROYAL   )
		call CampaignAttackerEx( 5, 5, 5, NAGASUMMON   )		
        call SuicideOnPlayerEx(M1,M1,M1,target)
		
		call InitAssaultGroup()
		call CampaignAttackerEx( 1, 1, 1, NAGA_SORCERESS        )
		call CampaignAttackerEx( 5, 5, 5, DEMON1   )
		call CampaignAttackerEx( 5, 5, 5, DEMON2   )
		call CampaignAttackerEx( 5, 5, 5, DEMON3   )
		call CampaignAttackerEx( 5, 5, 5, DEMON4   )
		call CampaignAttackerEx( 5, 5, 5, DEMON5   )
		call CampaignAttackerEx( 5, 5, 5, DEMON6   )
		call CampaignAttackerEx( 5, 5, 5, DEMON7   )
		call CampaignAttackerEx( 5, 5, 5, DEMON8   )		
		call SuicideOnPlayerEx(M1,M1,M1,target)

	
	endloop
	
    call InitBuildArray()
    set do_campaign_farms   = false

	
    call SleepForever()

endfunction

no syntax errors in checker.
resource is set to 100k each, gets replenished via trigger
 

zzc

zzc

Level 3
Joined
Apr 25, 2016
Messages
20
ai is so rigid

The ai builds in circles, outwards from a gold mine.

How does the chaos orcs in the final tft human mission function?? they only chop wood... but have preplaced buildings.

I was trying to imitate that one.

Anyway I moved it away from its ally base - apparently ai dont like building too near each other.... more so if theres alot in build list.

If 2 allied ai workers are trying to build in the same spot, everything stops.
 

zzc

zzc

Level 3
Joined
Apr 25, 2016
Messages
20
yea i guessed that too. anyway it works now but a different problem.
 
Status
Not open for further replies.
Top