Skip to content

Allow relative path for campaign images#1886

Open
Flamefire wants to merge 7 commits intoReturn-To-The-Roots:masterfrom
Flamefire:campaign
Open

Allow relative path for campaign images#1886
Flamefire wants to merge 7 commits intoReturn-To-The-Roots:masterfrom
Flamefire:campaign

Conversation

@Flamefire
Copy link
Member

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

@Flamefire Flamefire requested review from Flow86 and Spikeone February 3, 2026 19:27
@Spikeone
Copy link
Member

Spikeone commented Feb 3, 2026

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so my-file.bmp is forbidden? And why is that at all?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can allow - and _ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Member

@Spikeone Spikeone Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what formats are supported? LBM, BMP?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much anything that has a single image. So yes, LBM & BMP

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now documented.
I'm wondering if this should support indexed archives similar to the selection map. But probably overkill

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

@Flamefire Flamefire Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "loading custom objects"?

Do you have any concrete use case for that as image?

Copy link
Member

@Spikeone Spikeone Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants