Quick Modding Questions Thread

3715 BC is not a standard date, AFAIK -> did you change the calendar?

I don't think so (you did note I said Marathon/slowest speed, right?).
Got another saved game, with random events turned on, keeps glitching at 3610 BC.
At the end of the turn I get a CTD. (note: new random seed is not on)

When I turn off random events, it seems I don't get the crashes.

Very similar crash report, don't get these with random events off:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000240
Crashed Thread: 0
...
Thread 0 Crashed:
0 com.aspyr.civ4bts 0x001864d0 CvUnitInfo::getBuildings(int) const + 6
...
8 com.aspyr.civ4bts 0x00202c74 CvPlayer::setAutoMoves(bool) + 78
9 com.aspyr.civ4bts 0x000f4d43 CvGame::updateMoves() + 325
10 com.aspyr.civ4bts 0x00104415 CvGame::update() + 285
11 com.aspyr.civ4bts 0x00a763b1 CvApp::OnIdle() + 1137
12 com.aspyr.civ4bts 0x00653227 FWinApp::Run() + 31
13 com.aspyr.civ4bts 0x00b0e5ac WinMain + 50
14 com.aspyr.civ4bts 0x000a7f01 sEventLoopEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 111
15 com.apple.HIToolbox 0x94b6713d DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1181
16 com.apple.HIToolbox 0x94b6657b SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 405
17 com.apple.HIToolbox 0x94b663e0 SendEventToEventTargetWithOptions + 58
18 com.apple.HIToolbox 0x94b94d54 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 356
19 com.apple.HIToolbox 0x94b674f6 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2134
20 com.apple.HIToolbox 0x94b6657b SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 405
21 com.apple.HIToolbox 0x94b82ecc SendEventToEventTarget + 52
22 com.apple.HIToolbox 0x94befa6c ToolboxEventDispatcher + 86
23 com.apple.HIToolbox 0x94bec2c2 RunApplicationEventLoop + 222
24 com.aspyr.civ4bts 0x000a7fba InstallEventsAndRunGameLoop() + 166
25 com.aspyr.civ4bts 0x000a8352 main + 356
26 com.aspyr.civ4bts 0x000025d2 _start + 216
27 com.aspyr.civ4bts 0x000024f9 start + 41

When I play with random events turned off, I don't seem to get any crashes.

I'll note that I set most random events to 100% active, and I bumped up the weight of the Quests by a huge factor.
I also increased the event frequency in the early game.

Other than that, I don't think I changed anything regarding the events (maybe the # of turns before they start)

Would the game catch a missing "<" when loading (such as active weightpercent>100< vs percent100<), or is that a possible error source?

I'd really like the random events to work, such that when playing as the "Barbarian civ" (with no UU or UB, or leader traits, or starting techs), one can count on being given a quest which can upgrade Units/Buildings, making up for the lack of a UU/UB (maybe).

Any suggestions as to what might be the cause?
 
I don't think so (you did note I said Marathon/slowest speed, right?).

Oops, no, did not note this.

Would the game catch a missing "<" when loading (such as active weightpercent>100< vs percent100<), or is that a possible error source?

You should get an exception when you start a new game (but on Macs they are relatively useless, because they don't say where exactly in the file the problem is).


I don't have any idea at the problem itself :/.
 
Nope, no exception when I started the game, this last game, I got "the waters of life" event of something like that in an oasis in my capital BFC, and then a short time later, truffles in a nearby grassland/forest.
Then as buddhism will be founded next turn- crash (even crashes if I change research topics, but I suppose an AI could still found it, but I doubt its a religious event).
Oh well... guess I'll leave random events off.
Or maybe start over again editing the event files.

Hmm... also crashes without random events... I don't know why, some games i've played all the way to tanks, with no issues, others it crashes before 3000 bc (marathon speed, usually prior to 3,500 bc).

I have no idea what causes it.
 
arghhh.... cannot find the source of the problem....
I reloaded a previous iteration of the mod, one that I had a game going to 700 AD (that I stopped once it was very obvious I had won).

Played a few turns of that saved game, then started a new game, and within a dozen turns, that one crashed.

The problem is, after most changes, I just load up the mod, see if it even loads, look in the civilipedia, go to world builder and try it out, then proceed with the next change I want to make.

I have no idea what change caused it, but I know turning random events off, and removing the events folder, does not remove the crashing (randomness of the crashes at first fooled me in to thinking it was the cause).

Now I find Crash to desktops at different dates, normally before 3000 BC (last night had one around 2500 bc), but now I wonder if the ones where I made it to 700 ad are doomed as well.

Next step is to play with new random seed, and see if I can bypass a crash date by reloading.

I could also try removing one folder at a time, and playing to 2000 bc, to try and narrow it down....

I was really hoping others had experienced (and solved) a similar problem, and could give some insight.
 
Is there a relatively easy way to add text to the description of a Building or Tech other than in the Strategy/Pedia section? For instance, I have a building that when completed generates a Free Scientist using a non-Random event.
 
Try the Help tag.

I haven't use this with Techs, but it works for other things. It is used for a lot of buildings in FF/FF+ for things done via Python that the DLL doesn't really know about (yet), like changing the population limit of planets and their yields per population point.
 
Thanks, looks like it's only for Techs - without a MOD.

What determines the Bulb Order? I always thought it was based on the order of the techs in the techinfos.xml file but that doesn't seem to be the case.
 
What determines the Bulb Order? I always thought it was based on the order of the techs in the techinfos.xml file but that doesn't seem to be the case.

The flavor types and values.
Each tech has a few flavors, with a value for each.
Some units (specifically great people) have their own flavor types and values.

The sum of products for these types determine the total value of each tech bulb.
Here's the code from the SDK:

Code:
TechTypes getDiscoveryTech(UnitTypes eUnit, PlayerTypes ePlayer)
{
    TechTypes eBestTech = NO_TECH;
    int iBestValue = 0;

    for (int iI = 0; iI < GC.getNumTechInfos(); iI++)
    {
        if (GET_PLAYER(ePlayer).canResearch((TechTypes)iI))
        {
            int iValue = 0;

            for (int iJ = 0; iJ < GC.getNumFlavorTypes(); iJ++)
            {
                iValue += (GC.getTechInfo((TechTypes) iI).getFlavorValue(iJ) * GC.getUnitInfo(eUnit).getFlavorValue(iJ));
            }

            if (iValue > iBestValue)
            {
                iBestValue = iValue;
                eBestTech = ((TechTypes)iI);
            }
        }
    }

    return eBestTech;
}

Note that usually a unit's flavor value is 0, so in this case this flavor's value of the tech is ignored.
 
No, works also for buildings and units (after the strategy tag) and for traits.

So you're saying the schema supports it even though I see no help tags in the buildinginfos file - I thought xml was very picky about missing tags.
 
XMl is picky about missing elements only if it is told to be.

From CIV4BuildingsSchema.xml:
Code:
		<element type="Help" minOccurs="0"/>
Notice the "minOccurs=0". That lets you leave it out entirely. The default is 1, which is why the ones without this attribute are required.

In the schema the Help tag is after the Strategy tag and before the Advisor tag, so if you include a Help tag it has to be at that location.
 
XMl is picky about missing elements only if it is told to be.

From CIV4BuildingsSchema.xml:
Code:
		<element type="Help" minOccurs="0"/>
Notice the "minOccurs=0". That lets you leave it out entirely. The default is 1, which is why the ones without this attribute are required.

In the schema the Help tag is after the Strategy tag and before the Advisor tag, so if you include a Help tag it has to be at that location.

OK cool - I see it works!

Another question about XML text in Civ 4. Is there a macro I can use to display a bullet - so that my Help text lines up with the other bullet items? Also are all the macros available listed somewhere (i.e. [LINK], [TAB], etc...)
 
For a bullet you can use [ICON_BULLET]. Lining things up is up to you...

I don't know of any complete list of these things.

They can all be found in CvGameCoreDLL/CvDLLTranslator.cpp

- - -

On another note: is there a limit to the number of leaders in WBS?

I can have any number of civs in-game and in WBS as long as the number is defined in the DLL, but as soon as I add 33th LeaderType in the WBS, game crashes while loading WBS (no failed asserts).

Say, in WBS I've got this:

BeginPlayer
LeaderType=LEADER_L0
CivType=CIVILIZATION_C0
Team=0
EndPlayer

Multiply x 62 (DLL has 62 slots)... works fine if there's 32 leaders (i.e. civs 32+ use the same leader, though order and leader type doesn't matter), otherwise it crashes. Also, it crashes with WBS only, not random game. Looks like WB reader can only read 32 leadertypes, or I'm missing something :confused:
 
I love using pig Mod and i also play RoM:AND is there anyway i can combine the features from pig mod and also some of the ones from RoM (namely xUPT, Ranged Bombard, extra animals, Dynamic XP and promotions)

Its only for personal use ( a new daawn gives too much production, food and commerce bonuses to keep track of :P, but contains some of the best enhancements i have seen).

also i heard mention of a modcomponent that gives a food bonus to a city when an animal is killed that sounds nifty and if that could be incorperated too.

or am i just dreaming too much?
 
To combine all that stuff will get difficult.
In general, you only have to put all the files from both mods into one.
That's not the problem.
But there will be files which are present in both mods, and i think in PIG there are also .dll changes, and merging both .dlls will be...horrible.

Multiply x 62 (DLL has 62 slots)... works fine if there's 32 leaders (i.e. civs 32+ use the same leader, though order and leader type doesn't matter), otherwise it crashes. Also, it crashes with WBS only, not random game. Looks like WB reader can only read 32 leadertypes, or I'm missing something :confused:

Can't really be, the 50 civs mod is relatively popular, and there are maps for it.

Did you define the team too, and starting positions (if there are any)?
 
Can't really be, the 50 civs mod is relatively popular, and there are maps for it.

Did you define the team too, and starting positions (if there are any)?

Teams yes, starting locations no, but starting positions aren't needed, cities are pre-placed or the civ is inactive. That part works fine, really. I'm running a 35-civ mod fine (with 32 leaders), as well as this 62-civ mod as long as any 30 of those civs use same leaders as the other 32 :rolleyes: Really really weird. I know GEM uses 48 or so civs and has 48 leadertypes in WBS so it's obviously something wrong on my side, but there's nothing that makes sense... why 32? :mad:
 
So you want to set a new civ into an already populated map?
That's quite difficult, IIRC, and does not work very well.
Did you confirm that it works (or doesn't) with empty maps?


Oh, and in computer technology there are some reasons for 32 ;), but none of them apply here.
 
So you want to set a new civ into an already populated map?
That's quite difficult, IIRC, and does not work very well.

I did it many times actually, but it's not what I'm doing right now. I simply want to create a map for 60 civs, and I'm at the very first step.

It's a "blank" mod with no real changes, mostly a test run to see how many civs I can fit into a map before my CPU fries...
- made blank map + DLL with 60 slots (not 62 sorry)
- added 60 civs & leaders in XML
- added all civs to an empty map WBS with minimal settings (Team + Player w/ ID, CivType & LeaderType); all civs in WBS have same leader so far
- tested WBS (OK)
- updated leaders and started to fill them in WBS (Still OK)
- added more leadertypes (crash) - after trial and error it turns out it's number of unique leadertypes in WBS, in any order that causes MSVC++ Runtime Error when "select a civ" screen appears.

Did you confirm that it works (or doesn't) with empty maps?

With more than 33* leaders, it doesn't work with any WB maps, empty or populated. It works with random maps only. If I start a random game with 60 civs & leaders, then go to World Builder and save it as WBS, that WBS is unusable - I get the same runtime error.

Oh, and in computer technology there are some reasons for 32 ;), but none of them apply here.

I know, I'm a web developer ;) I just don't get it... for that matter it was a mistake (last added leader was for 32, that's 33th team) - so it's 33 leaders. Well, at least that theory can be thrown out of the window. Still, I can move the leaders around, so it's not any typo, just the max. number of unique leaders :mad:

Thanks for the help so far!
 
Back
Top Bottom