Open Borders, Defensive Pacts, Research Agreements with LUA?

turingmachine

Emperor
Joined
May 4, 2008
Messages
1,438
Hi, so I have a custom where part of their UA is that they can establish embassies, sign open borders, enter into defensive pacts, and do research agreements without researching the pee-requisite tech.

For my Mod, I did this with a dummy tech that the civ starts out with but no one else can research. However, this has proven unfeasible as if you start the game in a later era everyone gets the dummy tech (despite it being disabled) and setting the tech to a later era doesn't help as then my civ starts in that later era.

So, I want to know if I can activate these 4 things (embassies, borders, defensive pacts, research agreements) for the civ with LUA at game start?

If so, can someone help me with the code? Despite being able to make things with python in Civ IV, I'm finding myself absolutely unable to get anything working with LUA in Civ V modding.

Thanks!
 
Hello.

What you want is not possible (you can manually enter some agreements through LUA but you cannot enable the "player can do trade agreement" flag). However did you try to make your tech "disabled" (see the Disable column): it will appear with a lock for every other civilization and they cannot train it, so I guess they won't get it.
 
Hello.

What you want is not possible (you can manually enter some agreements through LUA but you cannot enable the "player can do trade agreement" flag). However did you try to make your tech "disabled" (see the Disable column): it will appear with a lock for every other civilization and they cannot train it, so I guess they won't get it.

I did do the disable tech. The problem is, if say the disable tech is ancient era, if you choose to start in any later era, the game gives all players all earlier techs (even the disabled ones). If you counter this by making the disabled tech future era, the player you give it to for free starts as future era which affects research rates and build times. So unless I force ancient era starts with the mod, it's not really a workable solution.

Sucks that you can't enable those agreements with LUA. Thanks for your help, though.
 
So it even grants the disabled ones...
Another idea then: let it grant them, then remove them through LUA.

I'm not sure that will make a difference. I think the Open Borders etc. is a one time trigger. So once the game gives them the tech they have it, regardless of if you then take that tech away.
 
Or you could try to make it a future tech, then immediately use team:setcurrentera after that.

Sigh, still has problems, namely the civ still starts with 5 spies from starting in the future era initially. Can you remove spies with LUA?

I don't know, I think there's simply no easy workaround for my problem unless I force ancient starts.
 
Back
Top Bottom