- 24
- Posts
- 6
- Years
- Seen Jul 24, 2023
Hi all,
I've been plugging away at this problem for a while and have yet to come up with a solution. I made a post a while ago about swapping tilesets based on day/night, which works well for the most part.
(Placed in def updateTileset in Game_Map, around line 70)
It effectively swaps to a different tileset during nighttime. The only issue is that it will only swap tilesets when the player does something to reload the map, such as entering/exiting a building or moving far enough into a different map. I've been trying to find a way to call some kind of map update (which, I've learned, is different from a map refresh) as soon as the switches for day/night are turned on/off, but with no success. Does anyone know more about this than I do? I'd appreciate any help, even if it's just to point me in the right direction.
I've been plugging away at this problem for a while and have yet to come up with a solution. I made a post a while ago about swapping tilesets based on day/night, which works well for the most part.
(Placed in def updateTileset in Game_Map, around line 70)
Code:
def updateTileset
tilesets=[1,2,3,24,29]
if tilesets.include?(@map.tileset_id)
if PBDayNight.isNight?
tileset = $data_tilesets[@map.tileset_id+40]
else
tileset = $data_tilesets[@map.tileset_id]
end
else
tileset = $data_tilesets[@map.tileset_id]
end
It effectively swaps to a different tileset during nighttime. The only issue is that it will only swap tilesets when the player does something to reload the map, such as entering/exiting a building or moving far enough into a different map. I've been trying to find a way to call some kind of map update (which, I've learned, is different from a map refresh) as soon as the switches for day/night are turned on/off, but with no success. Does anyone know more about this than I do? I'd appreciate any help, even if it's just to point me in the right direction.