Duke4.net Forums: About assault trooper colors - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

About assault trooper colors

User is offline   eniojr 

#1

Hi, i'd like to know how to prevent the assault trooper with palette 0 to turn to green (pal 11). That's because I'm making each palette to shoot a different projectile. Here's the code in GAME.CON:

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:

Posted Image

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!

This post has been edited by eniojr: Yesterday, 10:48 AM

0

User is offline   Aleks 

#2

Maybe it's a crude workaround, but you could just give the default trooper e.g. pal 3 so it stays blue?
1

User is online   Danukem 

  • Duke Plus Developer

#3

Make it a switch statement where FIRELASER is the default and then the other cases specify what the special pals do. Your current setup is bad because any pals not listed will simply not fire at all, and there are user maps where those exist. If you don't know how to overcome the hardcoding that makes pal 0 -> pal 11 then don't include pal 0 in the list, make it pal 3 like Aleks said.
0

User is offline   eniojr 

#4

If only there was a program to convert source code to CON language... With this one could make an entire Duke Nukem 3D code based on CON, like Ion Fury. So it would be much easier to make new mods.

I think the way Duke Nukem 3D was designed was faulty (Shadow Warrior was the worst case), due to many hardcoded things not translated to CON. If the game was entirely made using CON or a more developed version of CON language in that epoch, maybe Duke Nukem would be as easy to mod as Doom is, so it would be more popular, I think.

I think Marcolino is trying to develop such thing, don't really know.

I don't plan modding Doom, since Doom engine is much more primitive, I don't like that much. I still prefer to deal with the complex CON language of Duke Nukem.

At least now I can do some cool things with that. I created 3 new simple sector effector effects with sound and visual effects, based on Legacy. Legacy has an effect in that you take damage while in space not wearing a spacesuit. Based on that, I made 2 similar effects, one in which represents taking cold damage and another representing a toxic effect. The cold damage also makes you shake (earthquake effect without sound) and makes you run slower too, taking small draining damage. The toxic effect is more similar to the space damage, but with different sounds and color. The third effect is a sector healing effect, in that you instead of taking damage, you gain health (suitable for maps with few medkits or even none, such as an alien planet or spaceship, like that healing effect on Xen in Half Life).

I also made something iconic from Doom in Duke Nukem... That iconic HUD face, but as Duke Nukem. It's animated and responds to loss of health, nearby attacks and there's animation for very low health, with a scared face bleeding. There's also a face for death and god mode. I also plan to make a god effect through an item with limited time, similar to that of ROTT. Eventually I'll show the results here. But for now the focus is on making new variations of enemies thorugh different colors, using palette values for that.


As for our little problem...

I just found a solution in Nuclear Winter mod to the palette color, which has this code:

      ifactioncount 2
      {
        ifcanshoottarget
        {
          resetactioncount
		
        ifspritepal 16 { sound PISTOL_FIRE shoot 3980 shoot SHOTSPARK1 } else 
        ifspritepal 23 { sound CAT_FIRE shoot FREEZEBLAST } else
        { sound PRED_ATTACK shoot FIRELASER }
        }
        else ai AITROOPSEEKPLAYER
      }
  }


So based on that I made this:

state troopshootstate
  ifactioncount 2
  {
    ifcanshoottarget
    {    
        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 shoot SHOTSPARK1 } else 
	ifspritepal 19 { sound GROWSPARK shoot GROWSPARK } else
        ifspritepal 23 { sound CAT_FIRE shoot FREEZEBLAST } else
        { sound PRED_ATTACK shoot FIRELASER }
      resetactioncount
      ifrnd 128
        ai AITROOPSEEKPLAYER
      ifcount 24
      {
        ifrnd 96
          ifpdistg 2048
            ai AITROOPSEEKPLAYER
          else
          {
            ifpdistg 1596
              ai AITROOPFLEEING
            else
              ai AITROOPFLEEINGBACK
          }
      }
    }
    else
      ai AITROOPSEEKPLAYER
	}
	
	ifspritepal 19
    ifpdistl 2048
    {
        state troopabouttoexplode
		sound LASERTRIP_ONWALL
		sound LASERTRIP_ARMING
	}
ends


I tried that case thing, but couldn't solve the problem that way. Maybe I'm still too dumb with CON anyway.

Now each color only shoots the desired projectile. Oh, and that state troopabouttoexplode I made for some enemies with pal 19. If you get close to them, they will explode in your face!

Enemies with spritepal 19, 30 and 31 causes damage when you approach them. 19 explode, 30 have a toxic effect and 31 a shock effect. The smoke spawned by enemies with spritepal 30 causes toxic damage by itself. Enemies with that same pal also spawn that greenslime enemy. I'm thinking in making an enemy (maybe a mini boss) that spawns sentry drones. Maybe if I recreate one of those ROTT robots... Maybe that NME thing, hehe!

For now, the results:

Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image
Posted Image

The last image shows a mini boss I made, based on DPRECON from Dukeplus. It shoots many projectiles in sequence.


Posted Image

As for the map itself, it's somewhat similar to those _SE.map and _ST.MAP.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options