Eliminate Shrunk Enemies Attacking Bug

From EDukeWiki
Revision as of 18:11, 17 November 2006 by Fox (talk | contribs) (Wasn't that I was trying to say, well, my bad English anyway =/)
Jump to navigation Jump to search
A screenshot of the “Shrunk Enemies Attacking” bug.

You probably have seen this bug before.

If you shoot an shrunken enemy, and it activates the hitting animation, it will start processing the normal enemy code, but still remain small and not go back to the original size.

To fix that bug, you need to find the main ifhitweapon statement in the enemy code, which is in GAME.con by default. You will find that code many times, but probably all them will be already in the if condition from the main ifhitweapon or you have confused ifhitweapon with ifwasweapon.

All you have to do to fix this bug is add an ifai AI<enemyname><SHRUNK\SHRINK> break statement before the main ifhitweapon. Remember to search at the beginning of the enemy code for name of their shrunk artificial intellegence, as the Assault Trooper's (actor LIZTROOP) is AITROOPSHRUNK while the Pig Cop's (actor PIGCOP) is AIPIGSHRINK.

Sample:
In the Assault Trooper's (actor LIZTROOP) code, there will be the state state checktroophit where there are many ifhitweapon primitives, but they are all before ifhitweapon state checktroophit, so all them are already under that main tag.

Here is the actual code described above:

  ifhitweapon
    state checktroophit

Change it to this:

  ifai AITROOPSHRUNK
    break
  ifhitweapon
    state checktroophit

Do you remember what happens when you shoot an Assault Captain before he teleports? Only when he come back he will fall dead / explode on jibs / etc. With this code this is exactly what will happen with the shrunken enemy, only when he grow back he will hit the shoots taken when shrunken. That will too fix another way to the bug happens: At Damn I'm Good skill, Shoot with bullets weapons an shrunken enemy and kill him. If he respawn, will be an shrunken attacking enemy.

It may take a bit of work, but in the end, you will receive the fruits of your labor.