WML questions: invalid wml
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.
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
Thanks.
For 3, I'm looking for a way to prevent ai from moving to certain locations but only temporarily.
For 3, I'm looking for a way to prevent ai from moving to certain locations but only temporarily.
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
See Customizing AI in Wesnoth 1.8 [modify_ai] tagbattlestar wrote:For 3, I'm looking for a way to prevent ai from moving to certain locations but only temporarily.
Code: Select all
[modify_ai]
side=2 # or whatever side
action=try_delete
path=aspect[avoid].facet[*]
[/modify_ai]
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
Thanks,
I think I get what it's saying, but what's an example of "{OLURFS_LAND}" when the wiki's talking about facets?
I think I get what it's saying, but what's an example of "{OLURFS_LAND}" when the wiki's talking about facets?
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
That's just a set of coordinates defined in scenario Hostile Mountains of mainline campaign Legend of Wesmere:battlestar wrote:I think I get what it's saying, but what's an example of "{OLURFS_LAND}" when the wiki's talking about facets?
Code: Select all
#define OLURFS_LAND
x=20-24,19-30,17-30,16-30,14-30,12-30,11-30,10-30,7-30,8-30,10-30,13-30,15-30,18-30,19-30,20-30,22-30,23-30,24-30,23-30,22-30
y=10,11,12,13-15,16-17,18-19,20,21,22,23,24,25,26,27,28-29,30,31-32 ,33-36,37,38-39,40
#enddef
EDIT: You do not have to set the [avoid] content as described on that wiki page though. You can simply use the standard method in the side definition (or in [modify_side]), e.g.:
Code: Select all
[ai]
[avoid]
x=1-10
y=5-8
[/avoid]
[/ai]
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
@ Mattsc: Thanks!
Nother question:
1.
Are the following values accessible by WML in single-player?
- recruits, recruit golds, recalls, advancements, losses, losses golds, kills, kills golds, dmg inflicted and dmg taken
(img borrowed from another thread)

2. Does anyone have any ideas about this?
Just made a small sprite,
as a wall decoration: 
Turns out that segment of the wall is divided by three hexes. Any ideas on how to place the decoration on the wall at the intended place?
Nother question:
1.
Are the following values accessible by WML in single-player?
- recruits, recruit golds, recalls, advancements, losses, losses golds, kills, kills golds, dmg inflicted and dmg taken
(img borrowed from another thread)
2. Does anyone have any ideas about this?
Just made a small sprite,
Turns out that segment of the wall is divided by three hexes. Any ideas on how to place the decoration on the wall at the intended place?
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
Regarding your first question, I don't know if there is a better way to achieve this, but you could count those things by yourself by using recruit, recall, advancement, kill, .. events and increasing variables for each of them.
UMC Story Images — Story images for your campaign!
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
1. Thanks, functionally that would do it. In case someone knows the variable names, it is still worth learning 
2. Question remains
3. Is there a way to make the time of day (ie. First watch, dawn) random?
Thanks

2. Question remains
3. Is there a way to make the time of day (ie. First watch, dawn) random?
Thanks
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
- Alarantalara
- Art Contributor
- Posts: 789
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: Question: halo and item images, undo ai?
For 2, there are a few ways.
If you use halo in item with a really big transparent image you can force things where you want. It wastes space, but works.
The terrain_graphics tag can be used for fine control over where things are placed. You could either use a macro similar to the camp fire one to place it at specific coordinates, or define a terrain so you can paint it with the map.
For 3, the various starting times each have their own macro for convenience in mainline.
Generate a random number and then use it to select a schedule. Use replace_schedule to set the desired schedule. You can use this to set a random schedule at the scenario start or change the time at random every turn, since I'm not sure which you intend.
If you use halo in item with a really big transparent image you can force things where you want. It wastes space, but works.
The terrain_graphics tag can be used for fine control over where things are placed. You could either use a macro similar to the camp fire one to place it at specific coordinates, or define a terrain so you can paint it with the map.
For 3, the various starting times each have their own macro for convenience in mainline.
Generate a random number and then use it to select a schedule. Use replace_schedule to set the desired schedule. You can use this to set a random schedule at the scenario start or change the time at random every turn, since I'm not sure which you intend.
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
Thanks for your reply.
2.
- I'm hoping to learn how to use terrain_graphics tag for this, but after reading the wiki page on it, I still have no idea how to apply it in this situation...
- Considered using halo, the image would be in front of any unit close enough to the wall. Curious why it would waste space, can't two halo images co-exist on the same tile?
- Also considered defining a terrain, but then there'd have to be a different terrain for each of the many wall-decorations. Saving this option as a last resort.
3. Changing time at random every turn is what I intended to ask, thanks.
2.
- I'm hoping to learn how to use terrain_graphics tag for this, but after reading the wiki page on it, I still have no idea how to apply it in this situation...
- Considered using halo, the image would be in front of any unit close enough to the wall. Curious why it would waste space, can't two halo images co-exist on the same tile?
- Also considered defining a terrain, but then there'd have to be a different terrain for each of the many wall-decorations. Saving this option as a last resort.
3. Changing time at random every turn is what I intended to ask, thanks.

LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
battlestar: I am in the process of updating AiWML with some of these things (not quite there yet, but working on it) and, in the process, am running a few more tests. While doing that, I noticed that [avoid] tags are not cumulative (nor are any of the other AI parameters). Rather, the latest tag you set up overrides all previous ones (as long as they apply to the same turns and times of day). So, you could also just override your old [avoid] setting withmattsc wrote:See Customizing AI in Wesnoth 1.8 [modify_ai] tagbattlestar wrote:For 3, I'm looking for a way to prevent ai from moving to certain locations but only temporarily.
Code: Select all
[modify_ai] side=2 # or whatever side action=try_delete path=aspect[avoid].facet[*] [/modify_ai]
Code: Select all
[modify_side]
side=2 # or whatever
[ai]
[avoid]
[not]
[/not]
[/avoid]
[/ai]
[/modify_side]
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
That indeed makes the code easier to read. Thanks!
When in the help menu, the game crashes completely when attempt is made to view the demon race information. Help appreciated.
I suspect this is the relevant code above.
When in the help menu, the game crashes completely when attempt is made to view the demon race information. Help appreciated.
Code: Select all
[race]
id=Demon
name=Demon
plural_name="Demons"
male_name="Demon"
female_name="She-Devil"
description="..." male_names="Aamon,Agares,Alastor,Amon,Asura,Balam,Barbatos,Bathin,Buer,Caim,Cimejes,Crocell,Demogorgon,Dmitryus,Eleksha,Fleuretty,Foras,Gremory,Gusion,Halphas,Ipos,Kasdaye,Labal,Kulak,Leraje,Marax,Marbas,Marchosias,Malphas,Mathim,Moloch,Murmur,Naberus,Naphula,Orobas,
Oriax,Oray,Phenex,Pithius,Purson,Pruflas,Ramu,Ronove,Sallos,Seere,Scox,Shaitan,Shax,Sitri,Stolas,Surgat,Tartaruchi,Temeluchus,Vacca,Valefar,Vassago,Vepar,Verrine,Volac,Vual,Xitragupten,Xaphan,Zaebos,Zapar,Zemeu,Zizo"
female_names="Aul,Ainne,Annatwa,Aeda,Anthrace,Bosie,Bodna,Bonnie,Berjanas,Bierllie,Curuise,Clarai,Dorsephine,Eko,Emxxy,Estrogae,Fanora,Flutter,Graxy,Jessx,Jexxie,Kissie,Kmelia,Kaura,Luxxy,Lovyair,Nitsuj,Nerai,Rebeib,Sweetums,Snoogiesweetiepoo,Testanny,Bokie,Jokie,Lekie,
Mikie,Kikie,Fikie,Sapie,Lepie,Supie,Grukie,Pinla,Pinda,Pinsar,Pinpi"
ignore_global_traits=yes
num_traits=1
{TRAIT_QUICK}
{TRAIT_INTELLIGENT}
{TRAIT_RESILIENT}
{TRAIT_STRONG}
[/race]
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
Can anyone think of any cause for the bug above?
New question:
Trying to insert 30 variables into [unit][variables] with a loop, and my variable naming is wrong but I have no knowledge of what's the correct way to do this.
Thanks.
New question:
Trying to insert 30 variables into [unit][variables] with a loop, and my variable naming is wrong but I have no knowledge of what's the correct way to do this.
Code: Select all
{FOREACH 30 i}
[modify_unit]
[filter]
id={ID}
[/filter]
[variables]
item_slot[$i].name="Empty"
[/variables]
[/modify_unit]
{NEXT i}
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
About the new question: well, WML has a [while] loop. If you'd like to have a macro, there's REPEAT.
REPEAT's loop variable is called
REPEAT's loop variable is called
REPEAT_i
and it's starting with 0.Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
- battlestar
- Posts: 690
- Joined: January 1st, 2007, 7:12 am
Re: Question: halo and item images, undo ai?
Thanks, and there's still the problem with "item_slot[$i].name" not being a valid variable name... in this context, it seems. It's given me error messages that stated that both "[" and "$" are unexpected characters in this setting.
LUA: Llama Under Apprenticeship
Hell faction: completed
Hell faction: completed
Re: Question: halo and item images, undo ai?
Maybe that's a technical limitation of [modify_unit]. Have you tried to store, modify
stored_unit.variables.item_slot[$i].name
and unstore?Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons