Some 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.
Some questions
Hi,
I would need some confirmation/answers.
Is WML case sensitive?
There is no special character to end instruction? What is the behavior with the newline character ?
(EDIT : According to the wiki newline is only mandatory in an assignment of a value to a key and in define macro command for the preprocessor)
How to define a commentary ? ##
"creating" instruction for the prepropressor use #
"using" {}
This would imply that commentaries slow down preprocessor, and that we can't use {} for something else ? Like in a dialog ? (Yes, I know : why would I want to use it ... )
There is a way to use variables, arrays (even if I don't know how now), but can we e.g. add a variable for each unit ? (addition of an attribute to the object...)
Can we use .. in a file path ?
Thanks (that's all for today)
I would need some confirmation/answers.
Is WML case sensitive?
There is no special character to end instruction? What is the behavior with the newline character ?
(EDIT : According to the wiki newline is only mandatory in an assignment of a value to a key and in define macro command for the preprocessor)
How to define a commentary ? ##
"creating" instruction for the prepropressor use #
"using" {}
This would imply that commentaries slow down preprocessor, and that we can't use {} for something else ? Like in a dialog ? (Yes, I know : why would I want to use it ... )
There is a way to use variables, arrays (even if I don't know how now), but can we e.g. add a variable for each unit ? (addition of an attribute to the object...)
Can we use .. in a file path ?
Thanks (that's all for today)
Related question...
I once asked about how to comment out a block of text, and I got a lot of useful suggestions. The most efficient suggestion was to enclose the text I wanted to comment out in braces, as it was very unlikely to be a preprocessor directive. I've done that successfully for a long time, but recently I've begun finding that sometimes code that fails to load will load when I remove a block of code that I've surrounded by braces. Which means that there is some problem with using braces for debugging. Can anyone tell me why that is, and what I might use instead?
This is a young gryphon. She likes cheese. She will steal all your cheese.
Re: Some questions
Yes. everything is written in lower case, except macros, and variable names &values may have upper case letters.Ethan wrote:Is WML case sensitive?
Comments need a #. After it, the line is ignored. You cannot use long comments (#*...*#)Ethan wrote:How to define a commentary ? ##
"creating" instruction for the prepropressor use #
The preprocessor commands also use this sign: # It uses the keywords define,enddef,undef and ifdef. Do not begin comments with these words and it won't crash.
If you store multiple units or locations at once, you get an array. You can iterate over it, and/or manipulate the variables. You can give the fifth unit of some stored units exactly 15 hp by using:Ethan wrote: There is a way to use variables, arrays (even if I don't know how now), but can we e.g. add a variable for each unit ? (addition of an attribute to the object...)
Code: Select all
[set_variable]
name=units[5].hitpoints
value=15
[/set_variable]
Not that way. Say, you are in the scenario directory. You want to include a file from the subdirectory 'utils'. Then you use {./utils/some_utils.cfg}.Ethan wrote:Can we use .. in a file path ?
Read on here: http://www.wesnoth.org/wiki/ReferenceWML
First read, then think. Read again, think again. And then post!
ok, thanks.
That is why I am asking. :pRead on here: http://www.wesnoth.org/wiki/ReferenceWML
If you don't understand what I want to say, it may be quite normal, just ask me to reformulate. :p And your are welcome to correct my errors. :p