Erasing / Resetting the Minimap, hiding resources

Neirai

the Forgiven
Joined
Aug 5, 2013
Messages
1,046
Location
Canada
Hey, I'm almost done my (fantastically ugly) Start on Snow lua script. I only have three "minor" (but visible) bugs. I'm wondering if anyone knows a method to fix them:

1) The original start location for the civ still shows up on the minimap as a space that has been explored. That means that you can still see where to get to it.

2) Any resources that have been revealed in the original start location are still visible -- hanging above the fog. Is there a way to hide them?

3) You can see it happen. When you close your DOM dialog, you suddenly change locations. This is because I tied the event to Events.LoadScreenClose. Is there a better place to tie it so that it happens before it can be seen, or is this as good as I can get?

I'm satisfied with keeping these bugs, but I'd rather destroy them if I can easily do so.
 
I'm using that with just the first two arguments. I'm going to test it with the first three, and see what happens.

I'll let you know.
 
Apparently, the third argument doesn't work at all :(

It requires a number instead of a boolean, which probably means it doesn't exist and it's working on the 4th argument already.
 
SetRevealed/ChangeVisCount et al only affect the main map, the minimap appears to be totally generated within code we don't have access to.

The resource issue can be fixed with a simple change to the ResourceIconManager.lua file, eg

Code:
function ResetPlayerResources(iActivePlayer)
  for index, pResource in pairs(g_ActiveSet) do
    DestroyResource(index)
  end

  g_PerPlayerResourceTables[iActivePlayer] = nil
end
LuaEvents.RIM_ResetPlayerResources.Add(ResetPlayerResources)

take a look at how I do it in my "Maps - Rotate Start Position" mod.

Try not tying it to an event at all, but just as a function call at the end of the Lua file - as that will execute after the map has been loaded/configured. But remember to add a check that you're only doing it once, or your civ will (possibly) jump again as a game is loaded
 
I've noticed the minimap getting all fowled up if you change active player (still usable but very ugly). I wonder if you have the same problem when moving starting plot after entering game.

Can't you get around all these problems by modding AssignStartingPlots.lua. (It's tough to mod, I know, but that's where starting plots get assigned.)
 
Whoward69, you are the boss.

I set the lua to call itself, and it solved not just the starting switch problem, but also the minimap and the resources issue, too.
 
Top Bottom