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:
Hmm thought I'd replied to this sorry.. Yup it's an old MGE scenario. I tried to figure it out using both the above ToT hex guide and the old MGE hex editing guide from 20 years ago but had no luck and gave up.. I really struggle with the hex editing stuff.. hardly anything ever seems to be where the guides say they are (whether I have the editor set to decimal or hex) and they don't say what to change the gibberish values to even when I do find what I'm after.. how people work all this stuff out and make huge changes to games is like magic to me lol. It's a shame as I've built a lovely custom diplomacy screen for that scenario and no one will ever see it. Guess that's what I get for remastering an old existing scenario instead of making my own new one lol, as god knows what Wonx2150 did when making that scenario, judging by your post he must have played a whole darn game and had everyone betray everyone a ton of times.. sigh..

Anyway I got a couple more hopefully much easier questions this time guys..

1. Helicopters don't crash when they run out of health do they? Am pretty sure they just keep going on forever with no health but thought I'd double check.

2. Is there a guide out there that lists the complete unit upgrade paths when you have Leonardo's Workshop? I know most of them off by heart but want to make sure I don't miss any while designing my current scenario project.
.
 
Helicopters don't crash when they run out of health do they?
I believed they kept going with 0.1 (considering rule.txt scale - 1 considering in game lua scale) last hitpoint ?

Is there a guide out there that lists the complete unit upgrade paths when you have Leonardo's Workshop
I guess it is correct there :
fandom page
 
Last edited:
I tried to figure it out using both the above ToT hex guide and the old MGE hex editing guide from 20 years ago but had no luck and gave up.. I really struggle with the hex editing stuff.. hardly anything ever seems to be where the guides say they are (whether I have the editor set to decimal or hex) and they don't say what to change the gibberish values to even when I do find what I'm after.. how people work all this stuff out and make huge changes to games is like magic to me lol. It's a shame as I've built a lovely custom diplomacy screen for that scenario and no one will ever see it. Guess that's what I get for remastering an old existing scenario instead of making my own new one lol, as god knows what Wonx2150 did when making that scenario, judging by your post he must have played a whole darn game and had everyone betray everyone a ton of times.. sigh..
Well, if you want to PM me a zipfile of your scenario folder, I'd be willing to try hex editing the file myself. (I'd prefer to have the whole folder, not just the .scn or .sav file, in order to be able to run accurate tests.) No promises, but I have had success with small hex editing projects in the past, so maybe I can figure it out. Entirely up to you though -- don't feel like you have to take me up on this.
 
Does anyone happen to know if it’s possible to make an event where if a civilization used a nuclear weapon their reputation would tank with all other civilizations, all civilizations would end alliances, all civilizations would declare war on civilization that used nuclear weapons?

From what I have read it sounds like it’s possible was just hoping someone had already made such a thing to save myself trial and error time.
 
Last edited:
Also does anyone happen to have any coastline terrain graphics where it looks like the land is elevated compared to the sea?
 
Don't have that in stock.
Guess that must it pretty hard to do, having smaller shores at the top and bigger with height simulation at the bottom keeping the multiple connections right.
 
Top Bottom