AI Leader Won't Recruit

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
CraZCanuck
Posts: 9
Joined: November 6th, 2020, 4:45 am

AI Leader Won't Recruit

Post by CraZCanuck »

Hi all,

Can't tell if it's something to do with my map, or with my scenario code, but the ai leader in my scenario refuses flat-out to recruit.

I have the following code for recruiting:

Code: Select all

 
 
 [side]
	controller="ai"
	income=2
	side=2
	team_name=2
	user_team_name=_"Vuenguar"
	[unit]
		canrecruit=yes
		id=Ghajaan
		name= _ "Ghajaan"
		type="Dune Spearmaster"
		unrenamable=yes
		profile=portraits/humans/javelineer.png
		x=42
		y=3
		{GOLD 200 250 300}
#ifdef EASY
        recruit=Dune Rover, Dune Soldier, Dune Rider, Dune Rider, Dune Piercer, Dune Burner, Dune Herbalist
#endif
#ifdef NORMAL
        recruit=Dune Rider, Dune Rider, Dune Piercer, Dune Piercer, Dune Burner, Dune Herbalist
#endif
#ifdef HARD
        recruit=Dune Rider, Dune Piercer, Dune Raider, Dune Sunderer, Dune Soldier, Dune Rover, Dune Herbalist
#endif
	[/unit]
[/side]

The .map in question is also attached, in case maybe i've messed something up there? The spot noted for 'Player 2' has the AI leader, and he will not recruit at all...
desert_skirmish.map
(4 KiB) Downloaded 146 times
User avatar
Pentarctagon
Project Manager
Posts: 5527
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: AI Leader Won't Recruit

Post by Pentarctagon »

You'll want recruit to be part of [side] rather than [unit]. [unit] would be extra_recruit.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: AI Leader Won't Recruit

Post by Helmet »

Are you sure your difficulty modes are "EASY", "NORMAL" and "HARD" and not something else?

Do you need quotes around ai. I don't recall ever seeing anybody use quotes there.

That's all the guesses I got.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
User avatar
lhybrideur
Posts: 357
Joined: July 9th, 2019, 1:46 pm

Re: AI Leader Won't Recruit

Post by lhybrideur »

I think Pentarctagon solution is what is wrong with your code
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: AI Leader Won't Recruit

Post by Helmet »

Pentarctagon likely identified the bug.

I wonder if changing [unit] to [leader] would fix it. Just curious.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
CraZCanuck
Posts: 9
Joined: November 6th, 2020, 4:45 am

Re: AI Leader Won't Recruit

Post by CraZCanuck »

Pentarctagon wrote: November 18th, 2020, 5:42 am You'll want recruit to be part of [side] rather than [unit]. [unit] would be extra_recruit.
Thanks! That's done the trick. <3
Post Reply