Hm, those features sound great Ronnar.. I'd be very interested to add some Events to my mod using this.
Those sound like some useful additions - would the code enabling those new tags be relatively easy to merge to an existing mod? I'd guess the PythonCanDo ones wouldn't require a DLL change at all.
If you want to use the generic XML parameters, they
do require a DLL change. If you are ok with putting the values in Python code, then it does not require a DLL change. But then each event needs it's own python code. Not a big issue, but not very flexible and hard to understand for someone else trying to edit your events.
I do not know how hard it is to merge it into your DLL, as I am only messing with python scripts and do not touch the DLL code. It should be documented in the DLL sources in the next release of our TAC mod (should be released within the next month).
The Python functions itself are very simple. The biggest part is reading the generic parameters e.g. for the father point type and amount.
Here is an example for giving father points of a certain type and adjusting it to the speed and difficulty of the game. Of course there is a second function creating the correct help text for the event mouse over.
One cool additional feature would be triggers that happen only if your relation with a given civ (especially with your parent "King" civ) was above or below a certain threshold. This could allow for punitive events if your relation with your King drops too low, and allow for Kings to issue quest events e.g. demanding delivery of a certain amount of goods, where your performance influences your relations with them - that kind of thing would be perfect for Kailric's proposed Medieval mod. Could things like that be possible using a python event trigger?
That would be quite easy. Pick the king of the player that triggered the event and check the attitude. Put both into the <PythonCanDo> part of the event trigger XML.
Example code, which triggers an event if the king's attitude towards the chosen player is 0 (ATTITUDE_FURIOUS).
I have not tested this code, but this or something similar should work.
Delivering goods is something I did for an event, but I have chosen an easy way: As soon as a city has at least the requested amount in stock, the event pops-up and asks if you want to give the goods to the king in exchange for e.g. a Europe price increase for this good or a tax decrease. You would add such a check to the PythonCanDo of the Event, not the trigger.
Example: (replace
-event.getGenericParameter(1) with the amount of goods that the king requested). For a quest that should trigger 100% of the time, you would have to loop through all cities of the player instead of just checking the trigger city as I do in my example below.
BTW, is there something that prevents Events from firing for Native civs? I made an event for my mod to give Alien (Native) players a free Saucer unit (triggered by using a Civic that all native civs have), but it's not triggering in the game and I'm not sure why; I'll attach the code for it here.
Sorry, I did not have the time to check your code, but usually events can be triggered for natives. We had to exclude natives in our mod for some events because it didn't make sense for some of them to trigger for natives. Try your event with something simple like giving them 10 gold instead of a free flying saucer to see if the trigger works correct.