Advertisement
Civilization Fanatics' Center  

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Colonization > Civ4Col - Creation & Customization > Civ4Col - Project & Mod Development > Religion and Revolution

Reply
 
Thread Tools
Old Apr 07, 2012, 01:28 PM   #21
orlanth
Storm God. Yarr!
 
orlanth's Avatar
 
Join Date: Nov 2001
Posts: 1,666
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
__________________
Colonization: 2071 - now with researchable Tech Tree! (as seen on Modcast) - version 2 design doc
Cyberpunk Leaderheads 2071 Scifi Buttons Pack
200 New Terrains for Civ4 Modding - Arctic, Barren, Fertile, and many more

Last edited by orlanth; Apr 07, 2012 at 01:33 PM.
orlanth is offline   Reply With Quote
Old Apr 07, 2012, 01:49 PM   #22
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
Quote:
Originally Posted by orlanth View Post
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.)

Quote:
Originally Posted by orlanth View Post
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 ...
( ... if the XML says 200.)
__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 07, 2012 at 02:15 PM.
raystuttgart is offline   Reply With Quote
Old Apr 07, 2012, 02:42 PM   #23
orlanth
Storm God. Yarr!
 
orlanth's Avatar
 
Join Date: Nov 2001
Posts: 1,666
Phew, I had to tweak a lot of things but finally got it working!
time for a lumber requisition party lol
__________________
Colonization: 2071 - now with researchable Tech Tree! (as seen on Modcast) - version 2 design doc
Cyberpunk Leaderheads 2071 Scifi Buttons Pack
200 New Terrains for Civ4 Modding - Arctic, Barren, Fertile, and many more

Last edited by orlanth; Apr 22, 2012 at 12:01 PM.
orlanth is offline   Reply With Quote
Old Apr 08, 2012, 12:33 AM   #24
Robert Surcouf
Civ4Col Modder
 
Robert Surcouf's Avatar
 
Join Date: Feb 2011
Location: France
Posts: 665
Congratulations!
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.)
__________________
Religion and Revolution
Robert Surcouf is offline   Reply With Quote
Old Apr 08, 2012, 12:54 AM   #25
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
Quote:
Originally Posted by orlanth View Post
Phew, I had to tweak a lot of things but finally got it working!
Fantastic.

I was just thinking a bit.
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.
__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 08, 2012 at 01:24 AM.
raystuttgart is offline   Reply With Quote
Old Apr 08, 2012, 10:25 PM   #26
orlanth
Storm God. Yarr!
 
orlanth's Avatar
 
Join Date: Nov 2001
Posts: 1,666
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>***
__________________
Colonization: 2071 - now with researchable Tech Tree! (as seen on Modcast) - version 2 design doc
Cyberpunk Leaderheads 2071 Scifi Buttons Pack
200 New Terrains for Civ4 Modding - Arctic, Barren, Fertile, and many more
orlanth is offline   Reply With Quote
Old Apr 09, 2012, 12:45 AM   #27
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
Quote:
Originally Posted by orlanth View Post
... 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.)
__________________
Religion and Revolution
(Retired Modder)
raystuttgart is offline   Reply With Quote
Old Apr 10, 2012, 11:12 AM   #28
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
@Orlanth:

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

Please get newest revision from SVN for your work.
__________________
Religion and Revolution
(Retired Modder)
raystuttgart is offline   Reply With Quote
Old Apr 13, 2012, 03:27 AM   #29
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
@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.

Edit:
I suggest you use isInRevolution() at the player object.
Code:
player = gc.getPlayer(kTriggeredData.ePlayer)
if player.isInRevolution():
		return false
__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 13, 2012 at 07:31 AM.
raystuttgart is offline   Reply With Quote
Old Apr 13, 2012, 06:08 AM   #30
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
@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
  • ...

__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 13, 2012 at 06:13 AM.
raystuttgart is offline   Reply With Quote
Old Apr 13, 2012, 04:14 PM   #31
orlanth
Storm God. Yarr!
 
orlanth's Avatar
 
Join Date: Nov 2001
Posts: 1,666
Quote:
@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!

Quote:
@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 Code:
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)): 
__________________
Colonization: 2071 - now with researchable Tech Tree! (as seen on Modcast) - version 2 design doc
Cyberpunk Leaderheads 2071 Scifi Buttons Pack
200 New Terrains for Civ4 Modding - Arctic, Barren, Fertile, and many more

Last edited by orlanth; Apr 13, 2012 at 05:14 PM.
orlanth is offline   Reply With Quote
Old Apr 14, 2012, 01:05 AM   #32
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
Quote:
Originally Posted by orlanth View Post
Ok, I've done so and uploaded it.
Thanks.

Quote:
Originally Posted by orlanth View Post
it said that was revision #200, let's celebrate the milestone with some Cigars and Rum!


Quote:
Originally Posted by orlanth View Post
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.

Quote:
Originally Posted by orlanth View Post
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.)
__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 14, 2012 at 01:42 AM.
raystuttgart is offline   Reply With Quote
Old Apr 14, 2012, 01:32 AM   #33
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
@orlanth:

I really like the way you solved this.

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
	return true
__________________
Religion and Revolution
(Retired Modder)
raystuttgart is offline   Reply With Quote
Old Apr 17, 2012, 11:43 AM   #34
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
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)
__________________
Religion and Revolution
(Retired Modder)

Last edited by raystuttgart; Apr 17, 2012 at 12:03 PM.
raystuttgart is offline   Reply With Quote
Old Apr 17, 2012, 04:07 PM   #35
Schmiddie
King
 
Schmiddie's Avatar
 
Join Date: Feb 2012
Location: Germany
Posts: 891
Yea, sounds very interesting!
__________________
Modder and Member of the Religion and Revolution Team
Schmiddie is offline   Reply With Quote
Old Apr 20, 2012, 03:07 PM   #36
Schmiddie
King
 
Schmiddie's Avatar
 
Join Date: Feb 2012
Location: Germany
Posts: 891
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.
__________________
Modder and Member of the Religion and Revolution Team
Schmiddie is offline   Reply With Quote
Old Apr 22, 2012, 11:37 AM   #37
orlanth
Storm God. Yarr!
 
orlanth's Avatar
 
Join Date: Nov 2001
Posts: 1,666
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 , 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.

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.
Attached Thumbnails
Click image for larger version

Name:	Civ4ScreenShot0000.JPG
Views:	37
Size:	144.2 KB
ID:	319576   Click image for larger version

Name:	Civ4ScreenShot0002.JPG
Views:	28
Size:	173.0 KB
ID:	319577  
__________________
Colonization: 2071 - now with researchable Tech Tree! (as seen on Modcast) - version 2 design doc
Cyberpunk Leaderheads 2071 Scifi Buttons Pack
200 New Terrains for Civ4 Modding - Arctic, Barren, Fertile, and many more

Last edited by orlanth; Apr 22, 2012 at 11:51 AM.
orlanth is offline   Reply With Quote
Old Apr 23, 2012, 01:50 AM   #38
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
Quote:
Originally Posted by orlanth View Post
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 , though some of them could still be possible.
Simply do whatever you like and are able to implement.

Quote:
Originally Posted by orlanth View Post
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.

Quote:
Originally Posted by orlanth View Post
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.

Quote:
Originally Posted by orlanth View Post
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.

Quote:
Originally Posted by orlanth View Post
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.
__________________
Religion and Revolution
(Retired Modder)
raystuttgart is offline   Reply With Quote
Old Apr 23, 2012, 05:20 AM   #39
Ronnar
Chieftain
 
Ronnar's Avatar
 
Join Date: Jan 2010
Posts: 57
Quote:
Originally Posted by orlanth View Post
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.
Ronnar is offline   Reply With Quote
Old Apr 23, 2012, 08:58 AM   #40
raystuttgart
Civ4Col Modder
 
raystuttgart's Avatar
 
Join Date: Jan 2011
Location: Stuttgart, Germany
Posts: 4,177
@Ronnar:

Good hint.
__________________
Religion and Revolution
(Retired Modder)
raystuttgart is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Colonization > Civ4Col - Creation & Customization > Civ4Col - Project & Mod Development > Religion and Revolution > [Religion and Revolution]: Events

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 05:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR