File path rules
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.
Re: File path rules
Often you might be able to get an idea of what the "best practice" conventions are by looking at the source code for mainline campaigns. For example, in the latest stable version of Wesnoth (1.14.14), there is an
Of course, there are some things that might not be found in mainline campaigns (e.g., I don't think any of them have anything like an animated title sequence), so you might need to invent your own convention in such cases.
images/attacks
folder in Dead Water, Liberty, and Under the Burning Suns, so that is probably a good place to put attack icons.Of course, there are some things that might not be found in mainline campaigns (e.g., I don't think any of them have anything like an animated title sequence), so you might need to invent your own convention in such cases.
Re: File path rules
There's a Wiki page for this: AddonStructure. It's not entirely in sync with Celtic Minstrel's answer, but will be updated soon.
- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: File path rules
Sorry, it looks like I got this one wrong. It should be "sounds" after all. I've also edited my previous post to correct it.
You can put them basically anywhere you want. If you have lots and lots of new terrains, having a dedicated folder for terrains might be a good idea. If you only have one or two, then there's no point.
Now that I think about it again, I don't think I've actually seen anyone actually use a "terrains" folder like that. Even mainline just dumps them into two files directly in the "core" folder. So, I guess that particular suggestion isn't one that many people have actually followed. I probably just got confused because the terrain images do always have a separate folder.
I don't think it matters, but just for the record, mainline does put attack icons in an "attacks" folder.Helmet wrote: ↑November 8th, 2020, 2:15 pmI have several custom attack icons, such asCeltic_Minstrel wrote: ↑November 8th, 2020, 7:47 am [*]Unit type definitions (as well as other other unit-related things such as races and movetypes) go inYour_Addon/units
.military_fork.png
. I put them inYour_Addon/images/attacks
. Should I useYour_Addon/images/icons
instead?
This seems pretty standard, I think. It doesn't matter as long as it makes sense to you, though. There is one weird thing that I'll mention a bit later, though.
I'd probably make a folder called "animations" and move the "title" folder into that.
You don't have a "units" folder in "images"? I think most add-ons that have more than one or two custom unit images do that, and the same goes for mainline. Some also have a subfolder under "units" for each unit, since once you animate them there can be quite a few files for each unit.Helmet wrote: ↑November 8th, 2020, 2:15 pm I have a lot of custom units, so myimages
folder now contains a lot of files (halo, icons, etc.). I kinda would like a folder that is only custom units. Is that a bad idea? If not, what would you call a folder containing nothing but custom unit images, and where would you place it?
A cutscene is anything that takes the player out of standard gameplay for some plot advancement. By this definition, any event that uses
[message]
is a cutscene, though typically you wouldn't call it cutscene unless there are a few messages in the same event. The story screen at the beginning of the scenario could also be called a cutscene, and you can also call the storyscreen mid-scenario. In addition to the common uses of storyscreen in mainline, this could probably be used to create visual novel style cutscenes set against a custom background (rather than showing over the map). I haven't seen this done, but I think it's possible at least in the upcoming 1.15 release.Re: File path rules
Thanks, octalot. Somehow I never came across that webpage. I was missing a "misc" folder.
The page also answered another question I had: What is textdomain for? (It's used for translations.)
The page also answered another question I had: What is textdomain for? (It's used for translations.)
I like that idea! I'll do that.Celtic_Minstrel wrote: ↑November 8th, 2020, 10:19 pmI'd probably make a folder called "animations" and move the "title" folder into that.
No, I don't have a "unit" folder under images. When looking at other people's scenarios, I guess I overlooked that detail. Man, I am so glad I made this thread. My images folder was a disaster. I'll add a "units" folder in a minute.Celtic_Minstrel wrote: ↑November 8th, 2020, 10:19 pm You don't have a "units" folder in "images"? I think most add-ons that have more than one or two custom unit images do that, and the same goes for mainline. Some also have a subfolder under "units" for each unit, since once you animate them there can be quite a few files for each unit.
Ohhhh. I thought "cutscene" might only apply to scenes with animation, like the beginning of "Bad Moon Rising." But it's actually a more versatile term. Thanks for explaining.Helmet wrote: ↑November 8th, 2020, 2:15 pmA cutscene is anything that takes the player out of standard gameplay for some plot advancement. By this definition, any event that uses[message]
is a cutscene, though typically you wouldn't call it cutscene unless there are a few messages in the same event. The story screen at the beginning of the scenario could also be called a cutscene, and you can also call the storyscreen mid-scenario.
I'm looking forward to this.Celtic_Minstrel wrote: ↑November 8th, 2020, 10:19 pmIn addition to the common uses of storyscreen in mainline, this could probably be used to create visual novel style cutscenes set against a custom background (rather than showing over the map). I haven't seen this done, but I think it's possible at least in the upcoming 1.15 release.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: File path rules
You don't really need a "misc" folder if you don't want one; and if you have a bunch of stuff that fits together, you can make whatever extra folders you want. For example, if I recall correctly, my add-on has an "overlays" directory because I use several "overlay" icons.
Well, an actual animated movie would also count as a cutscene, though Wesnoth doesn't actually support that. You can probably kinda fake it with the unit animations system (maybe that's what BMR does?), but I think you'd have to severely limit the FPS to get decent performance… unit animations aren't built to use fullscreen images.
Re: File path rules
That's what I did that with my animated title. It's actually an animated unit, where each frame is 800x600 pixels. I was inspired by the opening of inferno8's "To Lands Unknown," where his name appears and some lines moves. It's a workaround, but it works.Celtic_Minstrel wrote: ↑November 9th, 2020, 12:10 amWell, an actual animated movie would also count as a cutscene, though Wesnoth doesn't actually support that. You can probably kinda fake it with the unit animations system (maybe that's what BMR does?), but I think you'd have to severely limit the FPS to get decent performance… unit animations aren't built to use fullscreen images.
It would be great if WML allowed big animated scenes without a workaround. Maybe one day...
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.