Problem running 2 or more gamemodes
Posted: Fri Mar 01, 2013 11:10 pm
I recently tried to set up a server with the gamemodes "babel" and "push".
I added all required scripts to the scripts section in the config and enabled the respective gamemode in the extensions of the map metafile. After setting "ALWAYS ENABLED" to false in the gamemode scripts I started the server.
I noticed that the game works perfectly fine when I start with push maps and then advance to a babel map, but everytime i advance a babel map to a push map, a part of the bable file still seems enabled, like e.g. The chat says that I have to be closer to the enemys base to shoot blocks, while some other parts of the script like the giant platform in the sky arent enabled.
The same thing happens when I advance an Arena map to a ctf or a push map: The spawns on the next map are the same as in the last arena map and you still have the round based system eventhough the arena mode isnt enabled in the maps metadata and "ALWAYS ENABLED" is set to "False" in the script itself.
Is there an easy way to fix this in the gamemode scripts?
This seems to be the part that defines if the gamemode is enabled or not:
I added all required scripts to the scripts section in the config and enabled the respective gamemode in the extensions of the map metafile. After setting "ALWAYS ENABLED" to false in the gamemode scripts I started the server.
I noticed that the game works perfectly fine when I start with push maps and then advance to a babel map, but everytime i advance a babel map to a push map, a part of the bable file still seems enabled, like e.g. The chat says that I have to be closer to the enemys base to shoot blocks, while some other parts of the script like the giant platform in the sky arent enabled.
The same thing happens when I advance an Arena map to a ctf or a push map: The spawns on the next map are the same as in the last arena map and you still have the round based system eventhough the arena mode isnt enabled in the maps metadata and "ALWAYS ENABLED" is set to "False" in the script itself.
Is there an easy way to fix this in the gamemode scripts?
This seems to be the part that defines if the gamemode is enabled or not:
Code: Select all
It would be great if someone could solve that problem, because I think there is a great potential of combining gamemodes on a server like babel/push or ToW/TDMdef on_map_change(self, map):
extensions = self.map_info.extensions
if ALWAYS_ENABLED:
self.babel = True
else:
if extensions.has_key('babel'):
self.babel = extensions['babel']
else:
self.babel = False
if self.babel:
self.map_info.cap_limit = 1
self.map_info.get_entity_location = get_entity_location
self.map_info.get_spawn_location = get_spawn_location
for x in xrange(256 - PLATFORM_WIDTH, 256 + PLATFORM_WIDTH):
for y in xrange(256 - PLATFORM_HEIGHT, 256 + PLATFORM_HEIGHT):
map.set_point(x, y, 1, PLATFORM_COLOR)
return protocol.on_map_change(self, map)