Small Questions Thread

Didn't want to make a whole thread on this, but is there any literature on the following someone can point me to?

1. AI spamming fortresses all over the map and how to prevent it other than outlaw Construction
2. AI not irrigating/farming the base game tiles, no matter how much one adjusts Fertility in ToTPP / sets minimum gov to Despotism, etc. - and how to make tiles more attractive otherwise

Many thanks if anyone can point me in the right direction!
 
Does anyone know how to determine the status of a "tech group" for a tribe? That is, you can change the status of a tribe and tech group with

enableTechGroup
civ.enableTechGroup(tribe, techgroup, value) -> void

Sets the value of tech group `techgroup` (0-7) to value `value` (0-2, 0 = can research, can own, 1 = can't research, can own, 2 = can't research, can't own) for tribe `tribe`.

But there doesn't seem to be a way to get the current information.

Having thought about it a bit more, I don't think I need this information for my current project, but I thought I'd ask in case I just missed a way other than to keep track of it separately.

I'm currently working on code to prevent trading technologies that a tribe would otherwise be allowed to research. I'm going to try temporarily changing the 'group' of the relevant techs to one that the tribe(s) can't own. Originally, I thought I'd need to reserve 3 groups (tribeA can't receive, tribeB can't receive, both can't receive), which is a lot when there are only 8 total, and, so, I wanted to instead make temporary changes to the status of groups, which could later be undone. However, I realized that every tech can only be traded in one "direction" since the other tribe must already own it, so I only need to reserve one tech group for this feature.
 
DomainSpec is the part of memory that varies depending on the characteristics of the unit. From @Catfish 's saved game format:

[IMG alt="domainSpec.png"]https://forums.civfanatics.com/attachments/domainspec-png.642235/[/IMG]
Little question there.

Considering we can alter this value,
Can we also use it for units that are not settlers/caravan/airUnit ?

I looked into it, attack role land unit accept a value for this parameter and gives it back.
Has anyone tested this on multiple turns, with multiple actions, to test if this can be safely used ?
 
Considering we can alter this value,
Can we also use it for units that are not settlers/caravan/airUnit ?

I looked into it, attack role land unit accept a value for this parameter and gives it back.
Has anyone tested this on multiple turns, with multiple actions, to test if this can be safely used ?
I used it to enable unit ranges for land/sea units in the Lua Scenario Template. There is a line in simpleSettings.lua to enable it, and the enabling code is in the General Library under gen.activateRangeForLandAndSea.
 
@axx was asking me this one the other day but I didn't know the answer and now it's bothering me as some of my scenarios are doing this and others are not lol. Does anyone remember what makes a unit appear in the top left corner of the scenario introduction text box? It appears in some scenario intros but not in others and I can't remember what scenario setting controls it..

1711722935566.png
 
It's weird.. sure enough with my C&C scenario it changes based on the unit selected as expected but with my Red Alert 2 scenario no mater what unit I have selected when I save the scenario file I just cannot seem to make a unit appear in the intro window. I wonder what is stopping it working with that scenario in particular.

View attachment 687671 View attachment 687672
Hello Blake, the unit that appears is has to be activated in the civilization of "Set Objectives Protagonist" (in Scenario Parametres - Edit Vitory Conditions). If you don't have the civilization you're playing as the protagonist, the unit you want will never appear. Best regards
 
Hello Blake, the unit that appears is has to be activated in the civilization of "Set Objectives Protagonist" (in Scenario Parametres - Edit Vitory Conditions). If you don't have the civilization you're playing as the protagonist, the unit you want will never appear. Best regards
Cheers mate, that's gotta be it then. The C&C scenario was originally setup by Wonx2150 with various objectives, whereas the Red Alert scenario I've built from scratch and haven't setup that stuff. I guess I better go look into all that then and set it up lol.

EDIT: It worked! :)

1711953490534.png
 
Last edited:
Hello Blake, the unit that appears is has to be activated in the civilization of "Set Objectives Protagonist" (in Scenario Parametres - Edit Vitory Conditions). If you don't have the civilization you're playing as the protagonist, the unit you want will never appear. Best regards
I never knew that!
 
I need to access the diplomacy screen in my remaster of Wonx2150's C&C scenario so I can test custom graphics for it but not matter what I cannot get the 3 surviving Civs to enter diplomacy and always get the "begone!" blocking message. I've edited all 3 leaders in cheat mode to have cleared patience, cleared last contact, cleared reputation, attitude set to max like (enthusiastic) both ways, made allied and cleared vendettas both ways, set last contact to a long period, played for 10 turns.. everything I can think of and no matter what I cannot get anyone to talk to each other in the diplomacy screen. I had a similar issue with my Red Alert scenario but clearing the patience flag fixed that one easily yet I'm getting nowhere with Wonx's CnC scenario, it's like he's flicked the switch on some other secret setting I'm not aware of ensuring no one can ever talk to each other again. What am I missing guys?

1712502911511.png
 
Last edited:
@Blake00 All of the info I can share here is based on TOT, but my guess is that it's generally true in MGE as well (if that's what you're using).

The message you listed above appears in Game.txt under the heading @PEACENOBETRAY. With TOTPP, there is a Lua-exposed field for each tribe named "betrayals" which is documented as "the number of times the tribe has betrayed another tribe". It's a single integer, so it stores (for each tribe) their total number of "treaty breaks" against all other tribes combined. In Catfish's TOT saved game format, this is listed as "Reputation (number of betrayals)" at byte 2982 +3348N, which is different than the per-tribe "Reputation" scores at byte 3024 +3348N. So my guess is that this stored quantity of past betrayals is what is leading Civs to refuse to negotiate. But in the Cheat Menu, I don't think I see a way to edit this or clear it out. If that's correct, then in MGE you would have to resort to hex editing the save file, in order to test; in TOT, this field could be queried and/or reset with Lua.
 
Last edited:
Top Bottom