Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for multiple game sub-elements #1287

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Allow for multiple game sub-elements #1287

merged 2 commits into from
Jun 10, 2024

Conversation

zzufx
Copy link
Contributor

@zzufx zzufx commented Dec 22, 2023

Since the reintroduction of includes, there's been a rise in (or comeback of) "unofficial" gamemodes. These gamemode include files tend to have a <game>GAMEMODE NAME</game> sub-element each.

This means that currently, gamemodes like King's Conquest, Ghost Squadron, Blasternauts, Monster Mash, OITQ or Lifesteal can't be mixed with one another, as PGM will complain about Multiple values for 'game'

I believe allowing for multiple of these sub-elements and just using the last defined one makes the most sense here, as the other option would be to have no <game> element in includes and always having to define it per map.

This change would allow you to combine, for instance, Ghost Squadron and Lifesteal, a compatible combination which wasn't previously possible due to each include file having <game>Ghost Squadron</game> and <game>Lifesteal</game> respectively.

With this, you'd be able to combine them and add a custom <game>GS and Lifesteal</game> line to that specific map's XML after its include calls (or just use the gamemode from the last defined include, if you wanted to)

This concept could go even further to also allow for multiple objectives (for includes that have those), but that's not part of this PR at the moment.

I have tested this in a local server.

@Pablete1234
Copy link
Member

I'm not convinced that this is the way we should handle multiple game elements, instead of combining them like we do for gamemodes (where a map being blitz and rage, will automatically understand it to be both blitz and rage, and display as such in the scoreboard and elsewhere).
Maybe we just need a way for game elements to be handled less like "A random free-text string to put on scoreboard" and more of a "this is a custom non-standard gamemode that this map uses". The main difference i think would be to add a secondary="true" or a type="primary/secondary" to the tag, so that we can differentiate primary (or main) and secondary (or add-on) gamemodes

@Pablete1234
Copy link
Member

Although as explained above i think we could do much better, this is probably an ok and pretty trivial solution for the time

We can explore better options down the line but this is an annoying blocker for certain include stuff so it's better off if changed

@Pablete1234 Pablete1234 merged commit e0db98c into PGMDev:dev Jun 10, 2024
2 checks passed
zzufx added a commit to OvercastCommunity/PublicMaps that referenced this pull request Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PR is ready to merge
Development

Successfully merging this pull request may close these issues.

3 participants