tuggyne's WML questions
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.
tuggyne's WML questions
Edit: changed thread title accordingly
I've been trying to pass AI parameters to MP sides that can be either human or AI-controlled, but my approaches so far haven't worked reliably.The first was something like this:
Code: Select all
[ai]
village_value=0.25
aggression=0.1
caution=1.0
grouping=defensive
recruitment_pattern="fighter,fighter,archer,mixed fighter"
villages_per_scout=0.0
[/ai]
:debug
and :inspect
showed that the AI parameters were usually left at their defaults (although oddly it did work once in a while, I think?).Then I tried the
modify_ai
tag:
Code: Select all
[ai]
[modify_ai]
{AI_SIMPLE_ALWAYS_ASPECT village_value "0.25"}
{AI_SIMPLE_ALWAYS_ASPECT aggression "0.1"}
{AI_SIMPLE_ALWAYS_ASPECT caution "1.0"}
{AI_SIMPLE_ALWAYS_ASPECT grouping "defensive"}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,mixed fighter"}
{AI_SIMPLE_ALWAYS_ASPECT villages_per_scout "0.0"}
[/modify_ai]
[/ai]
Finally, I tried the event approach:
Code: Select all
[event]
name=start
[modify_ai]
[filter_side]
side=1
[/filter_side]
{AI_SIMPLE_ALWAYS_ASPECT village_value "0.25"}
{AI_SIMPLE_ALWAYS_ASPECT aggression "0.1"}
{AI_SIMPLE_ALWAYS_ASPECT caution "1.0"}
{AI_SIMPLE_ALWAYS_ASPECT grouping "defensive"}
{AI_SIMPLE_ALWAYS_ASPECT recruitment_pattern "fighter,fighter,archer,mixed fighter"}
{AI_SIMPLE_ALWAYS_ASPECT villages_per_scout "0.0"}
[/modify_ai]
[/event]
event
to take care of me.)(The event was verified as firing by sticking a
message
in it.)I tried searching for previous posts about this, but gave up when I realized that the forum search software filters out the term "ai" and splits tag names on underscores...
Last edited by tuggyne on June 25th, 2011, 5:13 am, edited 2 times in total.
- Pentarctagon
- Project Manager
- Posts: 5565
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: [ai],[modify_ai] tags seem to have trouble in MP
If you think you will be frequently posting with problems, then titling it "tuggyne's WML questions" would be a good title so you could ask all of the questions here instead of making a lot of separate threads.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: tuggyne's WML questions
Comparing this to another MP scenario I made with functioning AI parameters, I wonder if the problem is simply that
[side]
s with allow_player=yes
ignore any AI parameters they're passed -- which would, to say the least, be somewhat suboptimal!