Silence'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.
Re: Help with WML
I tried it. I removed all the extra heroes, text, and events. The result is basically the bare bones of my scenario + this (below). The reason I felt the above code was causing the problem was because the error would appear whenever I tried to add it in.Anonymissimus wrote:Did you use this method for it ?Silence wrote:I narrowed the problem code down to this section
Code: Select all
[event]
name=last breath
[filter]
id=Rus'Kuk
[/filter]
[message]
speaker=Rus'Kuk
message= _ "Hmph! Our raiders have done our part. Forces, retreat!"
[/message]
[kill]
x,y=$x1,$y1
animate=no
[/kill]
[move_unit_fake]
type=Horseman
side=1
x=7,7,6
y=29,28,25
[/move_unit_fake]
{NAMED_NOTRAIT_UNIT 1 (Horseman) 6 28 (Messenger) (_"Messenger") }
[message]
speaker=Messenger
message= _ "Sir! Sir! I have a distress message for any nearby alied commanders with the Loyalists!"
[/message]
[endlevel]
result=victory
[/endlevel]
[/event]
Here's the bare bones code w/the event, if it helps.ERROR DETAILS:
Missing closing tag for tag objective at ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg:30 included from ~add-ons/Rise_of_the_Blade/_main.cfg:45.value " at ~add-ons/Rise_of_the_Blade/_main.cfg::46
Code:
-
- Posts: 252
- Joined: March 30th, 2011, 8:38 pm
- Location: The UK
Re: Help with WML
The error message is saying that line 35 of ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg their isprobable an [objectives] tag that you haven't closed, [/objectives]
Disclaimer: I'm not great at WML I just have had similar errors and fixed it this way.
Disclaimer: I'm not great at WML I just have had similar errors and fixed it this way.
Re: Help with WML
Code: Select all
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Defeat Enemy Leader"
condition=win
[/objective]
[objective]
description= _ "Turns run out"
condition=lose
[/objective]
[objective]
description= _ "Shaden dies"
condition=lose
[/objectives]
[/event]
[objective]
tag you didn't close.Crend
UMC Story Images — Story images for your campaign!
Re: Help with WML
blueknight1758 wrote:The error message is saying that line 35 of ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg their isprobable an [objectives] tag that you haven't closed, [/objectives]
Disclaimer: I'm not great at WML I just have had similar errors and fixed it this way.
Thanks, I fixed that.In this case, it's the last [objective] tag you didn't close.
Crend
I started adding in working pieces of code piece by piece, and the error now shows up as
Assuming I'm understanding that correctly, line 65 has an unclosed [side] tag.ERROR DETAILS:
Missing closing tag for tag side at ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg:65 included from ~add-ons/Rise_of_the_Blade/_main.cfg:45.value " at core/macros/utils.cfg:27 included from core/_main.cfg:6 included from _main.cfg:5 included from ~add-ons/Rise_of_the_Blade/scenarios/01_Rise::99included from ~add-ons/Rise_of_the_Blade/_main.cfg:45
Code: Select all
[side]
side=1
controller=human
team_name= _ "Your Forces"
type=Human Commander
id=Shaden
name= _ "Shaden"
canrecruit=yes
[unit]
x,y=22,11
type=Elvish Ranger
id=Hyriel
gender=female
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
[/modifications]
name= _ "Hyriel"
{IS_HERO}
[/unit]
[unit]
x,y=23,11
type=Elvish Vanquisher
id=Kaen
[modifications]
{TRAIT_LOYAL}
{TRAIT_QUICK}
[/modifications]
name= _ "Kaen"
{IS_HERO}
[/unit]
recruit=Elvish Fighter,Elvish Archer,Elvish Scout,Horseman,Mage,Elvish Shaman
{GOLD 100 50 0}
{INCOME 10 5 0}
[/side]
[side]
side=2
controller=ai
team_name= _ "Enemy Forces"
type=Orcish Warrior
id=Rus'Kuk
name= _ "Rus'Kuk"
canrecruit=yes
recruit=Goblin Rouser,Orcish Archer
{GOLD 75 95 100}
{INCOME 3 5 10}
[/side]
[side]
side=3
no_leader=yes
team_name=creature
user_team_name=_"Monsters"
[ai]
aggression=1.0
caution=-4.0
grouping=yes
village_value=0
[/ai]
[/side]
EDIT : I got a similar error after adding the last piece of code I originally dropped for debugging, the Error says there is an unclosed unit tag at line 87. The units there are:
Code: Select all
[unit]
x,y=22,11
type=Elvish Ranger
id=Hyriel
gender=female
[modifications]
{TRAIT_LOYAL}
{TRAIT_STRONG}
[/modifications]
name= _ "Hyriel"
{IS_HERO}
[/unit]
[unit]
x,y=23,11
type=Elvish Vanquisher
id=Kaen
[modifications]
{TRAIT_LOYAL}
{TRAIT_QUICK}
[/modifications]
name= _ "Kaen"
{IS_HERO}
[/unit]
Re: Help with WML
Error messages aren't always exactly correct. Look at the objectives error message above, it also stated a wrong unclosed tag (
However, I cannot see such a mistake in what you posted here, so I think it will be somewhere else in your scenario.
By the way,
Crend
objectives
instead of objective
).However, I cannot see such a mistake in what you posted here, so I think it will be somewhere else in your scenario.
By the way,
team_name
should not get translation marks. Instead, use user_team_name
for the displayed value (as you did it with side 3).Crend
UMC Story Images — Story images for your campaign!
Re: Help with WML
Added that, thanks again.Crendgrim wrote:Error messages aren't always exactly correct. Look at the objectives error message above, it also stated a wrong unclosed tag (objectives
instead ofobjective
).
However, I cannot see such a mistake in what you posted here, so I think it will be somewhere else in your scenario.
By the way,team_name
should not get translation marks. Instead, useuser_team_name
for the displayed value (as you did it with side 3).
I've looked over the scenario several times, and I honestly can't find what's wrong.
It's probably something obvious that I don't know, so here's the scenario code:
Spoiler:
Re: Help with WML
1. You have a doubled event opener:
2. You didn't close the last
I can only suggest to use a WML editor with syntax highlighting; the latter you would have seen very fast then. 
Crend
Code: Select all
[event]
name=last breath
[filter]
id="Rus'Kuk"
[/filter]
[event]
name=last breath
[filter]
id="Rus'Kuk"
[/filter]
messsage=_"..."
attribute:
Code: Select all
[message]
speaker=Kaen
message= _ "Why so much focus on this town? No, Hyriel, there are better areas that could be used as bases by the Orcs. Nevertheless, we must make haste before the town is lost.
[/message]

Crend
UMC Story Images — Story images for your campaign!
Re: Help with WML
What's that doing there? It's the definition of EXTRA_SCENARIO_MUSIC, but without #define. You don't need to define it anyway, it's a core macro.Silence wrote:Code: Select all
[+event] [music] name={MUSIC} append=yes [/music] [/event]
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
Re: Help with WML
Oops, I removed that.Ceres wrote: What's that doing there? It's the definition of EXTRA_SCENARIO_MUSIC, but without #define. You don't need to define it anyway, it's a core macro.
Yeah, I just downloaded a syntax highlighter for Notepad++, it's a lot easier to see everything now with the highlights.Crend wrote: 1. You have a doubled event opener:
2. You didn't close the last messsage=_"..." attribute:
I can only suggest to use a WML editor with syntax highlighting; the latter you would have seen very fast then.![]()
The scenario works again, thanks for the help everyone!

Re: Silence's WML Problems/Questions
As I seem to be encountering more weird errors that I can't identify as I develop my campaign further, I've decided to turn this in my WML Problem/Question thread.
Error:

Scenario:
---large block of code removed-----
What might also have been cause to the problem is that I tried copying a faction from a UME over to my scenario folder and adding an event using that UME's units in this scenario, but I got a giant error mess and removed that data temporarily until the scenario could work again. As usual, the error message is no help either since it's pointing a code that seems to have no errors. (Side tags starting at 102 should be completed and the starting villages macro at 120 should also be okay.)
Error:

Scenario:
---large block of code removed-----
What might also have been cause to the problem is that I tried copying a faction from a UME over to my scenario folder and adding an event using that UME's units in this scenario, but I got a giant error mess and removed that data temporarily until the scenario could work again. As usual, the error message is no help either since it's pointing a code that seems to have no errors. (Side tags starting at 102 should be completed and the starting villages macro at 120 should also be okay.)
Last edited by Silence on October 14th, 2011, 9:55 pm, edited 1 time in total.
Re: Silence's WML Problems/Questions
Your STARTING_VILLAGES_AREA macro gives villages to side 25. No idea if that's related to the error though.
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
- Pentarctagon
- Project Manager
- Posts: 5730
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Silence's WML Problems/Questions
If you can't figure out what the error is, you should follow this guide first. Even if you still can't find the problem, it makes it so anyone else doesn't have to read through the entire scenario.
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: Silence's WML Problems/Questions
Fixed, thanks.Ceres wrote:Your STARTING_VILLAGES_AREA macro gives villages to side 25. No idea if that's related to the error though.
I tried it. This seems to be the code that is causing the problem:Pentarctagon wrote:If you can't figure out what the error is, you should follow this guide first. Even if you still can't find the problem, it makes it so anyone else doesn't have to read through the entire scenario.
Code: Select all
[event]
name=turn 1
[message]
id=Shaden
message= _ "We've made it!"
[/message]
[message]
id=Hyriel
message= _ "And just in time, too."
[/message]
{NAMED_NOTRAIT_UNIT 3 Orcish Slayer 25 11 (Yora) (_"Yora")}
{GENERIC_UNIT 3 Orcish Grunt 24 10}
{GENERIC_UNIT 3 Orcish Grunt 26 10}
[message]
id=Yora
message= _ "They're discovered our plan to attack the city from behind! Quick, stop the reinforcements!"
[/message]
[/event]
- Alarantalara
- Art Contributor
- Posts: 789
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: Silence's WML Problems/Questions
Most obvious thing I see there is that "Orcish Grunt" is two arguments to the macro. You'll need to enclose your unit types in parentheses or otherwise mark them as a single unit.
Re: Silence's WML Problems/Questions
That appears to have been the problem as my campaign now works again.Alarantalara wrote:Most obvious thing I see there is that "Orcish Grunt" is two arguments to the macro. You'll need to enclose your unit types in parentheses or otherwise mark them as a single unit.
My next question : How do you add an attack to an existing unit (say a ranged attack to a Horseman) when the unit is being placed?