Sukritact's Events and Decisions

Just curious here. Wouldn't it be possible to set up an Lua event and then just have authors adding new Decisions use a listener with the Add function? That would allow plug and play functionality and would avoid having to alter the core file to add new includes.
That should be possible; though I can't say I see a difference functionally. The altering of includes is already done modularly (it already is plug and play); none of the core files need to be altered.
 
Oh, if anyone would like to propose National Decisions for those civs that still lack decisions, feel free to do so. I can't guarantee I will use them, but ideas will be helpful nonetheless.

What do the various decisions you've already got actually do? It might give us a better idea of what's possible and what you've already done (to avoid repetition).
 
It's a really long list unfortunately. A lot of the older ones will probably be redone at some point. In any case, it doesn't matter too much; there's bound to be some rehashing and variants since we do ultimately need 86 decisions total. The issue is more finding historical features and events that fits the civs' playstyles.

As to what's possible; like I said, if you can do it via Lua, you can do it via Decisions. Effects done via dummy buildings and policies are also possible. Let me give you examples of a few of my favorites:

Code:
		<Row Tag="TXT_KEY_DECISIONS_AMERICANPURCHASE">
			<Text>The Louisiana Purchase</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_AMERICANPURCHASE_DESC">
			<Text>
				In 1803 Napoleon of France was hard pressed for cash as he was set on a dream of European hegemony. He therefore offered the Louisiana Territory, a vast region between the Mississippi and the Rockies against a lump sum of 15 million dollars. The President and the Senate agreed and the United States nearly doubled its size.[NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be America
				[NEWLINE][ICON_BULLET]Must have completed at least 1 Social Policy tree
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{1_Gold} [ICON_GOLD] Gold
				[NEWLINE][ICON_BULLET]2 [ICON_MAGISTRATES] Magistrates
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]Founded cities start with additional territory
			</Text>
		</Row>

Basically allows the US to buy the Shoshone UA for 800 Gold and 2 Magistrates. As an interesting side note, the first city to be founded after enacting this decision will be automatically renamed Baton Rouge.

Code:
		<Row Tag="TXT_KEY_DECISIONS_SIAMEMBASSIES">
			<Text>Send Out Embassies</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_SIAMEMBASSIES_DESC">
			<Text>
				Siam's position as one of the greatest empires in the world must be properly established. Sending embassies to the many lesser nations should help to proclaim our glory![NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Siam
				[NEWLINE][ICON_BULLET]Must know at least 4 City States
				[NEWLINE][ICON_BULLET]Player must be at Peace
				[NEWLINE][ICON_BULLET]May only be enacted in the Renaissance or Industrial Era
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{1_Gold} [ICON_GOLD] Gold
				[NEWLINE][ICON_BULLET]2 [ICON_MAGISTRATES] Magistrates
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]+80 [ICON_INFLUENCE] Influence with 1 random City State
				[NEWLINE][ICON_BULLET]+40 [ICON_INFLUENCE] Influence with 3 random City States
			</Text>
		</Row>

Narai's Embassies, just a relatively cheap way (500 Gold total) to befriend a bunch of CSs fast. I'm probably gonna increase the known CS requirement at some point.

Code:
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANNOME">
			<Text>Establish the Nomes</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANNOME_DESC">
			<Text>
				Ancient Egypt was divided into 42 subdivisions called Nomes or Sepats; this division remained in place for more than three millennia. The areas of the individual Nomes and their ordering remained remarkably stable. Some, like Xois in the Delta or Khent in Upper Egypt, were first mentioned on the Palermo stone, which was inscribed in the Fifth Dynasty. The names of a few, like the nome of Bubastis, appeared no earlier than the New Kingdom.[NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Egypt
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{1_Cost} [ICON_GOLD] Gold
				[NEWLINE][ICON_BULLET]{1_Cost} [ICON_PEACE] Faith
				[NEWLINE][ICON_BULLET]1 [ICON_MAGISTRATES] Magistrates
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]Unlocks the "Empower the Pharaoh" Decision
				[NEWLINE][ICON_BULLET]Unlocks the "Empower the Nomarchs" Decision
				[NEWLINE][NEWLINE][COLOR_POSITIVE_TEXT]Note: The two unlocked Decisions will allow you to gain [ICON_GOLD] Gold or [ICON_PEACE] Faith from Enacting Decisions[ENDCOLOR]
			</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANPHARAOH">
			<Text>Empower the Pharaoh</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANPHARAOH_DESC">
			<Text>
				Centralise power within the empire. Let Pharaoh, the Embodiment of Horus, Lord of the Two Lands, reign supreme as God-King over all of Egypt! Long may he reign![NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Egypt
				[NEWLINE][ICON_BULLET]"Establish the Nomes" must be enacted
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]1 [ICON_MAGISTRATES] Magistrates
				[NEWLINE][ICON_BULLET]Unenacts the "Empower the Nomarchs" Decision if enacted
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]Receive {1_Reward} [ICON_PEACE] Faith when you enact a decision.
				[NEWLINE][NEWLINE][COLOR_POSITIVE_TEXT]Note: the amount received will increase as you advance through the Eras[ENDCOLOR]
			</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANNOMARCH">
			<Text>Empower the Nomarchs</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_EGYPTIANNOMARCH_DESC">
			<Text>
				Lessen the burden on Pharaoh's shoulders and de-centralise power within the empire. Let the Nomarchs assume greater control over their respective Nomes[NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Egypt
				[NEWLINE][ICON_BULLET]"Establish the Nomes" must be enacted
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]1 [ICON_MAGISTRATES] Magistrates
				[NEWLINE][ICON_BULLET]Unenacts the "Empower the Pharaoh" Decision if enacted
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]Receive {1_Reward} [ICON_GOLD] Gold when you enact a decision.
				[NEWLINE][NEWLINE][COLOR_POSITIVE_TEXT]Note: the amount received will increase as you advance through the Eras[ENDCOLOR]
			</Text>
		</Row>

A set of decisions; the latter two require you to already have established Nomes within Egypt. I've added a LuaEvent for when you enact a decision.

Code:
		<!-- Denmark -->
		<Row Tag="TXT_KEY_DECISIONS_DENMARKRAID">
			<Text>Go on a Viking against {1_Name}</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_DENMARKRAID_DESC">
			<Text>
				The people of {1_Name} are rich and fat. We shall do what our people have always done, and call a raid against them. Our blades will fall upon them as we claim their riches for our own![NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Denmark
				[NEWLINE][ICON_BULLET]Must have a Melee Unit in the Capital
				[NEWLINE][ICON_BULLET]May not be enacted after the Medieval era
				[NEWLINE][ICON_BULLET]May only be enacted once per City State[NEWLINE][ICON_BULLET]May only be enacted 8 times per game[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{2_Chance}% chance the unit is killed
				[NEWLINE][ICON_BULLET]-60 [ICON_INFLUENCE] Influence with {1_Name}
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]{3_Reward} [ICON_GOLD] Gold
				[NEWLINE][NEWLINE][COLOR_POSITIVE_TEXT]Note: Higher level units are less likely to be killed[ENDCOLOR]
			</Text>
		</Row>

One of these decisions are generated for each CS in the game, so the text changes to match. The Russians have a city-based generated decision as well.

Code:
		<Row Tag="TXT_KEY_DECISIONS_SPAINCOLUMBUS">
			<Text>Fund Columbus's Expedition</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_SPAINCOLUMBUS_DESC">
			<Text>
				Explorer Christopher Columbus made two attempts in 1485 and 1488 to convince the King of Portugal, John III, to finance an expedition to try and find a western route to the Orient. After being rejected the second time, Columbus turned his efforts towards the Spanish Crown. Backed up by Italian investors, Columbus finally managed to convince King Ferdinand to agree to the expedition. In August 1492, after having been made 'Admiral of the Seas' and promised a share of the profits, Columbus finally set sail.[NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Spain
				[NEWLINE][ICON_BULLET]Must have researched Astronomy
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{1_Gold} [ICON_GOLD] Gold
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]2 Caravels appear near the Capital
				[NEWLINE][ICON_BULLET]A Great Admiral appears near the Capital
				[NEWLINE][NEWLINE][COLOR_NEGATIVE_TEXT]Warning: Your Capital should be within working range of an Ocean[ENDCOLOR]
			</Text>
		</Row>

A good number of Civs have something similar to this, Sweden's Indelningsverket basically let's you buy an army :D

Code:
		<!-- Rome -->
		<Row Tag="TXT_KEY_DECISIONS_ROMANCONCRETE">
			<Text>Introduce Concrete</Text>
		</Row>
		<Row Tag="TXT_KEY_DECISIONS_ROMANCONCRETE_DESC">
			<Text>
				The development of concrete transformed Roman construction methods. The addition of Pozzolana, a sandy black volcanic ash named after an area around the Bay of Naples, created a stronger paste which allowed for construction underwater, something crucial for bridge building. Concrete also allowed the construction of elaborate architectural features, such as curved columns and arches, the most notable examples of these being in the Pantheon in Rome.[NEWLINE]
				[NEWLINE]Requirement/Restrictions:
				[NEWLINE][ICON_BULLET]Player must be Rome
				[NEWLINE][ICON_BULLET]Must have researched Engineering
				[NEWLINE][ICON_BULLET]May only be enacted once per game
				[NEWLINE]Costs:
				[NEWLINE][ICON_BULLET]{1_Science} [ICON_RESEARCH] Science
				[NEWLINE][ICON_BULLET]1 [ICON_MAGISTRATES] Magistrates
				[NEWLINE]Rewards:
				[NEWLINE][ICON_BULLET]+10% [ICON_PRODUCTION] Production when constructing Buildings or Wonders in the Capital
			</Text>
		</Row>

This is one of the more passive ones. Done via an invisible building in the Capital.
 
Basically a decision is a Lua table, which you supply a name, a description, a "CanFunc" and a "DoFunc" to. There will also be a number of global entries and functions that I will ask people not alter (adding a decision basically amounts to including an extra Lua file in an ever increasingly long line of includes).

The code rather reminds me of the modified UI code I've been using to add new missions -- DoFunc is the meat of the function, doing whatever you need it to do. I suspect my big bottleneck is going to be actually coming up with ideas for decisions -- I'm always amazed at what people manage to come up with for new UAs and such, whereas mine tend to be more "what do I know how to do, and what can I do with that?" Admittedly, so far many of the decisions seem to be fairly subtle or minor, spawning units or modifying yields, so I can probably start with simple things like that.

As an aside, is InitUnitFromCity a core lua function, or is it something you defined?
 
The code rather reminds me of the modified UI code I've been using to add new missions -- DoFunc is the meat of the function, doing whatever you need it to do.
Usually the CanFunc ends up being much longer in my experience; since it determines whether the decision is locked, enactable, enacted or not visible in the first place.

Either that or the Monitor functions, which basically trigger effects on certain events (city foundation, unit creation, etc.) after a Decision has been enacted.

As an aside, is InitUnitFromCity a core lua function, or is it something you defined?
Something I defined; it will give units the appropriate experience and promotions from the given city. For naval units, it will place them on the first valid tile with water; or failing that the city itself.
 
I really do like this and am looking forward to more developments; thanks for sharing some examples. Once it's been released, I think I'll use it in my mod, probably tying culture groups to the same options in some cases (e.g. British tribes, Greek civs etc). Excellent idea, very impressed.
 
My compliments, this is a very ambicius project, and a very brilliant idea! :eek: :bowdown:

I'll surely think about some decision, it's avery intersting feature.

However I see one possible flaw (at least, in my opinion):
You said that some decisions will be linked to specific civilizations (as in the examples you posted).
I always saw Civilization as a sort of "remake" of History, so civilizations should not have bonus or features by default, but earn them.

So, for example, Rome can be a little, harmless city state and Polynesia the biggest empire on earth.

Spain could not have a powerful fleet, or neither a port, and Vikings could be not the only ones to go plundering around the world.

Don't you think that the decisions should be linked to the civ playstyle, for example: policy adopted, tech discovered, land size, population, Religion, Building constructed, Happiness level, Gold per turn or in the Treasury, Diplomatic realtionships, Numbers of wars declared, conquered cities, number of religion followers, size of the army, number of DoF, position of cities, unit types present in the army and so on...

I know that not everybody share this idea, and you are doing already an huge (and I think, very difficult) work, so, in alternative, could you maybe consider to make civ specific decisions easy to generalize for a mod maker ?
 
I know that not everybody share this idea, and you are doing already an huge (and I think, very difficult) work, so, in alternative, could you maybe consider to make civ specific decisions easy to generalize for a mod maker ?

Looking at the code sukritact has provided, I think it is actually quite modular as it is. The CanFunc determines whether or not a decision is available -- for civ-specific decisions, there's an if-then function that checks to see what civ it is. If you wanted, you could easily make a bunch of generic decisions that were available to all civs, but only if they met certain conditions, such as "if the empire has more than 4 cities", "if the empire has only one city and is in the Renaissance", "if the empire has more than 10 military units", "if the empire is friends/allies with 6 city-states", or whatever. Ultimately it'll just come down to how familiar you are with Lua, it seems.
 
Yes, it is very easy to add your own decisions, if you know the basics of Lua. Belgium and Victoria already have support :D

Granted the civ specific decisions can suspend the alternate history tone of the game, Sukritact has indicated that any decisions can be quite easily disabled.
 
Wow, this is quite impressive. Great idea, I can imagine this'll add much fun to a game.

@Ulixes: I see your point, but in my opinion this is a natural extension of the unique attributes civs already have. Rome is predisposed towards having an expansive empire backed with military might, Polynesia is strongly attuned to water, Spain is naturally inclined to explore and settle other continents, and so on. The many playable nations in the game aren't meant to be equal in every situation.

As for ideas? Can't promise I have any good ones, but here are some loosely defined suggestions:

  • Babylon: Support the Astrologists (Astrology was a big thing in ancient Babylon. One could do many things with the concept, but perhaps something along the lines of Faith bonus per tech in the Astrology line researched?)
  • Japan: Enact the Sakoku Policy (The famous (infamous?) 200+ years of Japanese isolation could provide an interesting change if the player so wishes. It would have to have drawbacks, but perhaps do stuff like increase Culture in return. I'm not all that familiar with the era in question, though. Maybe also add a later decision to end the isolation (eg. "Sign the Kanagawa Treaty")?)
  • Mongolia: Ensure Freedom of Religion (Genghis Khan was known for promoting religious diversity within his empire. Maybe it could give Happiness bonuses for multiple religions within a city, which is a good thing for a war-focused civ.)
  • Mongolia: Institute the Yam System (The Yam was a system that ensured maximum efficiency for messengers via relay stations. Not sure about the effect, maybe bonus movement for civilian units within own territory?)
 
@bouncymischa, JFD: That's true, I will have to do more practice with lua, but seem friendly enough.

@Lord Xavius: You're right about this, that's why, in the mod I'm building, I disabled all unique traits, UU, UI and UB (I'm making them "earnable").

About Ideas for Decisions, those are the first that crossed my mind, maybe I will add others later:

Spoiler :
1) Accept Refugees or a Foreign small community
followers of a foreign (or completely new?) religion appear in one of your cities
reward: boost on Gold and/or Science and/or Culture and/or Production
cost: Unahppiness in that city

2) Female Equal Rights
requirement: Freedom Ideology
reward: Culture and Gold bonus
cost: How about a permanent penalty on Faith?

3) Legalize Soft Drugs
requirement: Freedom Ideology
reward: Gold and Happiness bonus
cost: How about a permanent penalty on Faith?

4) Expel religious minorities
requirement: Autocracy Ideology
reward: all religion are expelled except the major one
cost: diplomatic relationship penalty with civs with the majority of the expelled religions

5) Holy War (or Join Holy War): I really don't know how this could be implemented becaues too many conditions are needed and I don't know how AI should handle it, but something like this should be in the game

6) Assimilation: Accept "Barbarian" people
requirement: a barbarian camp nearby your borders
reward: you obtain two or more free units and 1 or more extra population in one of your cities, plus, the barbarian camp disappear
cost: temporary unhappiness in the city that receive extra population

7) Destroy heretical books
requirement: Having founded a religion
reward: boost on Faith
cost: penalty on Science and Culture
 
Granted the civ specific decisions can suspend the alternate history tone of the game, Sukritact has indicated that any decisions can be quite easily disabled.
Since Decisions are just a bunch of tables in the tDecisions table, removing a Decision really is as simple as "tDecisions.Decisions_OttomanDevshirme = nil", the whole table can be cleared with "tDecisions = {}".
 
Okay, the system for the AI to handle decisions has been updated.

You can supply the "Weight" entry of any decision with a number or a function.
If you supply a number, it will generate a number between 1 and 1000 (yes, 1000) and if the number generated is smaller than or equal to the weight, the decision is triggered. If the weight is 0, it will never be triggered.

If you provide a function, you can do whatever you want with it, but ultimately, returning true forces the AI to enact it, and false will have the AI ignore the opportunity.

Not defining the weight (ie, weight == nil) will have the AI enact it as soon as it's possible to do so.

Also, added a popup. It's relatively modular and I'll expand it slightly to support a Random Events system (It can be disabled on the user's end, don't worry, besides which I don't intend to actually add any random events just yet), but more importantly, you'll be able to trigger it with Decisions (or almost anything else, I made a LuaEvent to trigger it).

 
Ohh, this is getting really interesting and versatile now, me like! :D

Can't wait to see the whole thing in action!
 
How about something that changes the purpose of a particular building (if that's possible) - e.g. the monuments becoming tourist attractions (+1 tourism) but losing the culture element?

It's possible with a duplicate Monument that does that. Like I'd said though, I'll implement the system/framework, but I'll leave the actual events for later, or for someone else.
 
Top Bottom