The 3rd Age

RC Mod

RC Mod

This Mod makes many changes to the original game, adds a whole new BFME 1 mode and much more.

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Optimizing Upgrade.ini to avoid crahes\bugs

Tutorial for Battle for Middle-earth BFME

Avatar of Lauri

Lauri

Category: Code
Level: Beginner
Created: Sunday November 7, 2010 - 7:30
Updated: Sunday November 7, 2010 - 8:44
Views: 5104
Summary: A tips guide to optimizing the usage of Upgrade.ini because it has a maximum number of upgrades

Rating

Staff says

4.0

Members say

4.4

Average

4.3/5.0

6 votes

Page 1 2
Known Crashes and bugs:
Okay, so let's go about the known upgrade.ini related crashes and bugs. Any upgrade that is 206 or higher will be read by the game, but it won't work. This can really get you puzzeled if you don't know about the limit, or don't know that you've crossed it. I'll take you through my own examples:

1. While trying to do some advance LUA coding I made two new upgrades. Now, suddenly when in-game, I can't summon Rhovanion Allies anymore. The summons starts, the fog comes in, but right when the unist are suppose to appear I get a game.dat crash. I didn't know why. I also found out that I, as Rhun, couldn't build RhunSpearmen anymore either! When suppose to come out of the barracks, the game crashes. Again, no clue. I haven't done anything to the spearmen, but I had done some minor alterations to the Rhovanion Allies, so I thought that was it. Nothing I did fixed it, not even reverting it to the ones that worked. Then I went to the Known game.dat errors article, and read through it. Nothing there, except one thing. A upgrade maximum that GothmogtheOrc figured out oh so long ago. 190 max it said. I checked my upgrade.ini (search for Upgrade_ then Find All in Current Document if you want to auto-count) and voila, I had 217. I then saw that the two new upgrades I made for the LUA coding, "replaced" the spots previously used by Upgrade_DaleSpearmen and Upgrade_SpikedShield. I knew that DaleSpearmen were a crucial part of the Rhovanion Allies, and I wen to check if SpikedShield were in the Spearmen of Rhun. It was.
I then did some massive cleaning and got down to 189. Checked ingame, and voila both the Rhovanion Allies and Spearmen worked! I then wanted to see just how many upgrades would work in a mod, to see if it really was 190. By placing Upgrade_DaleSpearmen last, and make up random and fake upgrades before it, I had it first in spot 191. It worked ingame. Then 195, 200, 205, all worked. 210, I get the first crash (and confirmation that the fake upgrades I made didn't have to be related to anything). 207, crash. Then I knew that if it crashed on 206 it would mean that 205 is the max. It crashed, and that's how I found out that 205 is the maximum number of upgrades possible.
As GothmogtheOrc has figured out before me, any unit using an upgrade that is after the maximum limit, will crash when being buildt\summoned\spawned.

2. I made a power for Gondor in my mod, that granted Upgrade_KingdomOfGondor. The upgrade unlocked units from the Southern Fiefdom to Gondor, so I could create new units when I got that power. This worked perfect, until one day it suddenly didn't work anymore. I had no idea what I had done to make it stop working. I even redid the power from scratch, but it still didn't work. This was really annoying, because I was clueless. I didn't even think about crossing the maximum number in upgrade.ini. That is well over a year ago, and I still have the same power for Gondor because I haven't thought up a new power (although I did take a long modding break).
Why did this happen? Well, I've found out now. It went over the limit and didn't work anymore. This caused the upgrade to not function like it should, and the units that needed that upgrade to be buildt didn't need it anymore, because it "did exist but didn't work", so I could build them without the power. The good thing is, I've also found out about two other passive hero-bonus powers now work, even though I thought they always worked :p

Also, if you delete unused upgrades, make sure they really are unused. If any files are linked to the upgrade it needs to be in upgrade.ini, or there will be a crash on startup saying that there is no such upgrade. Luckily it will tell you just what upgrade that doesn't exist.

Links / Downloads

 HitsAdded
Known game.dat errors1560November 7, 2010 - 8:43
colourINI1376November 7, 2010 - 8:43

Credits

GothmogtheOrcFinding the first limit

Comments

Display order: Newest first

Gandalf17 - Monday December 13, 2010 - 21:54

well my campaign started having these weird crashes suddenly. The game kept crashing right when i win a campaign level. i read this article and realized i had gone over the upgrade limit so i tried deleting a few and now the campaign works perfectly. this article is very helpful, thanks

BigBrainiac - Wednesday November 17, 2010 - 17:10

Thanks, I actually based an experiencelevels.ini on this (like a #define GoAHeroes and GoAEliteHeroes)

This is a well written (and useful) tutorial on upgrades and deserves to be rated 5 stars.

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
2:38:14