void BrokenLoop(object oSpawn) { int nLoopMax = 1; int nLoopCounter; // We first initialize a bunch of miscellaneous variables. // I copied these from my spawn function. But if I remove some or all of them, the TMI below no longer happens? Why?? int iCount; int jCount; // Initialize Spawn and Spawned object oCreature, oChild; int nSpawnChild, nSpawnCount, nCurrentChildren; int nEmptyChildSlots; string sChildSlot, sChild; int nSpawnBlock, nSpawnDespawn, nDespawning; string sSpawnName = GetLocalString(oSpawn, "f_Flags"); string sSpawnTag = GetLocalString(oSpawn, "f_Template"); location lSpawn = GetLocation(oSpawn); int nChildrenSpawned = GetLocalInt(oSpawn, "ChildrenSpawned"); int nProcessFrequency = 1; int nPCCount = 1; int nTimeNow = 1; int nWaypoint = 1; if (nProcessFrequency == 0) { nProcessFrequency = 1; } int nProcessesPerMinute = 60 / (nProcessFrequency * 6); // Initialize InitialState int nInitialState = GetLocalInt(oSpawn, "f_InitialState"); int nInitialDelay = GetLocalInt(oSpawn, "f_InitialDelay"); int nNextSpawnTime = GetLocalInt(oSpawn, "NextSpawnTime"); // Set Initial Delay if (nInitialDelay > 0) { if (GetLocalInt(oSpawn, "InitialDelaySet") == FALSE) { nNextSpawnTime = nTimeNow + nInitialDelay; SetLocalInt(oSpawn, "NextSpawnTime", nNextSpawnTime); SetLocalInt(oSpawn, "InitialDelaySet", TRUE); } } // Initialize SpawnDelay int nSpawnDelay = GetLocalInt(oSpawn, "f_SpawnDelay"); int nDelayRandom = GetLocalInt(oSpawn, "f_DelayRandom"); int nDelayMinimum = GetLocalInt(oSpawn, "f_DelayMinimum"); int nSpawnDelayPeriodic = GetLocalInt(oSpawn, "f_SpawnDelayPeriodic"); // Initialize SpawnNumber int nRndSpawnNumber; //int nSpawnNumber = GetLocalInt(oSpawn, "f_SpawnNumber"); int nSpawnNumberMax = GetLocalInt(oSpawn, "f_SpawnNumberMax"); int nSpawnNumberMin = GetLocalInt(oSpawn, "f_SpawnNumberMin"); int nSpawnAllAtOnce = GetLocalInt(oSpawn, "f_SpawnAllAtOnce"); int nSpawnNumberAtOnce = GetLocalInt(oSpawn, "f_SpawnNumberAtOnce"); int nSpawnNumberAtOnceMin = GetLocalInt(oSpawn, "f_SpawnNumberAtOnceMin"); // Initialize Day/Night Only int nDayOnly = GetLocalInt(oSpawn, "f_DayOnly"); int nDayOnlyDespawn = GetLocalInt(oSpawn, "f_DayOnlyDespawn"); int nNightOnly = GetLocalInt(oSpawn, "f_NightOnly"); int nNightOnlyDespawn = GetLocalInt(oSpawn, "f_NightOnlyDespawn"); // Initialize Day/Hour Spawns int nDay, nHour; int nSpawnDayStart = GetLocalInt(oSpawn, "f_SpawnDayStart"); int nSpawnDayEnd = GetLocalInt(oSpawn, "f_SpawnDayEnd"); int nSpawnHourStart = GetLocalInt(oSpawn, "f_SpawnHourStart"); int nSpawnHourEnd = GetLocalInt(oSpawn, "f_SpawnHourEnd"); // Initialize RandomWalk int nRandomWalk = GetLocalInt(oSpawn, "f_RandomWalk"); float fWanderRange = GetLocalFloat(oSpawn, "f_WanderRange"); // Initialize ReturnHome int nReturnHome = GetLocalInt(oSpawn, "f_ReturnHome"); float fReturnHomeRange = GetLocalFloat(oSpawn, "f_ReturnHomeRange"); // Initialize PCCheck int nPCCheck = GetLocalInt(oSpawn, "f_PCCheck"); int nPCCheckDelay = GetLocalInt(oSpawn, "f_PCCheckDelay"); int nPCReset = GetLocalInt(oSpawn, "f_PCReset"); // Initialize RandomGold int nGoldAmount; int nRandomGold = GetLocalInt(oSpawn, "f_RandomGold"); int nRandomGoldMin = GetLocalInt(oSpawn, "f_RandomGoldMin"); int nGoldChance = GetLocalInt(oSpawn, "f_GoldChance"); // Initialize Spawn Effects effect sSpawn, eDespawn; int nSpawnEffect = GetLocalInt(oSpawn, "f_SpawnEffect"); int nDespawnEffect = GetLocalInt(oSpawn, "f_DespawnEffect"); // Initialize Patrol Routes int nPatrolScriptRunning; int nPatrolRoute = GetLocalInt(oSpawn, "f_PatrolRoute"); int nRouteType = GetLocalInt(oSpawn, "f_RouteType"); // Initialize Placeables int nLootTime; int nRefreshTime; int nPlaceable = GetLocalInt(oSpawn, "f_Placeable"); int nPlaceableType = GetLocalInt(oSpawn, "f_PlaceableType"); int nTrapDisabled = GetLocalInt(oSpawn, "f_TrapDisabled"); int nPlaceableRefreshPeriod = GetLocalInt(oSpawn, "f_PlaceableRefreshPeriod"); int nTrap = GetLocalInt(oSpawn, "f_Trap"); // Initialize SpawnGroups int nSpawnGroup = GetLocalInt(oSpawn, "f_SpawnGroup"); // Initialize LootTable int nLootTable = GetLocalInt(oSpawn, "f_LootTable"); // End Misc Variable creation // Now we get to the actually broken part! nLoopCounter = 1; nLoopMax = 1; // This loop works! for (nLoopCounter = 1; nLoopCounter <= nLoopMax; ++nLoopCounter) { } // This loop gives a TMI error! But why?! for (nLoopCounter = 1; nLoopCounter <= nLoopMax; nLoopCounter++) { } } void main() { object oPC = OBJECT_SELF; BrokenLoop(oPC); }