DLL - Lua API requests

I did it in LUA before asking, no choice because I can't dev my mod without, but my request was to have better perfs :)

For now I'm searching to understand how works the cities capture but i can'nt easily find documentation, any idea?
 
Could we please get:

  • GameEvents.CanAnnexCity(iPlayer, iCityID)
  • GameEvents.CanPuppetCity(iPlayer, iCityID)

whenever you get the chance? I feel what these two would do should be a bit self-explanatory, but let me know if you have questions. Thank you again for all your hard work on the CP and CBP; the level of dedication you have to the project is astounding.
 
Could we please get:

  • GameEvents.CanAnnexCity(iPlayer, iCityID)
  • GameEvents.CanPuppetCity(iPlayer, iCityID)

whenever you get the chance? I feel what these two would do should be a bit self-explanatory, but let me know if you have questions. Thank you again for all your hard work on the CP and CBP; the level of dedication you have to the project is astounding.

I'll give it a look.

Did you see that promotion durations are in? Have you tested them? They worked for me, but I want to make sure they work for you.

G
 
I wanted to ask about Resolutions and how the AI determines whether they will vote for or against them (or whatever). I thought I'd ask here, because I assume the Resolution code is a jumbled mess, so I would hesitate to make any specific requests as yet.

Mostly, I'd like to know whether a Lua hook could be created to catch the AI's intended response and force another instead (akin to the GetReligionToFound() event already in this DLL). And if not, if there was any way that I could make a custom resolution that was otherwise not dead weight or tied to a specific project.

Thanks for any insights.
 
Could we please get:

  • GameEvents.CanAnnexCity(iPlayer, iCityID)
  • GameEvents.CanPuppetCity(iPlayer, iCityID)

whenever you get the chance? I feel what these two would do should be a bit self-explanatory, but let me know if you have questions. Thank you again for all your hard work on the CP and CBP; the level of dedication you have to the project is astounding.

There's no function in the DLL for those events where you can hook in - the 'tests' are scattered about and are simply booleans based on factors such as whether or not the city is your capital, etc. Sorry. :/

I wanted to ask about Resolutions and how the AI determines whether they will vote for or against them (or whatever). I thought I'd ask here, because I assume the Resolution code is a jumbled mess, so I would hesitate to make any specific requests as yet.

It isn't jumbled per se, it is just heavily hard-coded in terms of valuation (I rewrote a lot of it for CSD). Essentially, each resolution looks at factors related to that resolution - religion, for example, looks at your religion, if you religion matches the one up for a vote, the opinion of your friends, etc.

G
 
There's no function in the DLL for those events where you can hook in - the 'tests' are scattered about and are simply booleans based on factors such as whether or not the city is your capital, etc. Sorry. :/

Thanks for looking. It's not much of a big deal to edit PuppetCityPopup.lua, but it'll be a bit of a chore to keep AIs from breaking the rules. I suppose I could hook something up to SerialEventCityInfoDirty, but yeesh, that'll be a performance hit.

Regarding the Promotion durations, I did test it out by adding in a few simple promotions with the tag and it worked, but it was a rather quick test. I will test them more thoroughly soon, particularly to make sure they work across saving/reloading.
 
Thanks for looking. It's not much of a big deal to edit PuppetCityPopup.lua, but it'll be a bit of a chore to keep AIs from breaking the rules. I suppose I could hook something up to SerialEventCityInfoDirty, but yeesh, that'll be a performance hit.

Regarding the Promotion durations, I did test it out by adding in a few simple promotions with the tag and it worked, but it was a rather quick test. I will test them more thoroughly soon, particularly to make sure they work across saving/reloading.

Sounds good. Promotion duration values are in the unit data sync stream, so it should save/load no problem.

Regarding the puppet stuff, what're you trying to achieve? I could simply add a lua function that allows you to check if puppeting it is possible. It won't be robust (it'll be a bool, essentially), but it'll work.

G
 
Regarding the puppet stuff, what're you trying to achieve? I could simply add a lua function that allows you to check if puppeting it is possible. It won't be robust (it'll be a bool, essentially), but it'll work.

It's for a Civ UA, part of which only allows it to annex puppets in specific circumstances. It'll be checking against things only found in that Civ's Lua, so having a pCity:CanPuppet() or something like that won't help out much. Thanks for the offer, though.
 
Top Bottom