View Full Version : C++ Exception Error

Le Sage
Feb 19, 2010, 05:05 PM
We can as well put this question in here as well. I wrote about this on the main Creation and Customization forum, and I was quite steamed at the moment. I've cooled down now. This is what I wrote...

I am writing random events, but am having a hard time. It takes me several hours to add each and every one of them. There's always something wrong when I test them and I need to search for errors like 99% of the time. I've done three events.

I got the first two to work at least. And when adding the third (which will also be my last, because I'm losing my nerves with this), none of them work.

I test them in the Bug-panel-whatever-it's-called (opened with Shift/~). First I write p = gc.getPlayer(0). Nothing happens when I write p.trigger(event number, which in my case is 199), anymore. I get a "Runtime Error Unidentifiable C++ exception" message. It baffles me. The game runs fine and I get no XML errors either.

What does this mean? Any ideas?

Feb 19, 2010, 05:44 PM
You probably got the method for triggering the event from solver's tutorial ( It also gives a method for finding the event number. Are you sure your event number hasn't changed? Also, it points out that the other prerequisites (such as era) for the event must be satisfied. Is it possible you added some prerequisites which are not satisfied in your current test?

Le Sage
Feb 19, 2010, 05:57 PM
Yes, Davidlallen! Solver's tutorial is the absolutely best I've read so far on any aspect of Civ IV modding. It's an excellent work and although I, in my own stupidity, am having problems with random events, I can heartily recommend his tutorial.

I added nothing on the two first events, at least. They were working OK when I added that blasted third event. The prerequisites on all of the events are minor things like TECH_MYSTICISM, things like that, just to get them going at an early stage in the game, as soon as possible...

I'm going to cut out that third event and see how it works without it, and rewrite it from scratch if necessary. I'm going to try again.

Le Sage
Feb 19, 2010, 06:26 PM
I removed event number three and then it worked as it should. I then decided to add event number three again.

It does not work with the third one. All my events are out with the third one!

The only thing I did this time was copy event number one I've made and make it into event number three as well. I only changed the name of it. Number one is EVENTRRIGGER_WITCH, and three is EVENTTRIGGER_WEREWOLF.

Otherwise I kept both events exactly similar; prerequisites and rewards and the two options (The EVENT_WEREWOLF1 and 2)! I just copied the first one! Geez! I don't quite get it.