Improved Python Event System (Quests for Europe Trade) [IMPLEMENTED]

Hello guys,

I’ve implemented some EuropeanTradeQuest events. In the first step only for raw goods.
Look at the screenshots …

To start an quest you've to sell an certain amount to europe.
Spoiler European Trade Quest Start :

upload_2020-12-5_12-33-58.png


For typical european raw materials (lumber, ore, ...) you've only 2 choices as reward.
Spoiler European Trade Quest Rewards :

upload_2020-12-5_12-34-42.png

upload_2020-12-5_12-34-58.png
upload_2020-12-5_12-35-10.png



For typical american raw materieals like sugar, tabacco, pepper, ... you've 3 choices,

Spoiler European Trade Quest Rewards :

upload_2020-12-5_12-36-58.png
upload_2020-12-5_12-37-8.png



and for furs and premium furs even 4 choices.
Spoiler European Trade Quest Rewards :

upload_2020-12-5_12-37-23.png

upload_2020-12-5_12-37-32.png
upload_2020-12-5_12-37-41.png

 

Attachments

  • upload_2020-12-5_12-33-0.png
    upload_2020-12-5_12-33-0.png
    4.8 MB · Views: 50
Last edited:
No, that is why I had enhanced the Python Event System. :)

All necessary changes in DLL have already been made - they were minor though.
(Basically just making a few functions accessible to Python.)

Thus it is possible to add further of these Trade Events without any further DLL changes being necessary.
You just need to call the new Python Functions I had already added and use the Generic Parameters in XML.

I had prepared a blueprint here to create the XML configuration for these specific new events.
But with all the events @Raubwuerger has created we have a massive amount of examples now.

Summary:
It is completely possible to use this now without being able to program. :thumbsup:
To understand how it works it might be good to read the Python functions I had implemented though.
 
Last edited:
@Raubwuerger

I merged your new Trade Events into "Large Rivers". :thumbsup:
I also tested of course.

Although I tested only a couple of them - just to make sure I merged correctly - they were simply too many to test them all ...
But since they all use the same "pattern" - I am pretty confident the rest works as well.

You really have put a lot of effort into this. :wow:
The amount of events and event options is amazing !!! :woohoo:
 
Hello everybody,

the last day’s I’ve revised and expanded the EuropeanTradeEvents.
1.) The second row of goods (processed products, gold, ...) now also have events.
2.) Goods which are more bought than sold now have another option, namely a specialist and a reduction in price. This applies to horses, tools, blades, muskets, cannons and also sheeps and cattles. I found it kind of stupid when I have to buy a lot of horses, tools or weapons and then get punished by a price increase.

Current problems:
- A quest for trading food is started even though no food was traded.
- A quest for the trade in luxury goods is not possible. (YIELD_LUXURY_GOODS. I used 51 as the ID because it is in AutoXmlEnum.h)
- Sometimes quests are started but cannot be finished. Neither with by me nor by the AI.

I have done countless tests to find out what the problem is, but unfortunately without success.

Processed files: Release-Candidate_2_8
CvRandomEventInterface.py, CIV4EventInfos.xml, CIV4EventTriggerInfos.xml, CIV4GameText_Colonization_Events_utf8.xml.

Unfortunately I still don't have access to the git repository so i have to attach the files ...
 

Attachments

@Raubwuerger
Thanks, I can merge this with the current version in "Large Rivers" if there is a problem with your git access. :thumbsup:
(Probably by tomorrow.)

I still don't have access to the git repository ...
I thought that had already happened months ago ... :confused: (at least for dev branch "Large Rivers" you should have gotten access.)
Please contact @Nightinggale and myself in the team chat in so we make sure you finally get access to git repository.
 
- A quest for the trade in luxury goods is not possible. (YIELD_LUXURY_GOODS. I used 51 as the ID because it is in AutoXmlEnum.h)
That's odd. Checks code.
PHP:
.value("YIELD_LUXURY_GOODS", YIELD_LUXURY_GOODS)
YieldTypes.YIELD_LUXURY_GOODS should work. It's generally a bad idea to write the number as the enum might change, which then breaks your code. This is particularly true for files with auto in them as they are autogenerated while compiling.

Unfortunately I still don't have access to the git repository so i have to attach the files ...
Ok, time to investigate because it looks like I did my part in adding you.
 
Unfortunately the YIELD_LUXURY_GOODS-ID (and all the other ids) must be put in the an XML-File, not in an .php file.
Everything in AutoXmlEnum.h is autogenerated based on xml files. YieldTypes lists the Types from CIV4YieldInfos.xml. Part of the reason why the header file exist is that if it is pure xml, then the debugger will report an instance of YieldTypes to be 51. With that file, it reports it as YIELD_LUXURY_GOODS(51). Maybe not a huge issue with yields because they are hardcoded even in vanilla, but it does so with units, professions and so on as well.

I don't get why you would need to type 51 as YieldTypes.YIELD_LUXURY_GOODS should work. It is declared in the python interface.

Alternatively you can use
PHP:
gc.getInfoTypeForString("YIELD_LUXURY_GOODS")
This bypasses the enum python interface and will look up the int from the xml data.
 
@Raubwuerger

Sorry, but I am not going to merge anything from your files.
(And thus I am also not going to try to test and potentially fix anything.)

Working on outdated versions of the files is just wasting my time.
Just tried to do a diff with the current version and Notepad++ was almost blown apart.

Really do not understand why not the most updated version in "Large Rivers" (considering Events) was used. :dunno:
And instead the outdated version of "Big Merge" (considering Events) was chosen as a base.

Because of chosing outdated file versions as a base:
  • All the new Events of e.g. @Schmiddie are not contained.
  • Several of the corrections I had made in other events are not contained.
  • Improvements considering text and translations made by @Kendon or @Fürstbischof are not contained.
If I simply merge this now to "Big Merge" this might later cause issues when we merge the 2 branches "Big Merge" and "Large Rivers".
We really do not need to accidently break all the good work in "Large Rivers" that way ...

For the future:
  • Things that get started in "Large Rivers" get finished in "Large Rivers".
  • Things that get started in "Big Merge" get finished in "Big Merge".
The mess with the 2 development branches has to end here and now !
Let us please work clean and disciplined again.

Golden Rule of Modding:
Always continue work on the most current version of the files.

@Raubwuerger

Sorry, to react that way, because it is actually not really your fault.
Other more experienced modders like myself should have prevented such things.

If you want to make a clean and proper version using the updated current version of "Large Rivers", I will of course check and merge them. :thumbsup:

I fully understand that all you wanted was to finally get your events published. :)
But yesterday we committed that we will try to finally get all the great work in both branches finished, merged an published.

It would be great if you would help us with that. :hug:
 
Last edited:
Hm, I had an event to bring 500 goods into the new world - but I already reached the goal after the second run - and per run you can only bring 100 into the new world (and yes, I play on normal speed so that I really only loaded 100).
 
Hm, I had an event to bring 500 goods into the new world

Please please be more specific and tell at least e.g. the exact "Yield".
Something like "an event" is not sufficient to analyze ... :(

It is extremely easy to mess up the Start Trigger and End Trigger conditions of such Quests.
Without proper information, I will search myself to death.

Start Trigger could say you need 500.
But the End Tritter could still simply trigger at 100.
 
Back
Top Bottom