Guide to event modding in BtS

Thanks alot for this Solver. I havn't had any trouble MODing events, but now I know what everything does. Man your name fits you perfectly, you help us solve stuff. :D
 
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.

Well, that's a valid point. You see, XML only allows you to store data, essentially. It's not a programming or scripting language; it's a data storage format. So you can't do any of the really cool stuff with XML - although on the other hand, Firaxians have exposed lots of data to XML. The event system, however, is less refined as it's only from an expansion, so the event XML structure is missing a few elements that it should, I think, have.

But yep, you need Python if you want to do any really interesting stuff. Then again, it is really simple - I may be rather biased, as I've had programming experience before Civ4, but Python really is as simple as programming goes.

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

I have not verified this with 100% reliability (read: in the SDK), but I believe that manually triggering an event is slightly different, and not taking the Civic requirement into account is one thing I've noticed.
 
"bOtherPlayerWar- can be either 0 or 1. If set to 1, then the trigger can activate when the affected player and the other player are at war. When set to 1, the trigger activates for player pairs at peace."

Solver, thanks for your guide. I assume one of the above sentences actually refers to value zero and the other to value one. Can you please clarify?

After setting up an event to trigger when I have a particular civic, it doesn't seem to matter what I set bOtherPlayerWar and other fields to - my trigger still operates when I'm in the correct civic.
 
I have not verified this with 100% reliability (read: in the SDK), but I believe that manually triggering an event is slightly different, and not taking the Civic requirement into account is one thing I've noticed.

Thanks for the quick reply Solver. I guess I'm wondering what would I have to do to ensure that my events will only trigger when the player is running representation. If Python is required to do this I'm willing to learn how to at least execute the functions I'm looking for. Please, if possible, be as specific as you can, for I'll be working with functions, that I, quite frankly won't understand. :lol:
 
"bOtherPlayerWar- can be either 0 or 1. If set to 1, then the trigger can activate when the affected player and the other player are at war. When set to 1, the trigger activates for player pairs at peace."

Solver, thanks for your guide. I assume one of the above sentences actually refers to value zero and the other to value one. Can you please clarify?

After setting up an event to trigger when I have a particular civic, it doesn't seem to matter what I set bOtherPlayerWar and other fields to - my trigger still operates when I'm in the correct civic.

Whoops yeah, of course. It's 1 for the first sentence and 0 for the second sentence.

Thanks for the quick reply Solver. I guess I'm wondering what would I have to do to ensure that my events will only trigger when the player is running representation. If Python is required to do this I'm willing to learn how to at least execute the functions I'm looking for. Please, if possible, be as specific as you can, for I'll be working with functions, that I, quite frankly won't understand. :lol:

It will only trigger in representation during the actual game - you'll only see it malfunction if you trigger the event manually during testing.
 
Solver, in an earlier post you responded to a question about having an event occur only for a particular civ or between 2 specific civs. You said:

You could do that through a Python condition check.

Could you show me an example of that, or point to an example in one of the scenarios or your Events Mod, please? I am still trying to work out that event where the human player is given choices, the results being better or worse relations with another specific civ.

Thanks.
 
I have a question about two tags in the Civ4EventInfos.xml file and how they work. The tutorial at the start of this thread is great, but I need a bit of clarification.

Regarding the AdditionalEvents and the EventTimes tags....

Does the additional event occur IMMEDIATELY after the event it is listed in? Regardless of the odds of it happening as listed in the <iEventChance>, if its going to happen, will it always happen immediately, on the same turn, as the event it is listed in?

Or, is there a percentage as listed in the <iEventChance> that it will occur every other turn in the future?

As for <EventTimes>, does that mean that if the event does NOT occur by the <iEventTime> number, it will always occur on that number?

I have an event I want to have a 50% chance of occurring at least 7 turns after the event that lists it. I don't want it to occur on the same turn, or on the next 6 turns, but any time after that is great. Is this possible?
 
this guide is outstanding. you give tons of info but you present it in a way that even somebody like me can understand it, that is all too rare. what i learned from you helped me figure out the cause of a bug with the Holy Mountain Quest. i was pretty sure i got it right, and then when ori agreed, well, that means even if i'm somehow wrong i'm a supergenius *giggle*.

thank you so much!
 
Is there an xml file that increases the frequency of all events without having to edit the weight of every eventtrigger?
 
Regarding <iWeight>, does that number have ANYTHING to do with the frequency of events in the game, or just the frequency of one event over another? I notice I can jump those iWeight numbers up to astronomical numbers and events still occur very rarely for anyone.

I guess I answered my own question, but could someone who knows the answer confirm this, and hopefully clarify what is required to get more events?

Thanks.
 
Solver stated in another thread:

There's a variable in GlobalAssets.xml - called something like EVENT_PROBABILITY_DIE_SIDES or along those lines. It's at 100. If you set it to a lower number, you'll get more events - though I wouldn't recommend anything less than 50.

Ahem.... so as for that question.... never mind...
 
Regarding the AdditionalEvents and the EventTimes tags....

Does the additional event occur IMMEDIATELY after the event it is listed in? Regardless of the odds of it happening as listed in the <iEventChance>, if its going to happen, will it always happen immediately, on the same turn, as the event it is listed in?

Or, is there a percentage as listed in the <iEventChance> that it will occur every other turn in the future?

As for <EventTimes>, does that mean that if the event does NOT occur by the <iEventTime> number, it will always occur on that number?

That's pretty much correct. AdditionalEvents is used to create events such a City Ruins, where you want to give a reward and a x% chance for another reward. EventTimes allows you, I believe, to say that an event should occur after X turns, though I've not actually used it.

I have an event I want to have a 50% chance of occurring at least 7 turns after the event that lists it. I don't want it to occur on the same turn, or on the next 6 turns, but any time after that is great. Is this possible?

Probably needs Python. You can use EventTimes to make it occur exactly 7 turns later, but not to limit it to "at least 7".
 
If I change the EVENT_PROBABILITY_DIE_SIDES number in the XML file, and load up a SAVED game, not a new game, will the change happen?
 
I just want to make sure I'm understanding this correctly. If I have a handful of new event ideas and I could build them using all components and tags currently existing in the BtS Expansion, could I code them completely in XML? Just adding them in an additional Events XML files will work?

I just don't want to go through the trouble of recompiling the SDK or learning Python and using it and all that if I can just code them in the XML.
 
That's right. Unfortunately, the XML system for events isn't that powerful so you'd need Python for more interesting effects / conditions, but yeah, if your ideas will work with XML only, then that's all you need.
 
All right, I haven't had a lot of time to figure out how this new system works in the code. I'm glad I can at least try some event modding without to much of an entry learning curve.

I guess I might have to learn some Python eventually for a couple ideas, though. :)
 
Don't be discouraged there. Python isn't very difficult, and its applications in events are even simpler. Most events that use Python require just a few lines of Python code.
 
Top Bottom