Working on a WML checker and need some info..
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.
Working on a WML checker and need some info..
I'm working on a program in Ruby that is supposed to check if tags/attributes/values are valid and some other stuff, but some things that are necessary for it I don't know.
-in which order are files loaded when a folder is loaded?
-does it make a difference if a value is enclosed by " or not? (like name=start and name="start")
-what characters are valid for tags like id?
-is there any good way to find out, what values are valid for a tag?(where could I find it in the source code if I need to?)
More (maybe) coming soon..
-in which order are files loaded when a folder is loaded?
-does it make a difference if a value is enclosed by " or not? (like name=start and name="start")
-what characters are valid for tags like id?
-is there any good way to find out, what values are valid for a tag?(where could I find it in the source code if I need to?)
More (maybe) coming soon..
Re: Working on a WML checker and need some info..
First the campaign file, then the WML files you included in the campaign file, in the order as you included them. (@all: That's all AFAIK, if wrong please correct)CIB wrote: -in which order are files loaded when a folder is loaded?
The quote marks set the enclosed string as the value. If a string is required as a value, you need the quote marks. Otherwise, AFAIK it doesn't matter.-does it make a difference if a value is enclosed by " or not? (like name=start and name="start")
The last two ones, I don't really know.
First read, then think. Read again, think again. And then post!
Re: Working on a WML checker and need some info..
1. is answered in http://www.wesnoth.org/wiki/PreprocessorRef
2. is answered in http://www.wesnoth.org/wiki/SyntaxWML Note that tom's answer contradicts what is written there.
3. The list of tags in the WML reference does not mention a tag called id. Are you sure it exists?
4. Do you mean what attributes are valid in a tag, or what values are valid for an attribute? Either is documented in the wiki. (you know where to find the list of WML tags, don't you?) I don't know about the source code.
2. is answered in http://www.wesnoth.org/wiki/SyntaxWML Note that tom's answer contradicts what is written there.
3. The list of tags in the WML reference does not mention a tag called id. Are you sure it exists?
4. Do you mean what attributes are valid in a tag, or what values are valid for an attribute? Either is documented in the wiki. (you know where to find the list of WML tags, don't you?) I don't know about the source code.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Edit: The id tag is used to be used to flag important strings. You used to have things like
which allowed scen1mess1 and scen1mess2 to be referenced correctly. Checking in CVS I find ID tags are used for scenarios and units but not for (e.g.) messages.
Edit: As far as enclosing strings in quotes is concerned, in addition to what toms says, it would also be needed if an entity had a space in its name. there are cases where "Skeleton" would not need quotes, but where "Skeleton Archer" used in the same place would.
Off-hand I can't think of any cases where putting unneeded quotes in actually causes problems, but I could easily have overlooked something obvious.
[Edited to remove misinformation]
Code: Select all
[message]
id=scen1mess1
message="Blah blah blah"
. . .
[/message]
[message]
id=scen1mess2
message="Blah blah"
. . .
[/message]
Edit: As far as enclosing strings in quotes is concerned, in addition to what toms says, it would also be needed if an entity had a space in its name. there are cases where "Skeleton" would not need quotes, but where "Skeleton Archer" used in the same place would.
Off-hand I can't think of any cases where putting unneeded quotes in actually causes problems, but I could easily have overlooked something obvious.
[Edited to remove misinformation]
Last edited by Simons Mith on June 11th, 2007, 5:42 pm, edited 2 times in total.
You can also open folders with {folder}. And what I was asking was, if there are 3 files e.g. "scenario.cfg","macro.cfg" and "units.cfg" in a folder, which will be loaded first?First the campaign file, then the WML files you included in the campaign file, in the order as you included them. (@all: That's all AFAIK, if wrong please correct)
id's are being used for scenarios and units for example. I'm not sure if they can include spaces and special characters, but I'm pretty sure they can't include linebreaks..
Re: Working on a WML checker and need some info..
Oh, didn't see your post, meriton.
Has that information been added lately? I can't remember it being there before a few months.meriton wrote:1. is answered in http://www.wesnoth.org/wiki/PreprocessorRef
Oh, whoops! I meant attribute.3. The list of tags in the WML reference does not mention a tag called id. Are you sure it exists?
Again, sorry, I meant attribute =) Well, the wiki isn't accurate enough, sometimes different attributes that should accept the same value, do not. It's good for finding out what attributes/tags a tag can contain though.4. Do you mean what attributes are valid in a tag, or what values are valid for an attribute? Either is documented in the wiki. (you know where to find the list of WML tags, don't you?) I don't know about the source code.