Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!texsun!texsun.central-relay.sun.com!convex!authorplaceholder From: sheppard@convex.UUCP Newsgroups: comp.sources.games.bugs Subject: Re: Another omega core dump bug Message-ID: <124100001@convex> Date: 25 Feb 88 16:14:00 GMT References: <2531@usceast.UUCP> Lines: 294 Nf-ID: #R:usceast.UUCP:-253100:convex:124100001:000:8840 Nf-From: convex.UUCP!sheppard Feb 25 10:14:00 1988 Here is a simple fix for the "I can't attack a monster on a level in a restored game" problem. The problem is that the monster gets created just fine, but no link is made between the dungeon location and the monster. This can happen in any game where you save a level that has monsters on it. For example, start up a new game, save it, and then go try to talk to one of the guardsmen at the jail. *** old_olev.c Thu Feb 25 09:51:06 1988 --- new_olev.c Thu Feb 25 09:51:01 1988 *************** *** 817,822 ml->m->status = read_int(fd); ml->m->x = read_int(fd); ml->m->y = read_int(fd); ml->m->click = read_int(fd); ml->m->attacked = read_int(fd); ml->m->talkf = read_int(fd); --- 817,823 ----- ml->m->status = read_int(fd); ml->m->x = read_int(fd); ml->m->y = read_int(fd); + Dungeon[level][ml->m->x][ml->m->y].creature = ml->m; ml->m->click = read_int(fd); ml->m->attacked = read_int(fd); ml->m->talkf = read_int(fd); The altars down on levels 34-whatever should indeed have the high priests of the appropriate deity (each one has a level) on them. The high priest should also be carrying the holy symbol of the deity. There are at least three problems here. One is that the NPC get created okay, but the name doesn't get initialized properly. Another problem is that the level for the NPC in the omega.hiscore file is listed as 0 - this translates to 0 hit points for the NPC. These two problems wind up giving you a "grievously injured (level two)", when it really should say "Tybalt" or some other NPC. The last problem is that even if this was all done okay, the holy symbol doesn't get created. The fixes that I have incorporated are to make the levels in omega.hiscore some arbitrarily large number - I think they are currently set to 10. You also need some new code. Here is an entire new version of make_hiscore_npc that should replace the one in omon.c: pmt make_hiscore_npc(npcid) int npcid; { pmt npc = (pmt)malloc(sizeof(montype)); pob ob; char *s2; int i, treasures, behavior, level, combatype, competence, talktype; treasures = 0; *npc = Monsters[ML0+4]; /* each of the high score npc's can be created here */ switch (npcid) { case 0: s2 = Hiscorer; level = Hilevel; behavior = Hibehavior; break; case 1: s2 = Priest[ODIN]; level = Priestlevel[ODIN]; behavior = Priestbehavior[ODIN]; treasures = 14; break; case 2: s2 = Priest[SET]; level = Priestlevel[SET]; behavior = Priestbehavior[SET]; treasures = 17; break; case 3: s2 = Priest[ATHENA]; level = Priestlevel[ATHENA]; behavior = Priestbehavior[ATHENA]; treasures = 16; break; case 4: s2 = Priest[HECATE]; level = Priestlevel[HECATE]; behavior = Priestbehavior[HECATE]; treasures = 15; break; case 5: s2 = Priest[DRUID]; level = Priestlevel[DRUID]; behavior = Priestbehavior[DRUID]; treasures = 18; break; case 6: s2 = Priest[DESTINY]; level = Priestlevel[DESTINY]; behavior = Priestbehavior[DESTINY]; treasures = 19; break; case 7: s2 = Shadowlord; level = Shadowlordlevel; behavior = Shadowlordbehavior; break; case 8: s2 = Commandant; level = Commandantlevel; behavior = Commandantbehavior; break; case 9: s2 = Archmage; level = Archmagelevel; behavior = Archmagebehavior; break; case 10: s2 = Prime; level = Primelevel; behavior = Primebehavior; break; case 11: s2 = Champion; level = Championlevel; behavior = Championbehavior; break; case 12: s2 = Prime; level = Primelevel; behavior = Primebehavior; break; case 13: s2 = Duke; level = Dukelevel; behavior = Dukebehavior; break; } if (level < 1) level = 1; strcpy(npc->monstring, s2); npc->hp = level*20; npc->status = AWAKE+MOBILE+WANDERING; combatype = ((int) ((behavior % 100) / 10)); competence = ((int) ((behavior % 1000) / 100)); talktype = ((int) (behavior / 1000)); npc->level = competence; if (npc->level < 2*Dlevel) npc->status += HOSTILE; npc->xpv = npc->level*20; if (npcid == 0) npc->xpv *= 10; /* high scorer worth more xpv */ switch (combatype) { case 1: /* melee */ npc->meleef = M_MELEE_NORMAL; npc->actions = competence; if (competence < 3) npc->tactics = MM_POOR; else if (competence < 6) npc->tactics = MM_AVERAGE; else npc->tactics = MM_GOOD; npc->dmg = competence*5; npc->hit = competence*3; break; case 2: /*missile*/ npc->meleef = M_MELEE_NORMAL; npc->actions = max(2,(2 * competence / 3)); if (competence < 5) npc->tactics = MM_POOR; else if (competence < 8) npc->tactics = MM_AVERAGE; else npc->tactics = MM_GOOD; npc->strikef = M_STRIKE_MISSILE; npc->dmg = competence*3; npc->hit = competence*2; break; case 3: /* spellcasting */ npc->meleef = M_MELEE_NORMAL; npc->actions = max(2,(competence / 3)); npc->tactics = MM_POOR+MM_TIMID; npc->dmg = competence; npc->hit = competence; npc->specialf = M_SP_SPELL; break; case 4: /* thievery */ npc->meleef = M_MELEE_NORMAL; npc->actions = max(2,(2 * competence / 3)); if (competence < 5) npc->tactics = MM_POOR; else if (competence < 8) npc->tactics = MM_AVERAGE; else npc->tactics = MM_GOOD; npc->tactics += MM_TIMID; npc->dmg = competence; npc->hit = competence; npc->specialf=M_SP_THIEF; break; case 5: /* flee */ npc->actions = max(2,(competence / 3)); npc->tactics = MM_TIMID+MM_AVERAGE; npc->meleef = M_MELEE_NORMAL; npc->specialf = M_MOVE_SCAREDY; break; } switch (talktype) { case 1: npc->talkf = M_TALK_EVIL; break; case 2: npc->talkf = M_TALK_MAN; break; case 3: npc->talkf = M_TALK_HINT; break; case 4: npc->talkf = M_TALK_BEG; break; case 5: npc->talkf = M_TALK_SILENT; break; default: mprint("Say Whutt? (npc talk weirdness)"); break; } if (treasures != 0) { ob = (pob)malloc(sizeof(objtype)); make_artifact(ob, treasures); m_pickup(npc, ob); } npc->uniqueness = UNIQUE_MADE; return(npc); } Now this fix for make_hiscore_npc causes another problem in that hiscore NPC's are not saved/restored properly. An easy way to get the holy symbol is to get down to an appropriate level, save/restore the game, and what you get is some wimp NPC carrying the holy symbol. I've got a fix for that, but it's somewhat more complex. There are a lot more bugs that I've found that I have fixes for. I did send a list of them to Laurence, who tells me that fixes for them (and others) will be out shortly in the next version of Omega. Here's the a partial list of the bugs that I've found: a. The level that you join a guild on is not saved when you save a game. b. The pawn shop item list is not saved. c. Unique monster/item flags are not saved. d. Monsters are not restored properly. They show up on the screen, but they don't really exist until they move - you can walk right through them. e. Monster corpses are not restored properly. They appear to be empty items in your pack. You can get any corpse converted for 10 gp because of this. f. The "jailed" status is not saved. g. If you are the wizard, terminating shadowform (^f) asks if you want to toggle wizard mode. h. Casting shadowform on level 39 says that some force blocks the spell, but it works anyway. i. The Thieve's Guild won't accept Morgon's badge. j. Bringing the heart of the Eater Of Magic back to the Collegium causes a coredump. k. Bringing the crown of the Lawbringer back to the Circle causes a coredump. l. Purchasing a non-existant item in the pawn shop causes a coredump. m. Leaving money in a condo causes a coredump. n. You sometimes stay in tac mode even after the monster is dead. o. If your omega.log and omega.lognum files don't accurately reflect each other, omega will hang when trying to create an NPC for a new level. p. An item given to a monster doesn't get removed from your pack, even though it is actually given to the monster. q. Hi-score NPC names don't get set properly. r. Hi-score NPC's don't get saved properly. s. There are lots of little formating problems that aren't worth mentioning here. t. Holy symbols don't appear to ever get made. The high priests (Drogo Mooncalf, Captain Krunch, etc) should probably have them in their possession. u. An item sold to the pawn shop causes the first item in the pawn shop list to get blown away to make room for the new item, even if empty slots exist in the list. Hope this helps. ------------------------------------------------------------------------ Andy Sheppard Convex Computer Corporation {ihnp4,mcnc,sun,uiucdcs}!convex!sheppard