It's implied to be in our Github since a proposal is usually an issue because people apparently don't like bad events.![]()
People don't know what they like. Make the events that you want to make.

G
It's implied to be in our Github since a proposal is usually an issue because people apparently don't like bad events.![]()
YOU CAME
Ok, I've read the GameEventsTable and the SampleEvents. This is for me like reading Portuguese. I understand when I read it, but by no means I can write it!
In the example, wanderer's choice, for farms it's <ImprovementType>, then <Number>, while for units it's <UnitClassType> then <Quantity>. Why improvements are numbered with <Number> while Units are numbered with <Quantity>? Also, I don't know the names for ImprovementTypes, except IMPROVEMENT_FARM, just because it's in the example. The same could be said for <UnitClassType>.
To be able to write something like this myself, I'd have to study it first, like learning a language. Maybe this is a no brainer for a modder, but certainly not for anyone.
At least I now know that there isn't triggers for befriending City States, or for getting more units than cities.
Ok, I've read the GameEventsTable and the SampleEvents. This is for me like reading Portuguese. I understand when I read it, but by no means I can write it!
In the example, wanderer's choice, for farms it's <ImprovementType>, then <Number>, while for units it's <UnitClassType> then <Quantity>. Why improvements are numbered with <Number> while Units are numbered with <Quantity>? Also, I don't know the names for ImprovementTypes, except IMPROVEMENT_FARM, just because it's in the example. The same could be said for <UnitClassType>.
To be able to write something like this myself, I'd have to study it first, like learning a language. Maybe this is a no brainer for a modder, but certainly not for anyone.
At least I now know that there isn't triggers for befriending City States, or for getting more units than cities.
Here is something interesting:
<!-- Only valid if you are under your trade route cap -->
<Column name="LessThanMaximumTradeRoutes" type="boolean" default="false"/>
Does it mean it is possible to write a Event when I am forgetting to build a trade route?
If so, I'd love to have something like this:
When "LessThanMaximumTradeRoutes" is true,
EventCooldown = 10, Event_Class_Trade.
Help text= "There are trade routes available"
Choice1 = "I'll build them myself" (Do nothing)
Choice2 = "I'll buy one land trader" (pay land trader cost, a land trader appears in Capital)
Choice3 = "I'll buy one sea trader" (pay sea trader cost, a sea trader appears in Capital)
If there is a Bank in Capital
Choice4 = "I'll take a loan to get a land trader" (costs 20% extra gold, but pay it in 10 turns, a land trader appears in Capital)
Choice5 = "I'll take a loan to get a sea trader" (costs 20% extra gold, but pay it in 10 turns, a sea trader appears in Capital)
This is mixing a player trigger with city options and city filters, so no clue about how to do it.
The way I do it for references like <ImprovementType> is that I use sqlitebrowser and look into Civ5DebugDatabase.db for the values inside the tables
Sorry, I have no .db file either in Civ V folder or in MODs folder.
EDIT: Is there any example using EventLinker?
INSERT INTO Event_EventLinks(EventType,EventLinker,EventChoice,CityEvent,CityEventChoice,CheckKnownPlayers,CheckForActive)
VALUES ('PLAYER_EVENT_COMET','PLAYER_EVENT_METEOR',null,null,null,false,false);
function TestEvent(iPlayer)
if iPlayer == 0 then
local pPlayer = Players[iPlayer]
local capital = pPlayer:GetCapitalCity()
capital:DoCityStartEvent(GameInfoTypes.CITY_EVENT_GOOD_HARVEST)
end
end
GameEvents.PlayerDoTurn.Add(TestEvent)
Thanks, so I need to start a game for that file to show. That's why I couldn't find it.All .db files are located at "C:\Users\<user>\Documents\My Games\Sid Meier's Civilization 5\cache", the debug .db is equal to the current state of the game, so if you want all the mods values and tables, simply open or copy it after you loaded your mods inside your game.
About EventLinker, an example could be like this :
Which would make the event PLAYER_EVENT_COMET check that the event PLAYER_EVENT_METEOR is NOT active for the current player.Code:INSERT INTO Event_EventLinks(EventType,EventLinker,EventChoice,CityEvent,CityEventChoice,CheckKnownPlayers,CheckForActive) VALUES ('PLAYER_EVENT_COMET','PLAYER_EVENT_METEOR',null,null,null,false,false);
iPlayer == 0 is very awkward. Have you tried using print statements first?.Code:function TestEvent(iPlayer) if iPlayer == 0 then local pPlayer = Players[iPlayer] local capital = pPlayer:GetCapitalCity() capital:DoCityStartEvent(GameInfoTypes.CITY_EVENT_GOOD_HARVEST) end end GameEvents.PlayerDoTurn.Add(TestEvent)
1) it would be unfair if my events get into game only because no other people care to code and 2) the production of new events will be very slow if only coders are able to design events.
iPlayer == 0 is very awkward. Have you tried using print statements first?
function TestEvent(iPlayer)
if iPlayer == 0 then -- if player is myself
print("Testing event start")
local pPlayer = Players[iPlayer]
local capital = pPlayer:GetCapitalCity()
capital:DoCityStartEvent(GameInfoTypes.CITY_EVENT_CUSTOM_TEST) -- test a city event
pPlayer:DoStartEvent(GameInfoTypes.PLAYER_EVENT_CUSTOM_TEST) -- test a player event
print("Testing event end")
end
end
GameEvents.PlayerCityFounded.Add(TestEvent)
I don't think it is particularly awkward. iPlayer is the player id (an integer), and 0 is always equal to player 1 (so myself in this test case)
But anyway, I did change a little my test code to this :
With this code, the event PLAYER_EVENT_CUSTOM_TEST is triggered and I get this result in the firetuner when using my settler:Code:function TestEvent(iPlayer) if iPlayer == 0 then -- if player is myself print("Testing event start") local pPlayer = Players[iPlayer] local capital = pPlayer:GetCapitalCity() capital:DoCityStartEvent(GameInfoTypes.CITY_EVENT_CUSTOM_TEST) -- test a city event pPlayer:DoStartEvent(GameInfoTypes.PLAYER_EVENT_CUSTOM_TEST) -- test a player event print("Testing event end") end end GameEvents.PlayerCityFounded.Add(TestEvent)
[28851.402] EventTestScript: Testing event start
[28851.402] EventTestScript: Testing event end
So everything looks alright. The thing is I don't have the event CITY_EVENT_CUSTOM_TEST appearing. I tried setting RandomChance to 1000 and IgnoresGlobalCooldown to true and waiting more than a few turns to get it, but never got any city event. I also noticed that I don't have any event in any tabs of the event overview interface (even player events that I did get). So maybe there is an incompatibility or a wrong installation on my side? Both my lua log file and database log file have debug mode activated and have no errors in them.
I double-checked my sql entry to be sure, but it is alright. I also tested with one of your events, CITY_EVENT_GOOD_HARVEST, and got the same result (nothing happened).
I currently use the latest version (09/02). Is there anything I could do to be of help for you with the issues I have with events?