Guide to event modding in BtS

Solver - I took your first 4 posts and put them into a doc in case anyone else wants a hardcopy.
 

Attachments

  • Events.doc
    185.5 KB · Views: 266
Thanks Woodelf... could have asked me for it, though, I had a doc all along ;) Your formatting is way better, though, will use the doc myself.
 
What does <iWeight> mean in the event system of BTS?
Which value will make event happen frequently, less or more? Is a 50 iWeight event appears more frequently than a 1000 one?
Does it mean the event trigger rate is 1/<iWeight> or something like this? I only know "-1" means it will happen immediatly...thanks.
 
These events and modding tutorials are worth the price of the BtS expansion, btw. Thanks.

What is the relationship between the XML\Events folders and the events.py files in the Assets\Python folder?

If I create a scenario and have my separate folder for it, can I have the standard package of events that occurs in the game, AND specific events?

Could I do that by simply putting the normal XML\Events folder in my mod, and adding the events I want? How does the python file interact with the XML?

And... is there a tutorial on creating events? This thread on what the files contain is wonderful, but I don't see the relationship of the files needed. Maybe I am making this more complicated than it is.... <g>
 
What if I want an event to be civ specific? For example, you have to be Greek for the event to trigger?
 
What does <iWeight> mean in the event system of BTS?
Which value will make event happen frequently, less or more? Is a 50 iWeight event appears more frequently than a 1000 one?
Does it mean the event trigger rate is 1/<iWeight> or something like this? I only know "-1" means it will happen immediatly...thanks.

-1 - will happen immediately. That is, as soon as the conditions are met and it's possible for the event to happen.
0 - the event is disabled and will not happen.
100 - normal probability
Above 100 - higher probability
1 - 99 - lower than normal probability
 
These events and modding tutorials are worth the price of the BtS expansion, btw. Thanks.

What is the relationship between the XML\Events folders and the events.py files in the Assets\Python folder?

If I create a scenario and have my separate folder for it, can I have the standard package of events that occurs in the game, AND specific events?

Could I do that by simply putting the normal XML\Events folder in my mod, and adding the events I want? How does the python file interact with the XML?

And... is there a tutorial on creating events? This thread on what the files contain is wonderful, but I don't see the relationship of the files needed. Maybe I am making this more complicated than it is.... <g>


The last part of the tutorial is about creating events. I also have an event mod out there that can serve as an example, you can see which files are included, among other stuff (I include the XML along with the core events). Here's the mod.

What if I want an event to be civ specific? For example, you have to be Greek for the event to trigger?

You could do that through a Python condition check.
 
Okay, I have some questions.

1. If I have a trigger in the Civ4EventsTriggers.xml file but do NOT have an event it lists in the Civ4EventsInfos.xml file, will I get an error? In game, or does it check this stuff out when it loads the mod?

2. If I have an event but not a trigger, do I get an error?

3. Can you just have xml events without any python files involved?

4. Can you specify a date or range of time in the xml without using python as a trigger? Say I have a WW1 scenario and want a certain event to happen in the year 1917, does that require python?

Thanks again for all this "events" education.
 
1. Yes, you'll get an error. If I recall correctly, the error message will appear after you start a new game, when the Dawn of Man normally appears.

2. I believe yes. It just won't happen.

3. Sure. The majority of events are like that.

4. That will require Python. Then again, if you want a WW1 scenario, I would write a separate Python event manager for it (like most similar mods do), and have the event manger trigger the required events through the trigger() function.
 
OBTW, I apologize if this has been mentioned before.

I was trying to get an event to give a tech. To pull off that stunt, I found that I could ONLY give a tech in the events.xml file if the all the prereqs for that tech had been achieved. In other words, you can't give a player a tech they currently cannot research due to prereq. I didn't test it but I assume that you could give a tech that has no prereq but is unbuildable.
 
I have a question.

I want to put the events in a mod, the RtW mod specifically. But the RtW mod has different techs and such. I have tried just plopping the XML folder in there, but it crashes the game at Mod loading.

Other than techs, what other tags could give troubles? Any suggestions on how to "easily" port events into a Mod like this?
 
I am trying to create an event in the RtW mod to simulate the Treaty of Versaille. One of the events is to reject the treaty, which should cause the attutudes of the Allies to sour toward Germany.

Is there any way to specify civs that get negative attitudes from an event just using XML? Is there any way to specify a civ for ANYTHING that happens in the XML files, either triggers or events?

Thanks.
 
Whoa! Slow down there with all those helpful responses! <g>

After a bit of thinking and reading, it appears that an event is possible between 2 specific civs just using XML. Correct me if my logic is wrong, please.

If I give each Civ I want to specify its own unique tech, I can require in the trigger the techs for each civ. For example, I give Germany a tech called "Tech_WW2_Germany" and France a tech called "Tech_WW2_France" and make them unbuildable and untradable and give them to their respective civs in the WBS. Then in the trigger, these techs will be prereqs for the firing of the event trigger. From there, give them negative attitudes in the event itself.

Does that make sense?

In an earlier post Solver you discussed <iWeight> and said that 100 - normal probability. What is "Normal"? I'd like to have an event triggered every dozen turns or so. What would the iWeight be for something like that?

And as for events, is there a maximum one event per turn for all players?


Thanks for any info you can provide.
 
What you describe with these "invisible" techs is possible.

However, using the event system for additions to RtW would suck. This is the random event system. It's not intended for events between specific civs, or events at specific time periods. Anything like that would be very ugly in it.

You'd be much better off looking at Dale's code and using RtW's (Python) event manager for events that you don't want to be entirely random.
 
Thanks Solver, I appreciate the feedback.

I can look over the python code and try to Frankenstein something, that is true, and I have considered that.

You have been extremely helpful, and the info you share is invaluable. But as you point out, the "most moddable Civ Ever" is pretty limited unless one goes out and learns Python. I guess that's the bottom line.
 
Solver I'm currently working on a package of events that are all directly linked to simulating Representation when you use the Representation civic. However after testing my event using, p.trigger(num) I can get the event to trigger whether or not I'm using represetation. Which doesn't make sense as I have the proper code in eventtrigger.xml:
Code:
<Civic>CIVIC_REPRESENTATION</Civic>

have I done something wrong...and please don't tell me I need to use python as that is far beyond my abilities.

thanx

Dan
 
Top Bottom