state troopshootstate ifactioncount 2 { ifcanshoottarget { ifspritepal 0 { sound PRED_ATTACK shoot FIRELASER } else ifspritepal 10 { sound RPG_SHOOT shoot RPG } else ifspritepal 11 { sound PRED_ATTACK shoot FIRELASER } else ifspritepal 12 { sound PLASMARIFLE_FIRE shoot PLASMAPROJ } else ifspritepal 15 { sound FLAMEALT_SOUND shoot FLAMEPROJ } else ifspritepal 16 { sound PISTOL_FIRE shoot 3980 } else ifspritepal 19 { sound GROWSPARK shoot GROWSPARK } else ifspritepal 23 { sound CAT_FIRE shoot FREEZEBLAST } else resetcount ifrnd 128 ai AITROOPSEEKPLAYER ifcount 24 { ifrnd 96 ifpdistg 2048 ai AITROOPSEEKPLAYER else { ifpdistg 1596 ai AITROOPFLEEING else ai AITROOPFLEEINGBACK } } } else ai AITROOPSEEKPLAYER } ends
The problem is that the "ifspritepal 0 { sound PRED_ATTACK shoot FIRELASER }" doesn't shoot anything. If you change the palette to 11, fine, but in pal 0, nothing.
I also tried this:
ifspritepal 10 { sound RPG_SHOOT shoot RPG } else ifspritepal 11 { sound PRED_ATTACK shoot FIRELASER } else ifspritepal 12 { sound PLASMARIFLE_FIRE shoot PLASMAPROJ } else ifspritepal 15 { sound FLAMEALT_SOUND shoot FLAMEPROJ } else ifspritepal 16 { sound PISTOL_FIRE shoot 3980 } else ifspritepal 19 { sound GROWSPARK shoot GROWSPARK } else ifspritepal 23 { sound CAT_FIRE shoot FREEZEBLAST } else sound PRED_ATTACK shoot FIRELASER else resetcount
In this case, even the trooper with pal 0 shoot, but the other ones with different color also shoot firelaser with another projectile, which is I don't want.
Is there a way to prevent the trooper with pal 0 to switch to pal 11, so that it keeps that standard blue color of palette 0? That would allow me to specify firelaser to pal 0 and shrinker to pal 11.
I think the reason for that problem is that there's some hard coded thing that makes the blue trooper turns into green trooper.
Is there a way I can prevent this by making some CON script? Maybe some condition to prevent the automatic switch from 0 to 11?
Here's a picture to give you some idea of what I'm making:
The troopers behind each door have a different color from 0, while the trooper in the corridor have color 0. The idea is that each color make the troop shoot a different projectile other than firelaser.
I also did the same thing to many other enemies and didn't have problems with this!