MantisBT - Zandronum
View Issue Details
0004192Zandronum[All Projects] Suggestionpublic2024-01-31 17:272025-03-04 05:07
Fused 
Kaminsky 
normalfeatureN/A
resolvedfixed 
3.1 
3.23.2 
0004192: Allow ACS to specify the next map, or `SetNextMap()`
With the introduction of the map rotation functions in ACS it is now possible to keep track of the map rotation and apply custom logic. One example is map voting where users can vote for the next map. It would be nice if for this example it would be possible to specify the next map rather than use something like `ChangeLevel` to change the map just before Zandronum would do it.
Trillster — 01/25/2024 4:28 AM
as a more selfish request, I do think it'd be really nice if you could manipulate or override the next map ahead of time
I have a mod for 8BDM which allows folks to vote on the next map, but it has to do some pretty gross things to get the voted map to be the next one
basically waits for the last round end sequence of a match and then performs a manual map change just before the engine gets the chance to
I could imagine some other use cases of overriding the next map, such as having a mod that inserts bonus stages between maps in a cooperative / survival map rotation
No tags attached.
Issue History
2024-01-31 17:27FusedNew Issue
2024-04-28 20:26KaminskyNote Added: 0023647
2024-04-28 20:26KaminskyAssigned To => Kaminsky
2024-04-28 20:26KaminskyStatusnew => needs testing
2024-04-28 20:26KaminskyProduct Version => 3.1
2024-04-28 20:26KaminskyTarget Version => 3.2
2024-04-29 23:56TrillsterNote Added: 0023649
2024-04-30 15:52KaminskyNote Added: 0023652
2024-04-30 18:03TrillsterNote Added: 0023654
2024-07-21 15:04KaminskyStatusneeds testing => assigned
2024-09-02 20:08KaminskyNote Added: 0023992
2024-09-02 20:08KaminskyStatusassigned => needs review
2024-09-03 11:38FusedNote Added: 0023996
2024-09-03 12:43KaminskyNote Added: 0023998
2024-09-09 02:59KaminskyNote Added: 0024025
2024-09-09 02:59KaminskyStatusneeds review => needs testing
2025-03-04 05:07Ru5tK1ngNote Added: 0024230
2025-03-04 05:07Ru5tK1ngStatusneeds testing => resolved
2025-03-04 05:07Ru5tK1ngResolutionopen => fixed
2025-03-04 05:07Ru5tK1ngFixed in Version => 3.2

Notes
(0023647)
Kaminsky   
2024-04-28 20:26   
This commits adds the "SetNextMapPosition" ACS function:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/9f86d0fdb9129be1a097c0b753042bbc18a40efa [^]' so you can specify the next map in the rotation.
(0023649)
Trillster   
2024-04-29 23:56   
I haven't tested the new feature in practice, but from looking at the changeset, it appears that a map set by SetNextMapPosition can still be overwritten if the current count of players doesn't fit within its min and max players, due to the last validation before changing to the next map. I think if this is the case, it'd be preferable to make an exception for maps set by SetNextMapPosition.
(0023652)
Kaminsky   
2024-04-30 15:52   
I originally intended for SetNextMapPosition to allow mods to change the next position without any restrictions. However, if I had to choose between one or the other, I'd rather prevent the function from overriding the next position if the current player count is incompatible with the corresponding entry's min/max player limits, rather than making an exception.
(0023654)
Trillster   
2024-04-30 18:03   
For the use case of custom built map vote systems, I think it'd be more confusing for the player voted map to get overwritten with no preventative option. The voting system I've built already accounts for the player limits when determining the maps that can be voted for, so I'd rather defer to the player choice past that point.
(0023992)
Kaminsky   
2024-09-02 20:08   
Maps set by the ACS function are guaranteed to be entered, regardless of whether or not their min/max player limits are compatible with the current player count, as per:'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/185 [^]'
(0023996)
Fused   
2024-09-03 11:38   
Yes, I would personally prefer the ACS function to not have this restriction. Perhaps this can be made optional through a boolean though? I see the function already returns a boolean so in the event it fails, mod developers could still implement a system that respects the given limits.
(0023998)
Kaminsky   
2024-09-03 12:43   
Quote from Fused
Perhaps this can be made optional through a boolean though? I see the function already returns a boolean so in the event it fails, mod developers could still implement a system that respects the given limits.


Sounds reasonable. I updated the merge request and added a new parameter to the ACS function to make the restriction optional. One should enable this parameter if they wish to ignore the map entry's player limits.
(0024025)
Kaminsky   
2024-09-09 02:59   
This commit has been pushed in:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/901a298489f63e857a62a76cb40c1d8513099410 [^]'
(0024230)
Ru5tK1ng   
2025-03-04 05:07   
Tested online with and offline with r241030. SetNextMapPosition worked as expected multiple times in each usage. The only thing worth noting is that using changemap in localmode is considered a cheat so it'll always try to move to the next map and will successfully go to a map despite player limits not being reached. But if you play the map and end the level normally, SetNextMapPosition works perfectly.