Silence's WML Questions

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.
User avatar
Silence
Posts: 40
Joined: September 3rd, 2011, 1:13 am

Silence's WML Questions

Post by Silence »

Putting my WML Questions here.
Old stuff for posterity.:
Last edited by Silence on November 14th, 2013, 8:30 pm, edited 15 times in total.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Help with WML

Post by 8680 »

Don't use whitespace in filepaths. Replace the spaces with underscores.
User avatar
BlackJack25
Posts: 78
Joined: July 26th, 2011, 10:50 am
Location: Italy

Re: Help with WML

Post by BlackJack25 »

First of all, like 8680 said, you have to replace the spaces in the filepaths with underscores (here, for example: {add-ons/Rise_of_the_Blade/units} ).
Then, I think the error is in the define="". You wrote define="CAMPAIGN_RISE_OF_THE_SWORDSMAN" while your campaign id is Rise_of_the_Blade. Replace the define with define="RISE_OF_THE_BLADE". Do the same in #ifdef CAMPAIGN_RISE_OF_THE_SWORDSMAN.
Ah, in first_scenario=1Rise it is better if you writes 01_Rise. Do the same in the following scenarios.
I hope I was helpful ;)
Sorry for some english errors, but I'm Italian ;-)
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Help with WML

Post by Crendgrim »

As long as define= and #ifdef are referring to the same value, this shouldn't be a problem.


Crend
UMC Story Images — Story images for your campaign!
User avatar
BlackJack25
Posts: 78
Joined: July 26th, 2011, 10:50 am
Location: Italy

Re: Help with WML

Post by BlackJack25 »

Maybe just the spaces in the filepaths or the scenario "1Rise" are causing the error?
Sorry for some english errors, but I'm Italian ;-)
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Help with WML

Post by Crendgrim »

Why should 1Rise cause the problem? It's the same in the _main.cfg and the scenario config.
However, I really recommend doing what you proposed (renaming both), but it should work without. ;)


Crend
UMC Story Images — Story images for your campaign!
User avatar
Silence
Posts: 40
Joined: September 3rd, 2011, 1:13 am

Re: Help with WML

Post by Silence »

The renaming got rid of my first error, but now I have another error appearing when I try to load it:
Error
An error due to possibly invalid WML occurred

The error message is:
A map without a header is not supported.

When reporting the bug please include the following error message:
Condition'!(header_offset==std::string::npos || comma_offset<header_offset)' failed at src\map.cpp:163 in function 'read'.
What does this mean?
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Help with WML

Post by Ceres »

Did you also remove all whitespaces from the map path?
User avatar
Silence
Posts: 40
Joined: September 3rd, 2011, 1:13 am

Re: Help with WML

Post by Silence »

Ceres wrote:Did you also remove all whitespaces from the map path?
Yes. I've changed the map name to "Small_Battlefield.map" and changed the relevant code to:

Code: Select all

 
  name=Rise of the Swordsman
  victory_when_enemies_defeated=yes
  map_data="{~add-ons/Rise of the Blade/maps/Small_Battlefield.map}"
  turns=20
 
The error still occurs though.
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: Help with WML

Post by Crendgrim »

Your add-on directory is still called "Rise of the Blade", not "Rise_of_the_Blade".


Crend
UMC Story Images — Story images for your campaign!
User avatar
Silence
Posts: 40
Joined: September 3rd, 2011, 1:13 am

Re: Help with WML

Post by Silence »

Crendgrim wrote:Your add-on directory is still called "Rise of the Blade", not "Rise_of_the_Blade".


Crend
Whoops, that last one slipped past me somehow.

Well, my scenario works perfectly well now, thanks!
Looks like I can start experimenting with some different things now. :)
User avatar
BlackJack25
Posts: 78
Joined: July 26th, 2011, 10:50 am
Location: Italy

Re: Help with WML

Post by BlackJack25 »

Well then, good luck ;)
Sorry for some english errors, but I'm Italian ;-)
User avatar
Silence
Posts: 40
Joined: September 3rd, 2011, 1:13 am

Re: Help with WML

Post by Silence »

So I decided to develop this campaign a little further, and encountered another error.
ERROR DETAILS:
Missing closing tag for tag modifcations at ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg:113 included from ~add-ons/Rise_of_the_Blade/_main.cfg:45.value " at core/macros/traits.cfg:5 included from core/_main.cfg:6 included from _main.cfg:5 included from ~add-ons/Rise_of_the_Blade/scenarios/01_Rise.cfg:114 included from ~add-ons/Rise_of_the_Blade/_main.cfg::45
I narrowed the problem code down to this section, but I'm not exactly sure why it's causing the problem. The idea is to have a Horseman show up and move towards a certain hex to say something.

Code: Select all

[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]

        [message]
            speaker=Shaden
            message= _ "What does the message say, then?!"
        [/message]
Also, how you get an image to appear in [story] tags? I've tried copying the WML from other events, but only text appears when I play the campaign.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Help with WML

Post by Sapient »

I don't see any errors in the section you quoted (other than misspelled word "allied").
Are you certain that the error is there?

Your problem with the missing story image is most likely due to a wrong image path.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: Help with WML

Post by Anonymissimus »

Silence wrote:I narrowed the problem code down to this section
Did you use this method for it ?
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Post Reply