Eliminate Shrunk Enemies Attacking Bug: Difference between revisions
Hendricks266 (talk | contribs) mNo edit summary |
Hendricks266 (talk | contribs) No edit summary |
||
Line 15: | Line 15: | ||
ifhitweapon | ifhitweapon | ||
state checktroophit | state checktroophit | ||
else | |||
state checksquished | |||
Change it to this: | Change it to this: | ||
'''ifai AITROOPSHRUNK | state checksquished | ||
ifhitweapon | '''ifai AITROOPSHRUNK break''' | ||
ifhitweapon { state checktroophit } | |||
Do you remember what happens when you shoot an Assault Captain before he teleports? Only when he | Sometimes it is necessary to rearrange the code to prevent more bugs, as shown here. | ||
Do you remember what happens when you shoot an Assault Captain before he teleports? Only when he comes back will he fall dead / explode / et cetera. With this code this is exactly what will happen with the shrunken enemy; only when he grows back will he be able to take hits and get shot once more. | |||
Also, fixing this bug prevents another from happening: Normally, on the Damn I'm Good skill level or if you're playing respawning multiplayer, if you exploit this bug and kill him, when he respawns he will stay shrunken. | |||
It may take a bit of work, but in the end, you will receive the fruits of your labor. [[Image:Wink.gif]] | It may take a bit of work, but in the end, you will receive the fruits of your labor. [[Image:Wink.gif]] | ||
[[Category:Tutorials]] | [[Category:Tutorials]] |
Revision as of 10:35, 17 February 2007
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 else state checksquished
Change it to this:
state checksquished ifai AITROOPSHRUNK break ifhitweapon { state checktroophit }
Sometimes it is necessary to rearrange the code to prevent more bugs, as shown here.
Do you remember what happens when you shoot an Assault Captain before he teleports? Only when he comes back will he fall dead / explode / et cetera. With this code this is exactly what will happen with the shrunken enemy; only when he grows back will he be able to take hits and get shot once more. Also, fixing this bug prevents another from happening: Normally, on the Damn I'm Good skill level or if you're playing respawning multiplayer, if you exploit this bug and kill him, when he respawns he will stay shrunken.
It may take a bit of work, but in the end, you will receive the fruits of your labor.