Mod Component Request Thread

I'm not certain if anyone actually responds to this thread... but I'll give it a try:

In my mod, I wish to have positive and negative diplomatic modifiers that are inherent between civilizations. For example, I want Denmark and Sweden to always be a little friendly with each other... perhaps "We share a similar culture" would be the text for this. Similarly, I wish some civilizations to always be a little against each other... for instance, the Celts and Denmark may always be a little against each other, as in "This is our island, stay out!".

I've seen the following lua function that would serve:

GetScenarioDiploModifier1(ePlayer1, ePlayer2)

As of now, the coding is beyond me... I'll learn, and I've looked in the game files, but nothing there quite does what I want. I really need a very good template and I can take it from there. All I need is something that would say (+ 25) diplomacy (or so) between players no. 0 and 15 (which are the id numbers for Denmark and Sweden in my mod... and this would stay throughout the game.

Similarly, I want to have such values between some minor civilizations and playable civs. I not certain if the above function will work for minors as well.

So if someone were able to make a template that I could follow and adjust to my specific civs in my mod, I would appreciate it. I have a feeling it is only a moments work for someone familiar with lua while it is likely at least a week of frustration for me.

Thank-you in advance.
 
Can you turn a city that you own into a Puppet (ie - not as you "take it" or as you "settle it" but after it's already been built)?

I was thinking it'd be neat to have a mod called "Home Rule" (or something along those lines) where you could grant Home Rule status to a city. They become a Puppet.

Only serious problem I'd see is someone using it to create a whole bunch of puppets to lower their cultural points limit to quickly get a Policy. Or to be able to build a National Wonder. So it'd be neat if there was some sort of penalty for going back and forth...?
 
I'm not certain if anyone actually responds to this thread... but I'll give it a try:

In my mod, I wish to have positive and negative diplomatic modifiers that are inherent between civilizations. For example, I want Denmark and Sweden to always be a little friendly with each other... perhaps "We share a similar culture" would be the text for this. Similarly, I wish some civilizations to always be a little against each other... for instance, the Celts and Denmark may always be a little against each other, as in "This is our island, stay out!".

I've seen the following lua function that would serve:

GetScenarioDiploModifier1(ePlayer1, ePlayer2)

As of now, the coding is beyond me... I'll learn, and I've looked in the game files, but nothing there quite does what I want. I really need a very good template and I can take it from there. All I need is something that would say (+ 25) diplomacy (or so) between players no. 0 and 15 (which are the id numbers for Denmark and Sweden in my mod... and this would stay throughout the game.

Similarly, I want to have such values between some minor civilizations and playable civs. I not certain if the above function will work for minors as well.

So if someone were able to make a template that I could follow and adjust to my specific civs in my mod, I would appreciate it. I have a feeling it is only a moments work for someone familiar with lua while it is likely at least a week of frustration for me.

Thank-you in advance.
there is GetScenarioDiploModifier1, GetScenarioDiploModifier2 and GetScenarioDiploModifier3

for 50 bonus in relation between Denmark and Sweden in your mod in Lua:
Code:
GameEvents.GetScenarioDiploModifier1.Add(function(ePlayer1, ePlayer2)


	if (ePlayer1 == 0 and ePlayer2 == 15) or  (ePlayer2 == 0 and ePlayer1 == 15) then
		return -50
	else
		return 0
	end
end)

then you need to add a text entry for GetScenarioDiploModifier1, I suppose something like that:
Code:
		<Row Tag="TXT_KEY_SPECIFIC_DIPLO_STRING_1">
			<Text>We've shared ale in the skulls of our enemies.</Text>
		</Row>

I've not played with that yet, so it may not been totally acurate, and I've noted that there is TXT_KEY_MEDIEVAL_SCENARIO_SPECIFIC_DIPLO_STRING_1 in medieval scenario, and TXT_KEY_STEAMPUNK_SCENARIO_SPECIFIC_DIPLO_STRING_1 in steampunk scenario, both using the same GameEvents.GetScenarioDiploModifier1.

I don't know if it's hardcoded to use any TXT_KEY*_SPECIFIC_DIPLO_STRING_1, and if we can have 3 modifier per mod or if it's 3 modifiers for all mods, making mods using them incompatibles... I suppose it's the latter with GameEvents being global, but the TXT_KEY naming is strange.

For minor civs, you'll have to use one of the events called each turn and use player:SetMinorCivFriendshipWithMajor( value ) and player:GetMinorCivFriendshipWithMajor()
 
I don't know if it's hardcoded to use any TXT_KEY*_SPECIFIC_DIPLO_STRING_1, and if we can have 3 modifier per mod or if it's 3 modifiers for all mods, making mods using them incompatibles... I suppose it's the latter with GameEvents being global, but the TXT_KEY naming is strange.

That naming convention is standard for custom scenarios, where the name of the mod is a TXT_KEY_ value which is then (mangled and) used to form other keys.

If that's the case this may only work for custom scenario mods (ie ones with HideSetupScreen = true)
 
ho, I see, like the custom background entry for those. I know the GetScenarioDiploModifier1-2-3 are working in normal game, and I plan to test it in one of my (non-custom scenario) mod, I'll report here if I'm able to change the text entry if no-one I've tried it before I do.
 
yes, but please note then in the example we were talking of a scenario in which the player ID are fixed for each civilization. The code need a few more lines to be used as an example of specifics civ-civ relationship modifier for all mods (see your thread in the Lua section)
 
That naming convention is standard for custom scenarios, where the name of the mod is a TXT_KEY_ value which is then (mangled and) used to form other keys.

If that's the case this may only work for custom scenario mods (ie ones with HideSetupScreen = true)

Update : tested TXT_KEY_SPECIFIC_DIPLO_STRING_1 with success.
 
I used the code that Gedemon and Whoward69 so nicely provided to set up a diplomatic modified for two civilization.... it certainly works; however, a couple of things.

-the players attitude does not seem to reflect the modifier - I tried 50/70/100 values, and my civilizations always stay with a neutral attitude (unless effected by other modifiers.

- I duplicated the code in two different lua files, and with two different pairs of civilizations. Only the latter showed up (I used the print command for debugging) in the log file. It would seem that the modifier may not be usable in more than one specific case (although it may be able to be reiterated, that it beyond my programming skill to check). Anyhow, the same diplomacy modifier function between two different pairs of civilizations in two different files, appears to work for only one pair.
 
Hello! First post here, long time casual Civ Player here.

I've been looking for a Mod that allows Air units to air strike improvements... IE pillage them. And I've had no luck.

If anyone knows of one, or can whip up something i'd be greatfull. I'm a total noob when it comes to creating mods.
 
One mod that could be made is a modcomp where unique unit upgrades would be versions of that unit. For example, this could be the upgrade path for the Mohawk Warrior:Mohawk Warrior-->Elite Mohawk Warrior(Longswordsman)-->Early Thunder Braves(Musketman)-->Dicsiplined Thunder Braves(Rifleman)-->Great War Thunder Braves(Great War Infantry)-->Modern Thunder Braves(Infantry)
Of course these units would be trainable as usual.
 
One mod that could be made is a modcomp where unique unit upgrades would be versions of that unit. For example...

This is an interesting idea for flavor, but there's also an aspect in helping the player recognize a unit with special abilities that retains those abilities after an upgrade. This is true even if the unit isn't unique, e.g., a Privateer that has upgraded to a Destroyer that still retains the ability to convert defeated ships.
 
I have a (I hope) very simple mod-request: to change the start bias of The Netherlands from grasslands in marsh.
 
Is there a mod to add gold at the beginning of the game? or something like a building add on each new city to boost the production, ie monument 1c, 2g, 3p.
I find that the game is too slowly, especially in high level (big difference between player and AI...).
Thanks for your answers and sorry for my basd english! :blush:
 
I read in a how to manual once that is was pssible to mod the game so that the different victories (i.e. scientific, cultural, domination, ect.) don't actually end the game, but instead just add a point value to your score. I would love to see this mod. Has it been made allready?
 
1.) Can we have a mod which makes ruins grant a flat amount of Science instead of technologies? The way it is now, it's all too common for a ruin to give you a tech you're currently researching.

2.) I'd miss having river and coastal tiles granting trade routes in the ancient era. I'd like Sailing to allow such connections, but ONLY if all coastal and riverside tiles used to make the connection have been claimed by your culture. This way, you can't place your water-connected cities more than 7 tiles apart until you get Compass.
 
Hello. May anyone create a simple mod which would make it impossible to have both "Tradition" and "Order" social policies adopted at the same time?
 
Hey! First time posting here, though been reading for a while :)

I was trying to solve that age old dilemma of technology speed...came up with a different idea, but wanted some help if possible. My idea was to force the completion of one Era before being able to research technologies in the next. Seems to make sense gameplay-wise (since the unit/building jump is pretty dramatic from era to era, and there's still a lot of individuality in choosing which techs to research even within an era) and I'm tired of the AI skipping a bunch of techs to get currency or civil service or whatever. Just seems like it'd balance out the pace of the game too....

...anyhoo, back to my query: I know I can alter the prereq techs for each technology, but is there a simpler way to create the mod where one Era has to be completed before the next one can be unlocked? Seems like there should be a .xml or .lua file that could do that, but I can't find it.

That's my request! Any advice would be appreciated!
 
Top Bottom