The Outcome System

I a back working on this stuff again.

Story Tellers (also Bards, Entertainers and Celebrities)
currently use the Great Artist mission Great Work which displays the amount of culture going to be added to the value in iGreatWorkCulture adjusted for game speed etc. It also reduces anarchy length.

I can convert it to an outcome that calls an event but would need to know the formula for converting to actual values based on game speed etc. If we reinstate the other entertainer units that means 4 events - no problems but the effect will be invisible to the player and the AI.​

Merchant Caravans and Treasure Chests
currently use the Great Engineer mission Hurry which limits the hurry to the current building being built shows the number of hammers based on game speed. The value is calculated from the two fields iBaseHurry and iHurryMultiplier.

Again I need the formula used to convert those two fields into the actual value based on game speed.​

So can anyone tell me the formula for adjusting cultural bomb and hurry production for game speed etc.?

Edit I need the formula for food as well - slaves, prisoners and food caravans.;)
 
Yes, for game speed its easy enough. I'll be working on these tags for you today I think.

I don't need new tags (Remember I can use the same tags for the caravans, story tellers etc as I am using in Subdue Animals.) or maybe just one bAdjustToGameSizeAndSpeed or something like it then I can use the existing tags and just say when I wanted them adjusted. For example I want the food and hemmers from kills to be static but the culture and science from study to be adjusted for game speed and map size.
 
I was talking about the tags we were discussing in pms. But the rest of what you want to do requires interaction with the Outcome Mission system which is beyond my realm of expertise.

Are you not wanting the tags we discussed any longer?
 
I was talking about the tags we were discussing in pms. But the rest of what you want to do requires interaction with the Outcome Mission system which is beyond my realm of expertise.

Are you not wanting the tags we discussed any longer?

Sorry, I have not had my coffee this morning and I've run out anyway so I am confused until the shops open. But no I don't need those tags, sorry.

I had an "Ah ha!" moment and realised that most of what I need can already be done using the Outcome system. However that system needs two new tags
- iReduceAnarchyLength and
- bScaleToGame​

The first reduces the anarchy in a city by up to the number provided. The second scales the outcome results to the Game Speed and map size etc.
 
You mentioned in the code for Story Teller that I should not kill the unit in the code but in the Mission. Except the kill happens on a random number and if it does not get killed it should either return to the Capital or nearest city (again a random number) with improved exp. I can do the random number bit with different outcomes but can I have a set of outcomes where only some kill the unit?

The entertainer units are the first ones where this is optional but the diplomats may also survive their missions and get better at doing missions. IE they are like spies.

I can't see an example in the missions XML which uses a "kill" tag. Which tag is it?
 
Sorry, I have not had my coffee this morning and I've run out anyway so I am confused until the shops open. But no I don't need those tags, sorry.

I had an "Ah ha!" moment and realised that most of what I need can already be done using the Outcome system. However that system needs two new tags
- iReduceAnarchyLength and
- bScaleToGame​

The first reduces the anarchy in a city by up to the number provided. The second scales the outcome results to the Game Speed and map size etc.

Did these tags go in and get used in the end, or did it wind up as just Python? (the tags are way better when it comes to writing AI, since without hem it has to guess what the Python might do)
 
You mentioned in the code for Story Teller that I should not kill the unit in the code but in the Mission. Except the kill happens on a random number and if it does not get killed it should either return to the Capital or nearest city (again a random number) with improved exp. I can do the random number bit with different outcomes but can I have a set of outcomes where only some kill the unit?

The entertainer units are the first ones where this is optional but the diplomats may also survive their missions and get better at doing missions. IE they are like spies.

I can't see an example in the missions XML which uses a "kill" tag. Which tag is it?
bKill defaults to true so the current outcome missions kill the unit except for the ones in the nomad demo.
I guess the bKill tag could be moved into the outcome instead of being part of the outcome mission price. But then it cannot default to true because of the animal kill outcomes so the current outcome missions would need to be checked and the tag set.

There is now an Adapt tag for the integer expressions which can be used to adapt to game speed, world size or difficulty.
 
I have added a tag to reduce anarchy duration to outcomes now. It is an integer expression tag so Adapt could be applied if desired.
 
Instead of moving the bKill tag I just added an additional bKill tag to the outcomes themselves now so with bKill set to false on the action the unit can be killed specifically in some outcomes with bKill there.
Check the story teller to see how it is done.
 
So what is the parameter passed to the python in
Code:
				<Action>
					<MissionType>MISSION_REMOVE_WV_SLAVERY</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_REMOVE_WV_SLAVERY</OutcomeType>
							<iChance>100</iChance>
							<PythonCallback>doRemoveWVSlavery</PythonCallback>
						</Outcome>
					</ActionOutcomes>
				</Action>
 
So what is the parameter passed to the python in
Code:
				<Action>
					<MissionType>MISSION_REMOVE_WV_SLAVERY</MissionType>
					<ActionOutcomes>
						<Outcome>
							<OutcomeType>OUTCOME_REMOVE_WV_SLAVERY</OutcomeType>
							<iChance>100</iChance>
							<PythonCallback>doRemoveWVSlavery</PythonCallback>
						</Outcome>
					</ActionOutcomes>
				</Action>
An argsList with 3 entries. Only the first matters for action outcomes, which is the unit itself. The other two are for kill outcomes, the owner of the killed unit and the unit type of the killed unit.
 
An argsList with 3 entries. Only the first matters for action outcomes, which is the unit itself. The other two are for kill outcomes, the owner of the killed unit and the unit type of the killed unit.

Ah, I thought 2 but I am getting a message saying it has only 1 parameter provided!
Code:
TypeError: doRemoveWVSlavery() takes exactly 2 arguments (1 given)
ERR: Python function doRemoveWVSlavery failed, module CvRandomEventInterface
 
Ah, I thought 2 but I am getting a message saying it has only 1 parameter provided!
Code:
TypeError: doRemoveWVSlavery() takes exactly 2 arguments (1 given)
ERR: Python function doRemoveWVSlavery failed, module CvRandomEventInterface
Pretty much all Python functions called from C++ take only one parameter, a list that contains the actual parameters (the argsList). Check all the many functions in CvRandomEventInterface.py as examples.
 
Outcome missions and kill outcomes can now be added to unit combat types.
Just add them to the unit combat infos the same way that you would add them to a unit.
They apply to all units that have the unit combat type either as main type or as sub combat type (and it does not matter if the combat type comes from the unit type definition or a promotion).

In the case of outcome missions if a unit has an outcome mission for the same mission type on the unit type and one or more of its combat types, then only the one on the unit type is active.

For kill outcomes the outcomes from the list on the unit type are merged with all those from unit combat types but only one instance of each outcome type is active.
 
Top Bottom