[Religion and Revolution]: Events

Ok, I will try changing that. But I wouldn't think it would make a big difference whether it can trigger at more than 200 or 201 goods?

edit: aah, I think the problem may be in the PickCity trigger value.. I will change that too and test further :)
 
Ok, I will try changing that.

Great. :)
I think I should also take the time to check all the events from TAC again.
(Not all of them were made by experienced programmers.)

But I wouldn't think it would make a big difference whether it can trigger at more than 200 or 201 goods?

It is a difference to my opinion if something is valid with 200 or more goods or 201 or more goods.
(Especially in the logic where you actually apply an option.)

201 or more goods will only confuse players and testers ... :dunno:
( ... if the XML says 200.)
 
Congratulations! :goodjob:
I'm looking forward to see it!
However, I was wondering... Is there any warning before we get this message?
And most important, I wonder if the +1 lumber price is a positive effect... Usually I buy lumber in Europe (and rarely sell it)!
(I'm just asking.)
 
Phew, I had to tweak a lot of things but finally got it working!

Fantastic. :goodjob:

I was just thinking a bit. :think:
Would it be possible to have events / quests like that with other Europeans or other Kings, too ?
(Something like trade arrangements, where you get a lot of money if you fulfill it ...)

Imagine something like that:

  • You are playing Holland and you have Coats in one of your cities.
  • Prices of Coats in London (Europe England) are 2 gold higher than in Amsterdam (Europe Holland).
  • England (AI) will offer you to buy 100 Coats at price 1 gold higher than you would get in Amsterdam. (Quest similar to your last one.)
  • When fulfilling gold is tranferred and goods are transferred from your city to an English city.
 
Hmm thats an interesting idea Ray. That seems like a quite complex event, but I think something similar to that should technically be possible. For example after adding our Domestic Economy feature where each city has a set of prices, maybe you could use the following trigger, then add a python function that checks if the foreign city has higher prices.

<bPickPlayer>1</bPickPlayer>
<bOtherPlayerWar>0</bOtherPlayerWar>
<bOtherPlayerAI>1</bOtherPlayerAI>
<bOtherPlayerNative>0</bOtherPlayerNative>
<bOtherPlayerPlayable>1</bOtherPlayerPlayable>
<iOtherPlayerShareBorders>1</iOtherPlayerShareBorders>
<bPickCity>1</bPickCity>
<bPickOtherPlayerCity>1</bPickOtherPlayerCity>
<PythonCanDoCity>***
 
... then add a python function that checks if the foreign city has higher prices.

Why don't you simply check the prices in Europe ?
(That should be pretty easy.)
 
@Orlanth:

I have made some minor changes to CvRandomEventInterface.py
(Our "200 vs. 201" discussion.)

Please get newest revision from SVN for your work. :thumbsup:
 
@orlanth:

I would like to ask you for something. :)

There are several events that have interaction with your king.
Could you please ensure in the logic in Python, that these events will not occur, if the player is in Revolution ?

Thanks in advance. :thumbsup:

Edit:
I suggest you use isInRevolution() at the player object.
Code:
player = gc.getPlayer(kTriggeredData.ePlayer)
if player.isInRevolution():
		return false
 
@orlanth:

How about having some events, that will explicitely happen during Revolution ?

  • King starting propaganda in a city
  • Loyalists fleeing the cities
  • Citizens afraid because of the War
  • Merchants angry because of closed trade routes
  • Smugglers offering to sell weapons
  • Ship Commander / General offering to switch sides
  • ...

:think:
 
@orlanth:

I would like to ask you for something.

There are several events that have interaction with your king.
Could you please ensure in the logic in Python, that these events will not occur, if the player is in Revolution ?

Thanks in advance.
Ok, I've done so and uploaded it.
it said that was revision #200, let's celebrate the milestone with some Cigars and Rum! :smoke::beer:

@orlanth:

How about having some events, that will explicitely happen during Revolution ?
Yes that sounds good. Though it might be best to have the Satisfaction system done first for some of those.

I think a nice one would be: if you're on good terms with a foreign King, he will sometimes offer you weapons or a unit of European Regulars to support your revolution.

I'm not quite sure how to make the trigger select a foreign king with good attitude toward you. I made a first attempt below but still need to check the attitude, might you know how to do that? Or if you instead want to make that one a DLL event that would be great too. (BTW, is there some way to call a python function to make a diplo popup window appear during some of the existing Events? Or is that possible in DLL only?)

PHP:
def canTriggerForeignAid(argsList):
	kTriggeredData = argsList[0]
	player = gc.getPlayer(kTriggeredData.ePlayer)
	king = gc.getPlayer(player.getParent())
	player2 = gc.getPlayer(kTriggeredData.eOtherPlayer)
	if (player.isInRevolution() and player2.isEurope() and (player2 is not king)):
 
Ok, I've done so and uploaded it.

Thanks. :goodjob:

it said that was revision #200, let's celebrate the milestone with some Cigars and Rum! :smoke::beer:

:)

Or if you instead want to make that one a DLL event that would be great too.

Yes, that is (similar to) one of the DLL-Diplo-Events, I wanted to have with foreign Kings.

BTW, is there some way to call a python function to make a diplo popup window appear during some of the existing Events? Or is that possible in DLL only?

It is (currently) not possible.
(You could also not capture the player response action. This is all DLL.
Efforts to make Diplo-Dialogs like that available and work in python would be enormous.)
 
@orlanth:

I really like the way you solved this. :goodjob:

I only made a small correction to your code.
(Line in red was missing.)

Code:
def canDoNotInRevolution(argsList):
	pTriggeredData = argsList[0]
	player = gc.getPlayer(pTriggeredData.ePlayer)
	if player.isInRevolution():
		return false
	[COLOR="Red"]return true[/COLOR]
 
Some more suggestions for events :)

1. Careless young citizen

Condition:
>50 Horses in city
(Event is unique.)

A carelessly young citizen accidently left open doors to the stable.
Thus many horses ran away into the wild.

Options:
A) Pay some experienced ranchers to catch them again. (-100 Gold)
B) Let the young citizen work until he repaid the damage. (-50 Horses, +1 Indentured Servant)

2. Deserter from another European Nation caught

Condition:
4 cities and contact to another nation exists.

A deserter from Nation X has been caught while trying to steal some food from one of our farms.

Options:
A) Give this pure man something to eat and a chance to prove himself in our society. (+1 Criminal, -2 relationship to other nation)
B) We must return this criminal to his mother country. (+1 relationship to other nation)

3. Protectionism

Condition:
Market exists in a city.
(Event is unique.)

The traders of your cities are asking you to close the market for foreign goods, to ensure their profits.
They are willing to pay for this favour.

A) Yes of course, we must think about our economy. (-2 relationship to every European player. +100 gold for each city the player has.)
B) No, we cannot do this, good relations to our neighbours are too important.

4. Diplomatic Conference

Condition:
At least 4 other Europeans met. Peace with all of them.
(Event is unique.)

Mylord, there are strong tensions between the European colonies.
Maybe we could act as mediators by having a diplomatic conference in our capitol.
If we do not act, these tensions will probably increase.

A) Tensions, between the other European Nations, that is perfect ! (relations between all European nations -1)
B) We should try to do everything for peace. (-100 gold, relations between all European nations +1, relations of all European nations to player additional +1)

5. Famine in the Mother Country

Condition:
Random.
(Event is unique.)

After a very hard winter the last harvest in the mother country was extremely bad.
Thus there is famine in the mother country.

A) That is very sad, but we cannot do anything about that.
B) Donate food to our mother country. (-50% food in each city, +4 relationship to king.)
C) Sell all food, that we can currently spare. (-50% food in each city, 10 gold for each unit food sold.)

6. Social Unrest

Condition:
City > 10 citizens and >50 Food in Storage

Social imbalance has caused several citizens to storm the storages and trying to steal some Luxury Goods.

A) Let them blow off some steam, things will become normal after that again. (-50 Food)
B) We cannot allow this to happen. (Social Unrest)

7. Disease spreading at Natives

Condition:
Having contact to a Native Nation and being at peace with them.
City with food > 50.

It seems, as if some of last our Native visitors accidently got infected with a flue and now it is spreading in their village.

A) That is very bad, we will be more careful next time. (-1 relation to Native Civ)
B) We should help our neighbours. (-50 food from city, +1 relation to Native Civ)
 
I have one suggestion for one new Diplo-Event:

"The Hudson's Bay Company has vigorously protested against your behaviour regarding fur trading at your king. They opine that the Hudson's Bay Company is the only company which is privileged to rule the fur trading in the New World by our own king!

The Hudson's Bay Company demands compensation for their losses due to the engagement in fur trading of your colonies. Your king requests you to stop all fur trading in the New World!

Answer a: The Hudson's Bay Company shall go to hell! We will not retreat from fur trading in our colonies (relationship with the king -1, coat price + 2, fur price + 3 due to diversification of fur market)

Answer b: Of course your majesty! We will promptly stop all fur trading (relationship with the king +1)

Answer c: Far from it! Your majesty will loose a lot of taxes due to our cessation in fur trading. We should expand fur trading in our colonies (relationship with the king +1, the player gets one experienced fur trader)

=====

Requirements:

The event will trigger, if the player has more than 3 expert trapper in his colonies and 3 expert fur trader (and maybe more than 500 coats and furs in his storehouses).

What di you think? Is this possible?

Just a suggestion. Feel free to vary/modify.
 
In planning for Ray's yields updates, I have reconfigured the Requisition quest event python so it can be programmed to select any yield type, and added another example quest for Coats. So when more yields are added it will be possible to have a variety of quests demanding them. Also adjusted the Lumber quest per Robert's comments, and made the king give you some payment for the goods (though this gold doesn't seem to show up in the initial tooltip, it does get paid.)

I had tried to work on some of those other requests but not being a skilled programmer had quite a hard time and eventually gave up for now :blush:, though some of them could still be possible. It seems like the Events are not very flexible when it comes to complex relations or things not present in the XML, eg relations between multiple players, multiple different cities, checking how many units of something are sold, etc. Maybe events involving complicated circumstances are best done as DLL diploevents ; but something more straightforward like adding a new unit (Bishop etc) would be very possible to do with an Event.

I'd like to have some events check for total number of colonists of a certain type, like Schmiddie mentioned; but when trying this it seems like the triggers <UnitsRequired> and <inumunitsglobal> aren't working how I'd expect. I think maybe they just check what units are on the map and ignore any citizens inside colonies, which isn't very useful:rolleyes:.

Many of the TAC popups seem to be coded by a separate system they made for CIV4AchieveInfos.xml , this has good options for triggering when it will happen, but doesn't cause any actual Events so its not that useful for gameplay. Ray, do you think this part of the DLL could be modified a little so that when an AchieveInfos trigger is met, it will cause an actual Event or EventTrigger to occur? (ie add a TriggerEvent field to achieveinfos.xml, then execute that event trigger if the acheiveinfos criteria is met. If thats easy to do, I think it could make Events a little better for modding.
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    144.2 KB · Views: 75
  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    173 KB · Views: 71
I had tried to work on some of those other requests but not being a skilled programmer had quite a hard time and eventually gave up for now :blush:, though some of them could still be possible.

Simply do whatever you like and are able to implement. :)

It seems like the Events are not very flexible when it comes to complex relations or things not present in the XML, eg relations between multiple players, multiple different cities, checking how many units of something are sold, etc.

Yes, the Python/XML-Events are rather limited in functionality. :dunno:

Maybe events involving complicated circumstances are best done as DLL diploevents ...

DLL-Diplo-Events should be used on rather rare occasions.

They are definitely not meant for small unique events.
That is not what they are designed for.

They are really designed for randomly re-appearing small features.
They were never meant to replace Python/XML-Events.

Many of the TAC popups seem to be coded by a separate system they made for CIV4AchieveInfos.xml

Achievements are something totally different, than Events.
Please let us not mix these things. ;)

Ray, do you think this part of the DLL could be modified a little so that when an AchieveInfos trigger is met, it will cause an actual Event or EventTrigger to occur?

That is the wrong way to go.
Please let us not try to abuse Achievement-System for Events.

But maybe one day, I will find the time to further enhance the Python/XML-system. :dunno:
 
Many of the TAC popups seem to be coded by a separate system they made for CIV4AchieveInfos.xml , this has good options for triggering when it will happen, but doesn't cause any actual Events so its not that useful for gameplay. Ray, do you think this part of the DLL could be modified a little so that when an AchieveInfos trigger is met, it will cause an actual Event or EventTrigger to occur? (ie add a TriggerEvent field to achieveinfos.xml, then execute that event trigger if the acheiveinfos criteria is met. If thats easy to do, I think it could make Events a little better for modding.

Hi Orlanth. You do not need any DLL change if you want to trigger an event after you have gained an achievement. That can be done completely in Python, please see the TAC Pacific quest. For completion of the quest, it checks if the achievement pacific was gained.
You can use the same code to trigger a new event based on any of the other achievements.

It's just the other way round than what you were looking for: You have to check in the event system if an achievement has been gained and cannot add it as effect to an achievement.
 
Top Bottom