Small Questions Thread

Hi @Prof. Garfield another quick one:

I want to be able to use the Diplomacy/Foreign Minister screen (especially the "Check Intelligence" screen), but at the same time, I want to forbid negotiations between tribes. When I'm using the onNegotiation event, what I noticed is that when it returns false, the talker/listener tribes with forbidden negotiations don't even appear in the diplomacy screen, so I can't "check intelligence" on them.

If I uncomment the diplomacy.setEventTreatiesOnly() call on the diplomacySettings.lua, the Diplomacy/Foreign Minister screen is completely disabled.

Is there a way to block the "send emissary" option only, as well as AI diplomacy interactions, but leave the tribes visible in the screen and to be able to "check intelligence" if there's embassy established?

Thanks,

Pablo
I'm pretty sure this is a difference between MGE and ToT. As far as I know, in ToT, if events stop you from negotiating with another tribe, you can't see them at all. It confused me a bit for a while as well. Maybe you can play with tribe attitude or patience to prevent negotiation and still have the tribe show up in the diplomacy screen. Or, you'll have to write some code to generate the relevant information for the human player.
 
I'm pretty sure this is a difference between MGE and ToT. As far as I know, in ToT, if events stop you from negotiating with another tribe, you can't see them at all. It confused me a bit for a while as well. Maybe you can play with tribe attitude or patience to prevent negotiation and still have the tribe show up in the diplomacy screen. Or, you'll have to write some code to generate the relevant information for the human player.

Thanks, just what I thought. For now what I'm doing is to set up aggressions and vendettas all the time so they don't try to negotiate, but I was wondering if there's a cleaner way with Lua. Thanks!
 
Hi @Prof. Garfield are you aware of any way we could choose the text font colour in a dialog? The way for instance "can build", "can never research", etc texts are displayed in Civilopedia. I guess not but worth asking :) Thanks
I don't know of a way to do that, and there is no indication of it in the dialog documentation. I also can't think of any in game dialog box that colours text, so I'm confident that it can't be done.
 
Hi @Prof. Garfield a "small question" for you...

So I started my scenario with 6 playable tribes, instead of the maximum of 7. But now I regret this as I see a potential use of an extra tribe...can I use Lua to "resurrect" the unused tribe into the game without having to start a new game and use your copygamepieces script?

Thanks
 
So I started my scenario with 6 playable tribes, instead of the maximum of 7. But now I regret this as I see a potential use of an extra tribe...can I use Lua to "resurrect" the unused tribe into the game without having to start a new game and use your copygamepieces script?

I haven't done that, but maybe you can use this command to do that:

activeTribes (get/set)
game.activeTribes -> integer

Returns the active tribe mask.

If this doesn't work, try causing a civil war to get an extra tribe back. Beyond that, I don't have any suggestions.
 
@Pablostuka

I just tested this. I'm not sure why I didn't bother before, since it is very simple to start a new game with fewer players, then use civ.game.activeTribes = 255 in the console. Of course, these tribes must be given a settler unit or city so they aren't "killed by barbarians".

Worked like a charm, though I'm not sure how the game chooses which civ to revive. On two tries, at least one of the tribes was not from the first 7 tribes in the Leaders list.
 
@Pablostuka

I just tested this. I'm not sure why I didn't bother before, since it is very simple to start a new game with fewer players, then use civ.game.activeTribes = 255 in the console. Of course, these tribes must be given a settler unit or city so they aren't "killed by barbarians".

Worked like a charm, though I'm not sure how the game chooses which civ to revive. On two tries, at least one of the tribes was not from the first 7 tribes in the Leaders list.
This worked great!
1665009121703.png

I had a failsafe name "french2" in my rules.txt and it just picked it up. Now I have it back to the game :)
1665009061486.png

1665009084543.png

Thanks!
 
Hi @Prof. Garfield , quick one that might have been asked before but I've used the search functionality and couldn't find it.

So we have the commodity and unit objects. However I can't find a Lua way to link both. Basically I want to be able to create a trade unit (caravan) carrying a specific commodity of the ones available in the @Caravan section of the rules.txt file. Is it possible?

Thanks,

Pablo
 
Hi @Prof. Garfield , quick one that might have been asked before but I've used the search functionality and couldn't find it.

So we have the commodity and unit objects. However I can't find a Lua way to link both. Basically I want to be able to create a trade unit (caravan) carrying a specific commodity of the ones available in the @Caravan section of the rules.txt file. Is it possible?

Thanks,

Pablo
Change the unit.domainSpec field of the caravan unit.
 
Change the unit.domainSpec field of the caravan unit.
domainSpec (get/set) (since 0.16)
unit.domainSpec -> integer

Returns the value of the 'domain-specific counter' of the unit
Thanks, does the integer returned correspond to the id of the commodity (0-15 for regular commodities, -1 for food supplies)? Can't find any explanation in the forums of what that domainSpec actually means.
 
Thanks, does the integer returned correspond to the id of the commodity (0-15 for regular commodities, -1 for food supplies)? Can't find any explanation in the forums of what that domainSpec actually means.
I think the ids are equivalent, but best to check to make sure.

DomainSpec is the part of memory that varies depending on the characteristics of the unit. From @Catfish 's saved game format:

domainSpec.png
 
Rules.txt question about terrain
Can anyone tell me what the "no" in this line is for?
Code:
Desert,     1,2,  0,1,0,   yes, 1, 5, 5,   yes, 1, 5,  3,  Pln,  no, ; Drt
 
This is the "impassable" option for lands.
It allows per exemple to make mountain tiles or underground earth and rock tiles impassables in the TES scenario ;)
 
Last edited:
Just a small question: Would it be possible that, every time if a certain tribe has conquered a city, lua checks if the conquered city has a specific improvement built and lua automatically deletes it.
For example, if the habsburgs conquer a Mesoamerican city, the Temple improvement should be destroyed automatically.

I know that I can set it for each city in 'onCityTaken.lua' but maybe there will be a generic code which checks this so that I don't have to set it for each single city on the map.
 
Just a small question: Would it be possible that, every time if a certain tribe has conquered a city, lua checks if the conquered city has a specific improvement built and lua automatically deletes it.
For example, if the habsburgs conquer a Mesoamerican city, the Temple improvement should be destroyed automatically.

I know that I can set it for each city in 'onCityTaken.lua' but maybe there will be a generic code which checks this so that I don't have to set it for each single city on the map.
I think this is what you want (untested):
Code:
function discreteEvents.onCityTaken(city,defender)
    if city.owner == object.pHabsburgs and defender = object.pMesoamericans then
        city:removeImprovement(object.iTemple)
    end
end
(removeImprovement can be called even if that improvement isn't in the city)
 
Back
Top Bottom