Macro documentation? VARIABLE_OP etc.
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.
Macro documentation? VARIABLE_OP etc.
I just waisted a lot of time simply trying to figure out how to increment a variable.
Macro's like VARIABLE_OP could perhaps be mentioned on wiki.wesnoth.org/SyntaxWML#Variables
Where can I find documentation about variable_op and other stuff like that? It would make working with wml a bit more intuitive.
Macro's like VARIABLE_OP could perhaps be mentioned on wiki.wesnoth.org/SyntaxWML#Variables
Where can I find documentation about variable_op and other stuff like that? It would make working with wml a bit more intuitive.
Re: Macro documentation? VARIABLE_OP etc.
Utility macro referencemarvalis wrote:Where can I find documentation about variable_op and other stuff like that?
To find that, start with ReferenceWML and go down to the "Predefined macros" section.
Re: Macro documentation? VARIABLE_OP etc.
If you were reading and learning the essentials about WML then I wouldn't say it was time "waisted".
The page actually does mention macros there, but it doesn't go into detail because macros they are a complex subject on their own. Also it is better to learn the normal way first before you learn the macro shortcut -- otherwise you will be using code snippets without really understanding what they do, which can lead to far worse problems.
If you are having trouble finding an answer in the wiki, then please by all means feel free to post the question in here. Perhaps the example of incrementing a variable would be a good one to include on the SyntaxWML page, as you suggested. So thank you for that suggestion. I will keep it in mind the next time I do a revision to that section.
The page actually does mention macros there, but it doesn't go into detail because macros they are a complex subject on their own. Also it is better to learn the normal way first before you learn the macro shortcut -- otherwise you will be using code snippets without really understanding what they do, which can lead to far worse problems.
If you are having trouble finding an answer in the wiki, then please by all means feel free to post the question in here. Perhaps the example of incrementing a variable would be a good one to include on the SyntaxWML page, as you suggested. So thank you for that suggestion. I will keep it in mind the next time I do a revision to that section.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Macro documentation? VARIABLE_OP etc.
Yes, thanks to both of you. I looked at the macro and its code, and I found out the sytax how to add something to a variable. This is the page about variable that I looked over:
http://wiki.wesnoth.org/InternalActions ... ariable.5D
It would be nice if the part on syntax WML about variable could point straight to internalactionsWML variable operation.
Variable operation are usually the first thing you learn in any language (then tables, logic, etc).
http://wiki.wesnoth.org/InternalActions ... ariable.5D
It would be nice if the part on syntax WML about variable could point straight to internalactionsWML variable operation.
Variable operation are usually the first thing you learn in any language (then tables, logic, etc).
Re: Macro documentation? VARIABLE_OP etc.
The "part on syntax WML about variable" would be this section? But that already does point straight to [set_variable], so did you mean somewhere else? Perhaps it could be made clearer there that "assigning" includes modifying, but the link is already there.marvalis wrote:It would be nice if the part on syntax WML about variable could point straight to internalactionsWML variable operation.
Re: Macro documentation? VARIABLE_OP etc.
I think when you click on the word "macro" from SyntaxWML, it should not take you directly to PreprocessorRef but instead to a page with introductory information about commonly used macros in WML programming.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."