Quick Modding Questions Thread

Are there any safe assumptions that be can made about the characteristics of the map that are gauranteed to always be true?
In particular, are height and width always multiples of two?
Is the second row of tiles always offset to the right of the first row?
 
Is it poor form to reply to your own questions? I hope not!

In particular, are height and width always multiples of two?
This is not the case, height and width can be odd (YNAMP has several like this)
Is the second row of tiles always offset to the right of the first row? Yes, but note that plotID 0 is the bottom left corner of the map


Having managed to answer those myself, maybe someone can help with another: ChimpanG's Civ VI Modding Companion lists two interesting events, GameEvents.PlotOwnershipChanged and GameEvents.PlotPropertyChanged, has anybody managed to get either of these to work? As far as I can see they never fire - or least they don't fire when I'd expect them to, ie: when a plot changes owner.
 
it's actually a noble thing to give us the answers that you found to your own questions, so people who have the same Questions will easily find your Answers.
In particular, are height and width always multiples of two? This is not the case, height and width can be odd (YNAMP has several like this)
Is the second row of tiles always offset to the right of the first row? Yes, but note that plotID 0 is the bottom left corner of the map
I didn't understand at first what you meant by those questions, so I wasn't sure how to respond, also because I haven't touched anything with map generation except the resource generation lua to be sure about my answers. But now that you have found the answers yourself I anderstand what you meant, and both answers are correct.
Having managed to answer those myself, maybe someone can help with another: ChimpanG's Civ VI Modding Companion lists two interesting events, GameEvents.PlotOwnershipChanged and GameEvents.PlotPropertyChanged, has anybody managed to get either of these to work? As far as I can see they never fire - or least they don't fire when I'd expect them to, ie: when a plot changes owner.
"GameEvents.PlotOwnershipChanged" and "GameEvents.PlotPropertyChanged" both are working, but like with many Civ VI (Game) Events, their triggering is not consistent, so sometimes they may not trigger, even if they should. "GameEvents.PlotPropertyChanged" I think isn't meant when chnaging the owner of a tile (property), but when a Map Tile has received a property, its property has changed or got assigned another one. take a look at the RedDeath Scenario files to see how it's used by the devs.

I suggest joining this Discord Server, if you haven't already. Most of the active Modders are already there, so you have more chances there to find someone who helps you with your questions, like Blackbutterfly who has some experience with map modding. There aren't many Civ VI Modders active here on CFC, sadly.
 
After I couldn't get PlotOwnershipChanged to work, I was hoping that maybe ownership was a property of the plot so tried PlotPropertyChanged as well. Will see if I can find any clues in the game files for that scenario, thanks.

I'd noticed it was pretty quiet in the Civ6 mod forums, not like the old days of Civ5 at all - I'd guessed that was due to it begining to be seen as an old game, combined with the dll code never having been released was to blame. If people have moved to discord then I'll check that out at some point. I'm a bit ambivalent about discord though, no chance of google ever finding anything posted there, so so much knowledge gets lost. Thanks for the tip though!
 
so so much knowledge gets lost.
Many People describe Forums as an Old form for Discussions, and Discord is the new "Forum" for Discussions. I like how Forums are well organised and stractured, and you can easily search for Things, but Discord is pretty simple and much more handier and you can easily navigate through the Servers and Channels, though as you have guessed, it's not as organised as in a Forum and no way for Google to find a Post/Thread.

Discord has a search function in every Server, so if you search for a Term, like "PlotOwnershipChanged", you will get all posts in a Server where it was mentioned (oranised by time) and if you click on a Post it will jump you to that conversation, so you can scroll over the posts that envolve that discussion.

There are many other Servers, that can be very helpful for a Modder, with some good resources and references, and they have structured Channels. And most of the acquainted Modders are ready to help others with their Questions if they can help them. It's not very active there (maybe due to people having less interest in modding), but if you have questions, there is always someone who answers. if you go to "#links-and-other-servers" channel in the Server I posted above (which is your N1 Server for Civ6 Modding), you will find most of those channels.
You can always leave a Server if you don't like it.

And good Luck with what you're doing! your Mods add some good (and needed) Flavor to the Game!

EDIT: there is also Event.CityTileOwnershipChanged if you haven't seen it.
 
I still think both discord and forum are different tools.

Discord for fast communication and organizing small projects, forum for archiving knowledge and larger projects.

You can organize a large project on discord, but then you'll surely need a dedicated server, which bring the main issue of discord servers IMO, that final "s": the community is fractured and the information is fragmented, no global search engine, and a real pain to find back something you've posted if you've subscribed to multiple servers.

there is also the issue of being private in the beginning, I suppose it was also a benefit to have servers with modders only, but if you want player feedback that won't do.

there is only the reddit discord server that can provide this kind of "instant" feedback (and the only one continuously active), but, as reddit itself, it's not a good place for long-term feedback.
 
Sure, don't get me wrong, discord is great for real-time collaboration, especially for a small group focussed on a specific project, or a general community hub for ephemera. For me it's just less suited to the slower, asynchronous communication, and general knowledge sharing that old style forums were\are great for - at least partly because of their open nature combined with search engines and archive.org. I do worry what the fragmented, walled garden nature, of discord means in the long term - for example how easy it will be find the knowledge of how to do obscure Civ6 things in 20 years? Who cares you might say, but that's exactly age of what I was googling for when I made Thrones and Palaces (how to extract the art from civ2 to be specific). But I accept this is probably at least partly me being a grumpy old man! :lol:

Anyway this is wildly off topic, so to bring us back....
As far as I can see PlotOwnershipChanged is never used anywhere in Firaxis' code, and PlotPropertyChanged is only used in the Black Death scenario. I can make neither fire in a normal game so I'm going to conclude they are effectively unusable. PlayerBordersChanged is also never called from Firaxis code, but I've not actually tested that one.

CityTileOwnershipChanged does seem to work reliably, for everything except for a city being razed, so that's a potentially useful one. Thanks for the pointers Zegangani!
 
I'm having problems finding a feature that I know used to be in the asset editor: capture screenshot. I used to be able to load a leader, go to some frame in an animation, then just export a screenshot as a .tga file. But I cannot for the life of me find where it is anymore. Did they remove this feature?
 
How would i go about changing a specific attribute of a unit using lua in game script context? Specifically giving the unit more air slots. Is there a function to adjust it directly? Or can I directly give it a modifier from as defined in the sql database?

My current approach is to give it an ability which then grants a modifier, but due to a game bug this isn't working and the specific modifier doesn't get applied.
 
Hi together.

My intention is to skip the hundreds of thousands of sleeping linked support units or generals popping up in endgame while unit rotation.

I've searched the forums and studied some google-spreadsheets for an event like "UnitRotation", "UnitCircle" or "NextUnit" and am wondering, if something like this exists.

Another approach could be preventing the units to be awaken by MoveUnit-Events or something.

I also did not found a mod that could help me out with that issue.
 
Last edited:
Hi together.

My intention is to skip the hundreds of thousands of sleeping linked support units or generals popping up in endgame while unit rotation.

I've searched the forums and studied some google-spreadsheets for an event like "UnitRotation", "UnitCircle" or "NextUnit" and am wondering, if something like this exists.

Another approach could be preventing the units to be awaken by MoveUnit-Events or something.

I also did not found a mod that could help me out with that issue.
I suppose you mean the Unit cycling when selecting a Unit and then having assigned a task to that Unit so the game automaticly selects another Unit. Yeah, that's annoying in late game. I think there is a Mod that prevents that or it has an option to stop that, but I can't remember its name. Maybe CQUI or CUI Reloaded. The function for that is I think in UnitPanel.lua or UnitFlagManage.lua:

UI.DeselectAllUnits();
UI.DeselectAllCities();
UI.SelectUnit( pUnit );
 
Hey again!

I tried to find some info about adding new RequirementTypes. I want to create a requirement that refers to the relation between total number of cities and city population. Let's say that we consider 1-50 Cities and 1-50 population I'd have to create 50*50 Requirement Sets. That's why I wanted to create a new RequirementType that can access the City-to-Population ratio.
However, I can't find any hint about how to do that. I guess I'd have to add a .lua that updates that value for each city at the beginning of each turn.
Can you help me out here on how to get started? Or is it just not possible?

Thank you in advance
Best Regards! :)
 
Lua question!!!!
Where all lua moders scripters get the Events.
like- Events.LocalPlayerTurnEnd
i need event of flooding tile not from river but from ocean ...pls pls pls
 
Hello. Does someone know how to forbid city-states from razing cities? The only relevant thing I found is "City:CanRaze" in lua but not sure if it can be useful.
 
Hey, a question on Landmarks.artdef files.
I figured out so far, that all combinations of district buildings have to be specified as variants.
There are SelectionRule and SelectionPriority nodes. What do they do?

Let's say I have a Tier4 building and I want it to (visually) ignore all complex combinations of Tier1-3 Buildings and just have one representations (like Ignoring Madrasa in Campus). Can I achieve this?
Can I make a BaseVariant that contains the Tier4 Building only and set it to high priority or something?

However, what happens if i create a building and do not specify anything artdef specific at all. Will the District become invisible or just show the state before?

Thanks in advance! :)
 
Hi everyone,

New to both this forum and Civ modding so please forgive me if this is a stupid question..

I'm trying to make just a very basic TSL map of the Mediterranean area and I've noticed that when I go to play the game, some civs just simply won't start with a settler/warrior, and you can't access the tech/civics trees if you play as that civ. I know this can sometimes be caused by the TSL location being on water or impassable terrain but I've double-checked and it's on flat land. Anyone have any idea what might be going on here or how I can fix it?
 
Aaand another GameDatabase related question:
I want to add a building just when a city hits 20 population. However I want that building to not be buildable by the player.

Here is my sql example.
Code:
-- Building
INSERT INTO "Types" ("Type", "Kind") VALUES
('BUILDING_EXAMPLE', 'KIND_BUILDING');

INSERT INTO "Buildings" ("BuildingType", "Name", "Description", "Cost", "MaxPlayerInstances") VALUES
('BUILDING_EXAMPLE', 'LOC_BUILDING_EXAMPLE_NAME', 'LOC_BUILDING_EXAMPLE_DESCRIPTION', 0, 0);

-- Requirement
INSERT INTO "Requirements" ("RequirementId", "RequirementType") VALUES
('REQUIRES_EXAMPLE_POPULATION_20', 'REQUIREMENT_CITY_HAS_X_POPULATION');
INSERT INTO "RequirementArguments" ("RequirementId", "Name", "Type", "Value") VALUES
('REQUIRES_EXAMPLE_POPULATION_20', 'Amount', 'ARGTYPE_IDENTITY', 20);

-- RequirementSet
INSERT INTO "RequirementSets" ("RequirementSetId", "RequirementSetType") VALUES
('REQ_SET_REQUIRES_EXAMPLE_POPULATION_20', 'REQUIREMENTSET_TEST_ALL');
INSERT INTO "RequirementSetRequirements" ("RequirementSetId", "RequirementId") VALUES
('REQ_SET_REQUIRES_EXAMPLE_POPULATION_20', 'REQUIRES_EXAMPLE_POPULATION_20');

-- Modifier
INSERT INTO "Modifiers" ("ModifierId", "ModifierType", "RunOnce", "Permanent") VALUES
('MOD_BUILDING_EXAMPLE', 'MODIFIER_SINGLE_CITY_GRANT_BUILDING_IN_CITY_IGNORE', 1, 1);
INSERT INTO "ModifierArguments" ("ModifierId", "Name", "Type", "Value") VALUES
('MOD_BUILDING_EXAMPLE', 'BuildingType', 'ARGTYPE_IDENTITY', 'BUILDING_EXAMPLE');

-- Modifier (attach)
INSERT INTO "Modifiers" ("ModifierId", "ModifierType", "SubjectRequirementSetId") VALUES
('TRAIT_ATTACH_MOD_BUILDING_EXAMPLE', 'MODIFIER_ALL_CITIES_ATTACH_MODIFIER', 'REQ_SET_REQUIRES_EXAMPLE_POPULATION_20');
INSERT INTO "ModifierArguments" ("ModifierId", "Name", "Type", "Value") VALUES
('TRAIT_ATTACH_MOD_BUILDING_EXAMPLE', 'ModifierId', 'ARGTYPE_IDENTITY', 'MOD_BUILDING_EXAMPLE');

-- TraitModifiers (attach)
INSERT INTO "TraitModifiers" ("TraitType", "ModifierId") VALUES
('TRAIT_LEADER_MAJOR_CIV', 'TRAIT_ATTACH_MOD_BUILDING_EXAMPLE');

Am I doing anything wrong here?

Thanks in advance! :)
 
In Buildings, replace "MaxPlayerInstances", with "InternalOnly".
And you don't need the apostrophes "" for the names of tables or their columns, just use them for Values, like:

Code:
INSERT INTO Buildings (BuildingType, Name, Description, Cost, InternalOnly)
VALUES ('BUILDING_EXAMPLE', 'LOC_BUILDING_EXAMPLE_NAME', 'LOC_BUILDING_EXAMPLE_DESCRIPTION', 0, 0);

And you don't need to include the column Type in Modifier Arguments, the game automatically adds that field with default value being "ARGTYPE_IDENTITY"
 
Top Bottom