Sudipta'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.
- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Sudipta's WML questions
Hello. I'm creating a new campaign and am currently working on the first scenario.
I wanna start off with a small problem.
When trying to start my campaign i keep getting a " the game map could not be loaded: Unknown tile in map: (CmeZ) 'CmeZ; " error after selecting difficulty and the scenario doesn't start. I had installed the UMC_Terrain_Pack and fiddled around with it in the map editor but i don't think i used it in the map design. I've gone over the map several times and replaced every tile which i thought might not be from the default map editor, but the scenario still doesn't start.
Any advice would be helpful.
edit: it's definitely from the UMC_Terrain_Pack because after removing this add-on i cant even load the map in the map editor . the same error message appears.
I wanna start off with a small problem.
When trying to start my campaign i keep getting a " the game map could not be loaded: Unknown tile in map: (CmeZ) 'CmeZ; " error after selecting difficulty and the scenario doesn't start. I had installed the UMC_Terrain_Pack and fiddled around with it in the map editor but i don't think i used it in the map design. I've gone over the map several times and replaced every tile which i thought might not be from the default map editor, but the scenario still doesn't start.
Any advice would be helpful.
edit: it's definitely from the UMC_Terrain_Pack because after removing this add-on i cant even load the map in the map editor . the same error message appears.
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
You could replace CmeZ with some other terrain then.
- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Re: Sudipta's WML questions
But i have no idea what CmeZ is... how can i replace it if i dont even recognize/know it?
Is there any way to find specific map tiles in the map? like some kind of search function i can use to locate this CmeZ thing
Is there any way to find specific map tiles in the map? like some kind of search function i can use to locate this CmeZ thing
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
You can open map with text editor and use replace all.
Re: Sudipta's WML questions
You need to load UMC Terrain Pack in your _main.cfg
- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Re: Sudipta's WML questions
yeah using the editor worked. turns out i used a lot of tiles from the addon(desert hills, tundra, troll encampments) but didnt realize it. Anyway i removed all those tiles cause i don't want any dependencies for the campaign right now
Moving on the next problem. I can't make either the LIMIT_RECRUITS or LIMIT_CONTEMPORANEOUS_RECRUITS work. i copied the code from S1 of Eastern invasion and studied the side-utils macro file but cant figure what i'm doing wrong
This is the error that comes up when i try to start the campaign
my code is
where the naga enemies are Side 3 and i want them to only be able to recruit 2 naga warriors on hard.On easy and normal they can't recruit naga warriors.
Moving on the next problem. I can't make either the LIMIT_RECRUITS or LIMIT_CONTEMPORANEOUS_RECRUITS work. i copied the code from S1 of Eastern invasion and studied the side-utils macro file but cant figure what i'm doing wrong
This is the error that comes up when i try to start the campaign
Spoiler:
Code: Select all
#ifdef HARD
{LIMIT_RECRUITS 3 Naga Warrior 2}
#endif
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
Naga Warrior would be interpreted as two parameters unless you use () or "" to glue the two words together.
Re: Sudipta's WML questions
This:
{LIMIT_RECRUITS 3 "Naga Warrior" 2}
Or this:
{LIMIT_RECRUITS 3 (Naga Warrior) 2}
will work...
Macro expects 3 variables, but thinks that you give it 4, because it treats Naga separate from Warrior.. If you use quotes or brackets then it thinks that it is 1 variable. Using quotes
"
seems to be preferable, because sometimes if I use brackets it may cut spaces, but only in messages like [message] ...
so instead of for example lord save us all
it may output message lordsaveusall
in certain scenarios... possibly if I need to use +
symbols or something... not sure really. But there is such a problem sometimes, never seen any serious or even minor errors though. So using brackets ()
is perfectly fine, just keep in mind that if you see any problems described above, change to quotes..- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Re: Sudipta's WML questions
Thanks both of you. Moving on, this next one is not a WML question strictly speaking..
I want to set a tight turn limit in my scenario, and while playtesting it i ran out of turns. How do i add some extra turns within the game(by using debug mode, not by editing .cfg file) ?
Example- I set initial turn limit at 20. i tried using "set_var <turn=30>" in debug mode while playing. The white notification text shows up saying the set_var was used during debug mode, but at the end of turn 20 i still get a game over.
I want to set a tight turn limit in my scenario, and while playtesting it i ran out of turns. How do i add some extra turns within the game(by using debug mode, not by editing .cfg file) ?
Example- I set initial turn limit at 20. i tried using "set_var <turn=30>" in debug mode while playing. The white notification text shows up saying the set_var was used during debug mode, but at the end of turn 20 i still get a game over.
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
You can use these, -1 is no limit.
lua wesnoth.game_config.last_turn=-1
lua wesnoth.game_config.last_turn=30
lua wesnoth.game_config.last_turn=-1
lua wesnoth.game_config.last_turn=30
- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Re: Sudipta's WML questions
Thanks a lot for the quick reply Ravana. I really appreciate it
I need to learn the lua stuff soon. I've been using WML mainly but seems like Lua brings some interesting stuff to the table.
I need to learn the lua stuff soon. I've been using WML mainly but seems like Lua brings some interesting stuff to the table.
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
You can also use debug mode, there are commands for it:
https://wiki.wesnoth.org/COMMANDMODE
While I'm not sure, it may be that the commands posted by ravana work from the lua console (available after activating mode with some shortcut, I think
:turn
xxx and :turn_limit
xxxhttps://wiki.wesnoth.org/COMMANDMODE
While I'm not sure, it may be that the commands posted by ravana work from the lua console (available after activating mode with some shortcut, I think
`
)Try out the dark board theme.
Re: Sudipta's WML questions
Not everything in the world has to be done through lua...
https://wiki.wesnoth.org/InternalAction ... e_turns.5D
https://wiki.wesnoth.org/DirectActionsW ... y_turns.5D
Just create a menu with set_menu_item:
Code: Select all
[set_menu_item]
id=aaa_make_game_longer
description=_"<b>Add 5 turns to turn limit</b>"
image="attacks/trident.png~SCALE(22,22)"
[show_if]
[variable]
name=development_in_process
boolean_equals=true
[/variable]
[/show_if]
[command]
[modify_turns]
add=5
[/modify_turns]
[/command]
[/set_menu_item]
Code: Select all
[/multiplayer]
...
[checkbox]
id=development_in_process
default=false
name=_"Enable this if you want to use development menu"
description=_"For Developers use only"
[/checkbox]
...
[/multiplayer]
Sorry if I wasn't helpful, but maybe It could help somebody else when they find it
Alternatively you could write in debug mode command line:
lua wesnoth.fire("modify_turns", { add=5 })
as a long version of mix of wml and lua should work..- Sudipta
- Posts: 217
- Joined: June 10th, 2015, 6:37 pm
- Location: Meditating under a waterfall, Heartfangs, Wesnoth
Re: Sudipta's WML questions
Uhh, i used the commands u provided but both of them set turn number or turn limit number to 1 regardless of what value i put in it.Shiki wrote: ↑June 13th, 2018, 7:05 pm You can also use debug mode, there are commands for it:
:turn
xxx and:turn_limit
xxx
https://wiki.wesnoth.org/COMMANDMODE
While I'm not sure, it may be that the commands posted by ravana work from the lua console (available after activating mode with some shortcut, I think`
)
for example i use
turn [8]
in debug mode but it sets turn number to 1. using turn_limit [50]
sets turn limit to 1.@enclave thanks for the alternate method but i find ravana's lua suggestions simpler. I'm just starting out so set_menu_item stuff goes over my head for now
It is the mark of an educated mind to be able to entertain a thought without accepting it.
Playing Wesnoth since 2010, still there is so much left to play
Playing Wesnoth since 2010, still there is so much left to play
Re: Sudipta's WML questions
Those are used without []. In documentation [] means optional.