TheOneHitPupper
Chieftain
- Joined
- Jun 15, 2017
- Messages
- 98
I'm trying to incorporate a custom league resolution for an overhaul mod I'm working on. The idea of this custom resolution is to act as if all players researched the Satellites tech and the map is revealed accordingly. I see two ways of doing this.
1. Make a dummy tech and set it to hidden from the Tech tree. Use "MapVisible" from the Technologies table and then write a .lua script to give it to a player when the dummy building is built.
2. Write a .lua script that uses the Plot:SetRevealed() method (found from this thread) and have it execute when the dummy building is built.
I'm trying my hand at writing the code for the 1st method. Here's what I have so far:
Doesn't seem to be executing correctly when I add the building in through IGE.
At this point, all I need is a script that gives the Tech_Global_Exploration to players with the Building_Global_Exploration built. Everything else seems to be working correctly. I've very little understanding on working with lua and have hit a brick wall here. Any help would be appreciated!
1. Make a dummy tech and set it to hidden from the Tech tree. Use "MapVisible" from the Technologies table and then write a .lua script to give it to a player when the dummy building is built.
2. Write a .lua script that uses the Plot:SetRevealed() method (found from this thread) and have it execute when the dummy building is built.
I'm trying my hand at writing the code for the 1st method. Here's what I have so far:
Code:
function GlobalTech(ownerId, cityId, buildingType, bGold, bFaithOrCulture)
if buildingType == GameInfoTypes.BUILDING_GLOBAL_EXPLORATION then
local pPlayer = Players[ownerId]
local pTeam = Teams[pPlayer:GetTeam()]
if not pTeam:IsHasTech(GameInfoTypes.TECH_GLOBAL_EXPLORATION) then
pTeam:SetHasTech(GameInfoTypes.TECH_GLOBAL_EXPLORATION, true)
end
end
end
GameEvents.CityConstructed.Add(GlobalTech)
Doesn't seem to be executing correctly when I add the building in through IGE.
At this point, all I need is a script that gives the Tech_Global_Exploration to players with the Building_Global_Exploration built. Everything else seems to be working correctly. I've very little understanding on working with lua and have hit a brick wall here. Any help would be appreciated!
Last edited: