Mod Request: Hotkey to Reveal All

PoundedChicken

Warlord
Joined
Nov 4, 2016
Messages
126
I'm just trying to do this to test mapscripts. I have no real experience with LUA or scripting in a Civ game.

I just want to create a simple mod that uses a hotkey to trigger the "Reveal All" action without using Debug.

Was just doing for my own sake in the quickest way possible. So far, I've just tried to call the RevealAllPlots() function under the in WorldInput.lua with DefaultKeyDownHandler(), but no success...
 
I had tried adding a hotkey in Worldinput. The key worked, but the function did not, kept getting a function expected instead of nil error.
The same function worked w/o hotkey, so wasn't sure what problem was.

Okay cool, so the function itself works? Any idea if there is an Initialise() function I can just drop it into instead?

At the moment I just have a quick mod that simply gives infinite visibility and xray vision to settlers, but it doesn't have much potential for applying to future scenarios.
 
Thanks, this is a great help. I'm sorry but I'm very new to Lua. I tried to pop this into a mod and it didn't trigger. When I copied and pasted code into an existing LUA file in the game folder it just generated an error.

Have you been able to get this to run successfully?

Thanks again
 
It has to be loaded as a game script to work. It will reveal the map(which means meeting all other leaders) when you start a new game. Unfortunately gamescripts will not load in save games, at least not yet.

if you change
(iPlotIndex, 1) to
(iPlotIndex, 0), it will explore the map, won't meet leaders, but will have fow.

Here's a a working copy.
 

Attachments

It has to be loaded as a game script to work. It will reveal the map(which means meeting all other leaders) when you start a new game. Unfortunately gamescripts will not load in save games, at least not yet.

if you change
(iPlotIndex, 1) to
(iPlotIndex, 0), it will explore the map, won't meet leaders, but will have fow.

Here's a a working copy.
Does this work after the last update ?
EDIT: Nevermind, it is working. Thanks!
 
Last edited:
Back
Top Bottom