Allow relative path for campaign images#1886
Allow relative path for campaign images#1886Flamefire wants to merge 7 commits intoReturn-To-The-Roots:masterfrom
Conversation
|
Thats pretty cool, so one could create his own world map? |
| const auto parentPath = tmpPath.parent_path(); | ||
| if(!parentPath.parent_path().has_parent_path()) | ||
| { | ||
| // Only alpha-numeric folder names are allowed |
There was a problem hiding this comment.
so my-file.bmp is forbidden? And why is that at all?
There was a problem hiding this comment.
No, only the folder name is checked. I don't see a need for campaign-images or similar inside a campaign folder
| shortDescription = _"shortDescription", | ||
| longDescription = _"longDescription", | ||
| image = "<RTTR_RTTR>/campaigns/garden/garden.bmp", | ||
| image = "<RTTR_RTTR>/campaigns/garden/garden.bmp", -- Same as: image = "garden.bmp", |
There was a problem hiding this comment.
what formats are supported? LBM, BMP?
There was a problem hiding this comment.
Pretty much anything that has a single image. So yes, LBM & BMP
There was a problem hiding this comment.
This is now documented.
I'm wondering if this should support indexed archives similar to the selection map. But probably overkill
There was a problem hiding this comment.
well, I was about to ask and hope if we could support loading custom objects as well, as I'm still hoping for that addition
There was a problem hiding this comment.
What do you mean by "loading custom objects"?
Do you have any concrete use case for that as image?
There was a problem hiding this comment.
I do, some examples do include but are not limited:
- I want to add 4 gates, only the last one reached will activate, all others I'd like to replace with a broken gate (as if they crumble after activation)
- I want to add some custom objects for a campaign where you search for armor pieces
- I would like to add some kind of either treasure chest/dig site where you find something
- I would like to add custom barrier objects
- I would possibly like to add some ruin variations of different buildings
- Also (but that would require loading it into IO and not as a missbob) would like to have custom graphics for the messageboxEx
And now that I'm wiring this, I realize, that his would not work in multiplayer at all, or rather would require further implementations. Maybe if we put it into a .lst file we'd distribute then.
There was a problem hiding this comment.
Ok, so that is unrelated to the campaign description and could be done later.
As for placing objects: AddStaticObject can use many graphics already. We could make it accept a resource ID instead of a file number to refer to other archives.
As for custom graphics we would indeed be limited to campaigns as we don't transfer archives to clients. Even then we'd need to somehow pass the campaign folder/subfolder to the loader but it supports such overwriting already and we use it for e.g. addons already
Custom campaigns are not in
<RTTR_RTTR>but in the user-data folder.Hence it would be impossible to refer to custom images as shown in the example.
Allow a single subfolder level for images and adapt the docs