"DLL - Various Mod Components: Pick'N'Mix Mods" - "Separate GP Counters" Help

MGreene0912

Chieftain
Joined
Apr 22, 2020
Messages
2
I'm fairly new to LUA and Civ Modding in general, so let me apologize ahead of time if I'm missing something simple here..

I'm using the "Various Mod Components" .dll, along with WHoward's "Pick'N'Mix Mods".. specifically, the "Separate GP Counters" mod.

I'm trying to increase the cost of each individual counter for a player, but can't seem to find the right function to do it.

I've found a couple functions in the C++ header files that I believe are related to what I'm attempting to achieve:
"Player.incrementGreatEngineersCreated()"
"Player.getGreatEngineersCreated()"

But can't get them to work within FireTuner.

The "increment" function seems to execute successfully (no errors within the console), but it does not affect the actual game running.

The "get" function gives me syntax errors.

After going through the Dll's source code, I noticed another C++ header file ('CVLuaPlayer.h') that looks like it's declaring functions to be used via LUA? (Although I'm not sure if this is required or even how LUA works).

So my questions are:
- First of all, if anyone has experience with this mod (Separate GP Counters), am I even using the correct functions?
- And secondly, assuming I am using the correct functions, is it possible to call them from LUA without them being declared within the Dll's "CVLuaPlayer.h"? (I don't have Visual Studio installed so re-compiling is really last resort)

Any help/insight on this would be greatly appreciated.

Thanks!
 
The game core logic (within the DLL) is coded in C++
The game UI and scenarios (extensions) are coded in Lua. Mods are just fan created extensions, and are mainly (99.99% of the time) coded in Lua - the 0.01% being the few DLL mods out there.
There is no direct connection between these two languages - Lua cannot use C++ objects and C++ cannot call Lua functions.
However, there is an API that Lua can use to access some of the game core logic and the game core logic can query Lua functions via an event callback system.

FireTuner is a Lua development environment - it executes Lua, not C++
VisualStudio is a C++ development environment, but unless it has changed radically in the last few years, there is no way to call methods on random objects as the game is executing.

So the functions/methods in the C++ header files are only of relevance if you're writing a DLL mod, and remember that only one DLL can be active at a time as each DLL mod completely replaces the default game core DLL.

The CVLuaXyz header files define the bits of the game core C++ logic exposed as the Lua API, so these are the methods/function that you could call from FireTuner - somewhere on these forums is a spread sheet of all the Lua API methods/functions

Hope that helps.

Finally, you are mis-understanding what the "Separate GP Counters" mod does. It does not allow you to change the cost of specific GPs for specific players. What it does it give each GP their own counter. In the base game, Great Prophets have their own counters, but Scientists, Engineers and Merchants share a counter, so popping a GS increases the cost of the next GE/GM, etc.
 
Hey, thanks for the quick response.

Yeah, I think what I was looking to do was use the Lua API to access the game's core logic. In this case the functions related to the "Separate GP Counters" mod.

The whole reason I was attempting this was I didn't discover the Separate GP Counters mod until midway through an Epic game. The counters work fine, but the AI Players are getting Great People nearly every turn because of the counters starting at 100 (as opposed to them being in the thousands from a mid-way play through).
I guess I was just looking for a lazy solution to make the game believe they've spawned more great people to increase those individual counters' threshold; as opposed to the game actually spawning them and requiring me to manually delete them each turn.
Really not a huge issue, just figured I'd reach out to see if anyone else had tried something similar.

I appreciate the help though. And I'm especially grateful for all your mods. Completely changed the game for me. I hadn't played Civ 5 in years but now I can't stop.
So thank you for all the work you've put into them!
 
Back
Top Bottom