0.8.9+ New format for campaign difficulty descriptions
Moderator: Forum Moderators
0.8.9+ New format for campaign difficulty descriptions
The column separator is no longer the comma. See http://www.wesnoth.org/forum/viewtopic.php?t=3069 for additional information.
It has a consequence on campaign descriptions. It was quite common to have this kind of code before:
It no longer works. Users won't be able to select the difficulty when a new version of Wesnoth is released. The correct way of doing it will now use macros to hide some special characters.
Please think about it when Wesnoth 0.8.9 (or 0.9, or whatever) is released.
It has a consequence on campaign descriptions. It was quite common to have this kind of code before:
Code: Select all
difficulty_descriptions="&human-spearman.png," + _"Spearman" + "," + _"(easiest)" +
";*&human-swordman.png," + _"Swordsman" +
";&human-royalguard.png," + _"Royal Guard" + "," + _"(hardest)"
Code: Select all
difficulty_descriptions={MENU_IMG_TXT2 human-spearman.png _"Spearman" _"(easiest)"} +
";*" + {MENU_IMG_TXT human-swordman.png _"Swordsman"} +
";" + {MENU_IMG_TXT2 human-royalguard.png (_"Royal Guard") _"(hardest)"}
Is this macro new as of 0.8.9?
Is _"text" the same as _[space]"text"?
Is _"text" the same as _[space]"text"?
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Not at all. MENU_IMG_TXT takes one image filename and one string. MENU_IMG_TXT2 takes one image filename and two strings. And so on. They are macros to hide the complexity of the syntax of the menu items.quartex wrote:I'm confused by your example. Is MENU_IMG_TXT or MENU_IMG_TXT2 the name of the macro we should be using? You seem to be using them interchangably.
has this been updated for all official campaigns or do designers of said campaigns do it themselves?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
And, do campaign writers break their campaigns for the new version or all old versions?
This came up with 0.8.3, but I started making mine during/after 0.8.3. What did everybody else do?
This came up with 0.8.3, but I started making mine during/after 0.8.3. What did everybody else do?
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
It has.turin wrote:has this been updated for all official campaigns or do designers of said campaigns do it themselves?
I'm not sure to understand the question. I would say it's up to you whether you decide to support the old versions of Wesnoth or the next version of Wesnoth. The change does not prevent old games to be played, it only prevents new campaigns to start if they have multiple difficulty levels.scott wrote:And, do campaign writers break their campaigns for the new version or all old versions?
Doesn't that sound broken to you? Anyway, I'll probably split the difference and wait a while but not too long.silene wrote: it only prevents new campaigns to start if they have multiple difficulty levels.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Sorry, I still don't understand what you mean. Yes it is broken, it was the whole point of this post: to warn campaign designers that the comma is no longer a special character. So if you are using commas in campaign difficulty descriptions as special characters, the next release of Wesnoth won't be able to display the campaign difficulty selection box, hence preventing the user to start the campaign.scott wrote:Doesn't that sound broken to you? Anyway, I'll probably split the difference and wait a while but not too long.silene wrote: it only prevents new campaigns to start if they have multiple difficulty levels.
-
- Posts: 873
- Joined: July 4th, 2004, 9:14 pm
- Location: My imagination
- Contact:
If you want it to work in 0.8.8, you can put this before your campaign tag:
However it won't work in versions before 0.8.8 because they didn't have string concatenation.
Code: Select all
#work in 0.8.8:
#ifdef MENU_IMG_TXT
#else
#define MENU_IMG_TXT IMG TXT
"&"+{IMG}+","+{TXT}#enddef
#endif
#ifdef MENU_IMG_TXT2
#else
#define MENU_IMG_TXT2 IMG TXT1 TXT2
"&"+{IMG}+","+{TXT1}+","+{TXT2}#enddef
#endif
Play a Silver Mage in the Wesvoid campaign.
Add this to game.cfg, and you can use ifdef to determine version.
You will need to change the version with every release for it to work right.
Code: Select all
#define 0_8_8
#enddef
"ILLEGITIMIS NON CARBORUNDUM"
Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
-
- Posts: 95
- Joined: March 3rd, 2005, 7:40 am
- Location: Austin, Texas
- Contact:
Speaking of which... how do you make custom images visible?
If you want to use custom images here, what do you have to do to make them visible? It looks like various campaigns just stick them in their images/ directory, but when I do that they don't show up at run time.silene wrote:Code: Select all
difficulty_descriptions={MENU_IMG_TXT2 human-spearman.png _"Spearman" _"(easiest)"} + ";*" + {MENU_IMG_TXT human-swordman.png _"Swordsman"} + ";" + {MENU_IMG_TXT2 human-royalguard.png (_"Royal Guard") _"(hardest)"}
BTW, I've tried deleting everything in my cache directory before starting, to no effect.
-
- Posts: 873
- Joined: July 4th, 2004, 9:14 pm
- Location: My imagination
- Contact:
[binary_path]
Use http://wesnoth.slack.it/?ReferenceWML and/or look at other campaigns that do it.
And don't post semi-irrelevant comments in sticky threads like this.
Use http://wesnoth.slack.it/?ReferenceWML and/or look at other campaigns that do it.
And don't post semi-irrelevant comments in sticky threads like this.
Play a Silver Mage in the Wesvoid campaign.