AI leader wont recruit on turn 1. why? how?

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

Post Reply
RoddyVR
Posts: 38
Joined: June 6th, 2005, 5:40 pm
Location: eastern US

AI leader wont recruit on turn 1. why? how?

Post by RoddyVR »

the AI leader in my scenario can only recruit peasants, and he starts with 8 gold and then makes 8 gold a turn.
i want him to recruit a peasant every turn, why is he being stubborn and not recruiting on on the first turn.
does the AI have some wierd "keep some cash in reserve" thing or something?

here's the [side]
[side]
side=2
controller=ai
team_name=1
description=Lord Grishan
type=Grand Marshal
canrecruit=1
recruit=Peasant
village_gold=0
[ai]
{NO_SCOUTS}
passive_leader=yes
recruitment_pattern=fighter
villages_per_scout=0
[/ai]
{GOLD 8 8 8}
{INCOME 6 6 6}
[/side]
the {no_scouts} thing i just added, but it didnt help either. not sure what (if anything) it does, but saw it somewhere and figured i'd try.
claus
Posts: 186
Joined: April 4th, 2005, 5:51 am

Post by claus »

Have you tested recruitment_ignore_bad_combat=yes
RoddyVR
Posts: 38
Joined: June 6th, 2005, 5:40 pm
Location: eastern US

Post by RoddyVR »

didnt have that one. added it. didnt help.
i have the suspicion that its because the thing wants to recruit scouts. but there are no scouts in its list (cause all it has is pesants)

the lands around it are mostly grassland and villages. there's a big river on the map (takes almost half the map proly) though, so maybe it wants to recruit water dwellingn units.

i'm trying to thing of a scenario where the recruitment possibilities are similar where the ai recruits on the first turn.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

take out passive_leader

If you want him to stay put in his keep, you might want to add a leader goal (set to the keep's location), but I don't know what effect that will have on recruiting.
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

if he just dont recruit unit in first turn just create it.
RoddyVR
Posts: 38
Joined: June 6th, 2005, 5:40 pm
Location: eastern US

Post by RoddyVR »

ye, may have to resort to droping his starting gold to 8 and making his first unit for him. (hope that dont make him not recruit on second turn).

the "leader goal" thing without "passive leader" works better then i expected. he walks away from the keep, but not for more then one turn. which is basicaly ideal for what i wanted from him. thanks scott.


got another problem now.

cant get the [teleport] thing to work.
well, i can get it to teleport the right unit at the right time, but not to where i want it to.

i've got it in a "moveto" event, and what i want it to do is teleport the unit one hex down (south) from whereever that unit moved to. (to prevent a player from crosing an artificial boundry).
everything works except that for some reason i cant seem to figure out the syntax for the "x1, y1" variables that i should be able to use inside the moveto event.
do they not work if i go inside another tag (meainin inside teleport) or am i just not puting the right type of brackets around the variables or something?

here's the event:

Code: Select all

#the girl cant swim
[event]
  name=moveto
  first_time_only=no
  [filter]
    description=Daira
    x=01,02,03,03,03,04,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20
    y=16,16,16,17,18,15,18,16,16,16,16,16,15,15,15,16,16,16,16,16,15,16,16
  [/filter]
  [message]
    speaker=unit
    message="Oh no.  What am I thinking, I cant swim."
  [/message]
  [teleport]
    [filter]
      description=Daira
    [/filter]
    x=20
    y=20
  [/teleport]
[/event]
right now it works. it teleports to 20,20.
but if i do
x=x1
y=y1+1
which is what i want it to be, then it dont work, but i cant figure out why.
x=x1
y=20
doesnt work either.
so i think i'm doing something wrong with the syntax.
should i put x1 in to {}???
or do i need to somehow use the [variable] or [set_variable] things. not sure how exactly they work yet, so not sure if they even apply here.
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

i think you should use "$":

Code: Select all

x=$x1
y=$y+1
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

tomsik wrote:i think you should use "$":

Code: Select all

x=$x1
y=$y+1
You can't do math like that in a sentence. You need to use {VARIABLE_OP y add 1} to add 1 to y before the action.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
RoddyVR
Posts: 38
Joined: June 6th, 2005, 5:40 pm
Location: eastern US

Post by RoddyVR »

cool. you're half right.
x=$x1
y=20
WORKED!!!!

so i do need the $ there.
however
y=$y1+1
didnt work.
so that means i gotta do the computation seperately. but now that i know taht atleast part of it works, i'm sure i can get the rest to work. though if someone knows for sure hwo to do it, that'd save me some trial and error time.

EDIT: took too long to post.
thanks for the last piece MadMax.
Post Reply