blacknight678
Chieftain
- Joined
- Oct 27, 2009
- Messages
- 19
Looking to make a LUA mod that will enable shared sight for all humans in a multiplayer game (like being on a team without being on a team). I am competent in C++/Python, but am new to Lua.
I am aware of this (https://www.reddit.com/r/civ/comments/49yr85/civ5_shared_vision_mod/) but I want it to work on Mac as well hence Lua, not DLL :-(
So far what I see:
void Events.HexFOWStateChanged(Vector2 hexPos, int fowType, bool wholeMap)
Not sure how Plot:SetRevealed or bool wholeMap work without testing or insight from someone here.
I am aware of this (https://www.reddit.com/r/civ/comments/49yr85/civ5_shared_vision_mod/) but I want it to work on Mac as well hence Lua, not DLL :-(
So far what I see:
void Events.HexFOWStateChanged(Vector2 hexPos, int fowType, bool wholeMap)
local gridPosX, gridPosY = ToGridFromHex( hexPos.x, hexPos.y );
local pPlot = Map.GetPlot( gridPosX, gridPosY );
Now I have the plot. Iterate over all players or teams and ask:local pPlot = Map.GetPlot( gridPosX, gridPosY );
int IsEverAlive()
int IsHuman()
PlayerID GetTeam()
int Plot:IsRevealed(TeamID team, bool debug)
int Plot:IsVisible(TeamID team, bool debug)
Take the most visible value (visible > fog > cloud) and apply it to all human teams:int IsHuman()
PlayerID GetTeam()
int Plot:IsRevealed(TeamID team, bool debug)
int Plot:IsVisible(TeamID team, bool debug)
void Plot:SetRevealed(TeamID team, bool newValue, bool terrainOnly, TeamID fromTeam)
And finish up with:UpdateFog
UpdateVisibility
UpdateVisibility
Not sure how Plot:SetRevealed or bool wholeMap work without testing or insight from someone here.
Any advice on a better way to do this, why the above won't work, or gotcha's I should be aware of?