Diplomatic Victory mod - How/possible?

Joined
Jul 10, 2012
Messages
507
I want to make a mod that changes how the UN voting system works.
Without going into to much detail:

- Happiness provides a base "diplomacy score". For voting, City state votes are worth 3 points, civs are worth 10, which is added to the above.

- If 2 civs have a public declaration of friendship, the one with the lower score, with a difference of 7 or more points (includes city state votes but not civ votes, of course) votes for the one with the higher. The

- city states that were married to Austria count as a vote for her.

Otherwise, everything is how it is in game, city states vote for allies, civs vote for themselves, liberated civs and city states will always vote for you, etc

Is this possible? How would I do this?
 
tumbleweed.jpg
 
"Tumbleweed" usually means "no one knows how to do what you're asking" or "you'll need the DLL to do that"

In this case, I'm guessing both apply
 
"Tumbleweed" usually means "no one knows how to do what you're asking" or "you'll need the DLL to do that"

In this case, I'm guessing both apply

Well, then they should say that. :rolleyes:

I have a ton of ideas for great mods, the issue is I don't know what is or isn't possible to do without the DLL.

For example:

- New victory conditions/changing the way the current ones work
- Adding new diplomatic options, and having the AI make use of them. (for example, being able to accuse the AI of being near your borders, or having to state the reason for a denouncment, or making trades/demands/actions be easier/harder/more of an effect)
- Changing unique abilities to have event specific traits (Say, as Ghengis kahn, making it so if you demand a city and it is refused, then only giving you the option to raze it)

I could go on and on.

Maybe I should just make a "What is or is not possible to mod?" thread...
 
You can change victory conditions, see the scenarios. It will just require a bit of Lua work (well, more than "a bit" for you're OP proposal to be true...)

Reworking diplo would require the DLL source or more game events.
 
@Jabberwockxeno,

Since we have 95% control of UI, many things are possible if you are motivated and a proficient Lua coder. Yes, you can do what you want entirely via Lua. Here is how:
  1. Disable the existing "Diplomacy Victory" (easy)
  2. Add a new victory condition called "Diplomacy Victory" (easy)
  3. Write all of the Lua logic to do everything you said in your OP, including your own UN voting system (hard, but totally possible)
  4. Integrate this with the existing UI so it appears as the Diplomacy Victory (medium)
  5. Write some AI to help AI civs toward your victory (easy to hard depending on how good you want it to be)
Very roughly (for my skill level):
"easy" = 2 hours
"medium" = 20 hours
"hard" = 200 hours (possibly an exaggeration, but don't count on it)

It's a general approach I've used a lot in my mod. Disable a system entirely and then build your own via Lua. But it is worth noting that I have been coding intensively for a year and my mod is, at best, pre-alpha.
 
@Jabberwockxeno,

Since we have 95% control of UI, many things are possible if you are motivated and a proficient Lua coder. Yes, you can do what you want entirely via Lua. Here is how:
  1. Disable the existing "Diplomacy Victory" (easy)
  2. Add a new victory condition called "Diplomacy Victory" (easy)
  3. Write all of the Lua logic to do everything you said in your OP, including your own UN voting system (hard, but totally possible)
  4. Integrate this with the existing UI so it appears as the Diplomacy Victory (medium)
  5. Write some AI to help AI civs toward your victory (easy to hard depending on how good you want it to be)
Very roughly (for my skill level):
"easy" = 2 hours
"medium" = 20 hours
"hard" = 200 hours (possibly an exaggeration, but don't count on it)

It's a general approach I've used a lot in my mod. Disable a system entirely and then build your own via Lua. But it is worth noting that I have been coding intensively for a year and my mod is, at best, pre-alpha.

Maybe I'm underestimating the difficulty of Lua, but wouldn't it be possible to just copy paste the existing code for city state voting, replace city state with civ, and ally with friends to start with?
 
Keep in mind that all of the other replies to your OP were "wait for dll". The benefit of waiting for the dll is that, at that time (if it is not 50 yrs in the future), you will be able to simply modify the existing code with your own voting logic, without having to fuss with UI (I think). What I'm giving you is an alternative, and not an easy one. Some would call it a hack.

No you can't copy the existing code. First, it's in the dll. Second, it's not the logic that you state in the OP. The logic you have in the OP is fairly straightforward. The Lua for that might take me an hour to write, but only because I already know how to access happiness, etc. (these things take much much longer when you are learning). You also have to think about data structures. What information are you going to need? What info needs to be preserved from turn to turn and how are you going to do that? (if you are disabling the core system, you at least will have to track when the last UN vote happened)
 
Keep in mind that all of the other replies to your OP were "wait for dll". The benefit of waiting for the dll is that, at that time (if it is not 50 yrs in the future), you will be able to simply modify the existing code with your own voting logic, without having to fuss with UI (I think). What I'm giving you is an alternative, and not an easy one. Some would call it a hack.

No you can't copy the existing code. First, it's in the dll. Second, it's not the logic that you state in the OP. The logic you have in the OP is fairly straightforward. The Lua for that might take me an hour to write, but only because I already know how to access happiness, etc. (these things take much much longer when you are learning). You also have to think about data structures. What information are you going to need? What info needs to be preserved from turn to turn and how are you going to do that? (if you are disabling the core system, you at least will have to track when the last UN vote happened)

My understanding was that since modbuddy uses a modular system, that I could just add on new info to the existing code, and do something like this, for example (using my own totally made up language, just to get the idea across):

----------------------------------------------------------------------------------------------
VCdiplomatic:
.......Win = ((Xciv_votes > Yciv_votes) AND (Xciv_votes - Yciv_votes > 5))
...............Where:
..................Xciv = [Any given civ]
..................Yciv = [Any given civ other than Xciv]
.................._votes = (A + 3B + 10C)
..........................Where:
...............................A= (Xciv_happyness)
...............................B = (#{citystate_status=ally)
...............................C = (Yciv_status=friends) AND (((Xciv_(A + 3B)) > (Yciv_(A + 3B))) AND (((Xciv_(A + 3B)) - (Yciv_(A + 3B)) > 3)

------------------------------

Then just copy paste the liberated code already in use and make sure it's not applied in a way so that it occurs in addition with the above (IE:, a civ gets more than one vote because it was liberated).

Of course, since we don't have the DLL, we can't do it.

I am understanding that correctly?

Also, I'm confused by your
"The logic you have in the OP is fairly straightforward. The Lua for that might take me an hour to write, but only because I already know how to access happiness, etc. "

Does this mean it would take you about an hour to make this mod right now, or that it would if we had access to the DLL?
 
He means that the logic would take him an hour to translate in Lua. Then you'll have the user interface to add, making the AI understand it, etc... Not one hour for the whole mod, one hour for the logic, which would not be the bigger part...

We don't have access to the DLL, yes, but in your specific case you can disable the existing victory condition and create a new one in Lua using the logic of your OP.
 
He means that the logic would take him an hour to translate in Lua. Then you'll have the user interface to add, making the AI understand it, etc... Not one hour for the whole mod, one hour for the logic, which would not be the bigger part...

We don't have access to the DLL, yes, but in your specific case you can disable the existing victory condition and create a new one in Lua using the logic of your OP.

Alright...

I'm just wondering now that if it is possible, then why nobody has tried it yet as far as I can tell.

The diplomatic VC is one of the more complained about things in game...
 
So I just built the UN for the first time in a game...

I thought civs always voted for themselves unless they were liberated? Was this changed so they can't vote for themselves in a patch or something?
 
Back
Top Bottom