Duke4.net Forums: What determines if an actor can be hit by shrinker or not? - Duke4.net Forums

Jump to content

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

What determines if an actor can be hit by shrinker or not?  "Using Protector Drone as an example"

User is offline   zykov eddy 

#1

Hello everyone. I'm currently working on a global remaster of a certain old Duke 3D TC from 1998. In the TC, there are three new enemies that are immune to shrinker weapon, just like Protector Drone. I want to change that, but for the life of me, I can't find anything in the CON that tell if an actor can be damaged by shrinker projectile, Can somebody help?
0

#2

The answer is the vanilla GAME.CON. The thing is that all actors are immune to the shrinker by default. The entire shrinking process is managed directly via CON. Enemies that are not immune to shrinker have a
ifwasweapon SHRINKSPARK
clause in their hit check code (see
state checkoctahitstate
for an example), and a special action (ai) for the shrunk state that tells them to shrink (by calling
state genericshrunkcode
) and then grow back when SHRUNKCOUNT is reached, and return to their normal action once SHRUNKDONECOUNT is reached.

If your enemy code does not contain all of that, the shrinker will be treated as a regular weapon (dealing zero damage).

This post has been edited by Jan Satcitananda: 25 October 2025 - 08:42 AM

2

User is offline   Reaper_Man 

  • Once and Future King

#3

Also - What are the tile IDs of the enemies? Are they setup as useractors, or are they overriding existing actors (as was very common at the time)? Assuming Jan's answer doesn't solve the issue for you, you potentially could be running into some hardcoded behaviors.
0

#4

All the shrinker code for newbeast is commented out for your convenience
0

User is offline   zykov eddy 

#5

View PostJan Satcitananda, on 25 October 2025 - 08:38 AM, said:

The answer is the vanilla GAME.CON. The thing is that all actors are immune to the shrinker by default. The entire shrinking process is managed directly via CON. Enemies that are not immune to shrinker have a
ifwasweapon SHRINKSPARK
clause in their hit check code (see
state checkoctahitstate
for an example), and a special action (ai) for the shrunk state that tells them to shrink (by calling
state genericshrunkcode
) and then grow back when SHRUNKCOUNT is reached, and return to their normal action once SHRUNKDONECOUNT is reached.

If your enemy code does not contain all of that, the shrinker will be treated as a regular weapon (dealing zero damage).


Sadly, that didn't work, shrinker projectile still does nothing to the enemy. It doesn't even bleed or make any sounds.

Interestingly, when I increased SHRINKER_WEAPON_STRENGTH from it's original value 10 to 1000, projectile started doing serious knockback, but still no damage and no effect.


View PostReaper_Man, on 25 October 2025 - 09:48 AM, said:

Also - What are the tile IDs of the enemies? Are they setup as useractors, or are they overriding existing actors (as was very common at the time)? Assuming Jan's answer doesn't solve the issue for you, you potentially could be running into some hardcoded behaviors.


One of the enemys ID is 341, which is a hardcoded thing, so it could potentially be the source of the problem.

However, there are also two other enemies that are immune to shrinker in the TC, and their IDs are 2620 and 2080, so, maybe not.

This post has been edited by zykov eddy: 26 October 2025 - 10:51 AM

0

User is offline   Reaper_Man 

  • Once and Future King

#6

341 is defined as BPANNEL1, which is one of the breakable wall panels, so that shouldn't have any interactions as a sprite/actor.

You could try simply redefining the actor as a useractor on a new tile ID to test, but if the other useractors at 2080 and 2620 are also immune, this is likely a CON oversight. The behavior you're describing sounds like improperly setup ifhitweapon / ifwasweapon ordering.

Post the code for one of the enemies and we can take a look what might be the problem.
0

User is offline   zykov eddy 

#7

View PostReaper_Man, on 26 October 2025 - 12:53 PM, said:

341 is defined as BPANNEL1, which is one of the breakable wall panels, so that shouldn't have any interactions as a sprite/actor.

You could try simply redefining the actor as a useractor on a new tile ID to test, but if the other useractors at 2080 and 2620 are also immune, this is likely a CON oversight. The behavior you're describing sounds like improperly setup ifhitweapon / ifwasweapon ordering.

Post the code for one of the enemies and we can take a look what might be the problem.


define RD 341
define RDSTAYPUT 342

define RDSTRENGTH         120
define RDWHIPAMOUNT   -25

action ARDSTAND     0
action ARDWALKING   5  4  5  1  12
action ARDRUNNING   5  4  5  1  8
action ARDTHINK     0   1  5  1  40
action ARDWHIP      40  3  5  1  20
action ARDDYING     60  6  1  1  20
action ARDFLINTCH   55  1  5  1
action ARDLYINGDEAD 65  1  1
action ARDSCREAM    25  3  5  1  40
action ARDJUMP      35  2  5  1  50
action ARDFALL      50  1  5
action ARDFROZEN    5  1  5
action RTD          915 3 1 -1 20

move RDWALKVEL 200
move RDRUNVEL 240
move RDJUMPVEL 150
move RDSTOP

ai RDTODOP RTD RDWALKVEL faceplayer
ai AIRDGETENEMY ARDWALKING RDWALKVEL seekplayer
ai AIRDDODGE ARDRUNNING RDRUNVEL dodgebullet
ai AIRDCHARGEENEMY ARDRUNNING RDRUNVEL seekplayer
ai AIRDFLEENEMY ARDWALKING RDWALKVEL fleeenemy
ai AIRDWHIPENEMY ARDWHIP RDSTOP faceplayerslow
ai AIRDJUMPENEMY ARDJUMP RDJUMPVEL jumptoplayer
ai AIRDTHINK ARDTHINK RDSTOP
ai AIRDGROW ARDSTAND  RDSTOP faceplayerslow
ai AIRDSHRINK ARDSTAND  RDSTOP faceplayer
ai AIRDDYING ARDDYING RDSTOP faceplayer
ai AIRDSHOOT ARDSCREAM RDSTOP faceplayerslow
ai AIRDFLINTCH ARDFLINTCH RDSTOP faceplayerslow


state rdseekstate

  ifactornotstayput
  {
    ifp palive
      ifcansee
        ifpdistl 1596
    {
      ai AIRDWHIPENEMY
      break
    }

    ifai AIRDCHARGEENEMY
    {
      ifp palive
        ifpdistl 1200
          ifcansee
      {
        ai AIRDWHIPENEMY
        break
      }

      ifrnd 8
        ifpdistg 3000
          ifp palive
            ifcansee
      {
        ai AIRDSHOOT
        break
      }
    }
    else
      ifpdistg 4096
    {
      ai AIRDCHARGEENEMY
      break
    }

    iffloordistl 16
    {
      ifcount 32
        ifrnd 16
      {
        ifceilingdistl 96 break
        ai AIRDJUMPENEMY
      }
      break
    }

    ifrnd 4
    {
      ifnotmoving
        operate
    }
    else
      ifrnd 16
        ifbulletnear
    {
      ifgapzl 128
        ai AIRDDODGE
      else
        ifactornotstayput
      {
        ifrnd 128
        {
          ifceilingdistl 96 break
          ai AIRDJUMPENEMY
        }
        else
          ai AIRDDODGE
      }
    }
  }
  else
  {
    ifactioncount 16
    {
      ifp palive
        ifpdistl 1596
          ifcansee
      {
        ai AIRDWHIPENEMY
        break
      }
    }
    ifcount 16
      ifrnd 32
        move RDWALKVEL randomangle geth
  }

ends

state rdfleestate
  ifcount 8
  {
    ifrnd 64
      ifpdistg 3500
        ifp palive
          ifcansee
            ai AIRDSHOOT
  }
  else
  {
    iffloordistl 16
    {
      ifnotmoving
        ai AIRDGETENEMY
    }
    else
      ai AIRDGETENEMY
    break
  }
ends


state rdthinkstate

  ifrnd 8
    soundonce RD_ROAM
  ifrnd 8
    soundonce DRAG_ROAM

  ifactioncount 5
  {
    ifrnd 2
    {
      ifpdistg 3500
        ifp palive
          ifcansee
            ai AIRDSHOOT
    }
    else
      ai AIRDGETENEMY
  }

  ifrnd 16
    ifbulletnear
  {
    ifgapzl 96
      ai AIRDDODGE
    else
    {
      ifrnd 128
      {
        ifceilingdistl 144 break
        ai AIRDJUMPENEMY
      }
      else
        ai AIRDDODGE
    }
  }
ends

state rdwhipstate
  ifcount 20
    ifrnd 8
  {
    ifcansee
      ifpdistl 2048
    {
      ifrnd 128
        ai AIRDFLEENEMY
      break
    }
    ifrnd 80
      ai AIRDTHINK
    else
      ai AIRDGETENEMY
  }

  ifactioncount 3
  {
    ifpdistg 1596
      ai AIRDTHINK
    else ifp palive ifcansee
    {
      palfrom 16 16
      addphealth RDWHIPAMOUNT
      sound PISTOL_BODYHIT ifrnd 64 sound DUKE_GRUNT
      resetactioncount
      resetcount
    }
  }
  else
    ifcount 15
      nullop
  else
    ifcount 14
  {
    ifpdistl 1596
      soundonce RD_ATTACK
    else
      soundonce RD_ATTACKMISS
  }
ends

state checkrdhit
  spawn BLOOD
  ifdead
  {
  state spawnsomeshit

    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action ARDFROZEN
	  
      strength 0
      break
    }
    addkills 1
    ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      state standard_jibs
      killit
    }
    else
    {
      ai AIRDDYING
      ifrnd 128
        spawn BLOODPOOL
    }
    sound RD_DYING
  }
  else
  {
    sound RD_PAIN
    ifwasweapon SHRINKSPARK
    {
      spawn ZAP
    }
    // foobar - modified by Blakwind for Lifeforce

    ifwasweapon GROWSPARK

      { spawn LIFEFORCE }

    state random_wall_jibs
    ifrnd 32
      ai AIRDFLINTCH
    else
      ifrnd 32
        ifpdistg 3500
          ifp palive
            ifcansee
              ai AIRDSHOOT
  }
ends

state rdshrink
  ifcount SHRUNKDONECOUNT
    ai AIRDCHARGEENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 40 40
  else
    state genericshrunkcode
ends

state rdjumpstate
  ifaction ARDFALL
  {
    iffloordistl 16
      ai AIRDGETENEMY
  }
  else
    ifcount 20
      action ARDFALL
ends

state rddyingstate
  ifaction ARDLYINGDEAD
  {
  cstat 0
    strength 0
    ifhitweapon
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state standard_jibs
      killit
    }
    ifcount RESPAWNACTORTIME
      ifrespawn
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength RDSTRENGTH
      ai AIRDGETENEMY
    }
  }
  else
    ifai AIRDDYING
      ifactioncount 6
  {
    iffloordistl 8
    //  sound THUD
    move RDSTOP
    action ARDLYINGDEAD
  }
ends

state rddodgestate
  ifcount 13
    ai AIRDGETENEMY
ends

useractor enemystayput RDSTAYPUT RDSTRENGTH ai AIRDGETENEMY cstator 257 cactor RD enda
state SRTD
  ifactioncount 3 {
    spawn DOP
    sound morph3
    killit
  }
ends

state rdcode
  state checksquished
  ifai 0
  {
    cstator 257
    ai AIRDGETENEMY
  }
  else
    ifaction ARDLYINGDEAD
  {
    fall
    state rddyingstate
    break
  }
  else
    ifaction ARDFROZEN
  {
    ifcount THAWTIME
    {
      ai AIRDGETENEMY
      spritepal 0
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }

    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 30
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else
    ifai AIRDJUMPENEMY
      state rdjumpstate
  else
  {
    fall
    ifai AIRDGETENEMY
      state rdseekstate
    else
      ifai AIRDCHARGEENEMY
        state rdseekstate
    else
      ifai AIRDFLINTCH
    {
      ifcount 8
        ai AIRDGETENEMY
    }

    else
      ifai AIRDDODGE
        state rddodgestate
    else
      ifai AIRDWHIPENEMY
        state rdwhipstate
    else
      ifai RDTODOP
        state SRTD
    else
      ifai AIRDFLEENEMY
        state rdfleestate
    else
      ifai AIRDTHINK
        state rdthinkstate
    else
      ifai AIRDGROW
        state genericgrowcode
		    else
      ifai AIRDSHRINK
        state rdshrink
    else
      ifai AIRDDYING
        state rddyingstate
    else
      ifai AIRDSHOOT
    {
      ifp pshrunk
        ai AIRDGETENEMY
      else
        ifcount 26
          ai AIRDGETENEMY
      else
        ifcount 20
       { ifinwater { spawn WATERBUBBLE } else { sound flamethr shoot FIRELASER } }
      else
      {
        ifcount 5
          nullop
        else
          ifcount 4
            sound RD_SPIT
      }
    }
  }

  ifhitweapon
    state checkrdhit
ends


useractor enemy RD RDSTRENGTH
  fall
  ifaction 0
  {
    sound RD_RECOG
    cstator 257
    sizeat 18 18
    ai AIRDDODGE
  }
  ifaction ARDFROZEN
    state rdcode
  else
  {
    ifspawnedby DOP
      ifrnd 1
        ifrnd 135
          ai RDTODOP
    state rdcode
    ifaction ARDFROZEN
      break
    getlastpal
  }
enda

0

#8

You missed changing the ai to AIRDSHRINK in ifhitweapon shrinkspark
1

User is offline   zykov eddy 

#9

 lllllllllllllll, on 26 October 2025 - 04:04 PM, said:

You missed changing the ai to AIRDSHRINK in ifhitweapon shrinkspark


The enemy shouldn't shrink. It should only spawn the ZAP object. AIRDSHRINK was added by me as suggested by the second post in this thread.
0

User is offline   Reaper_Man 

  • Once and Future King

#10

I'm confused then, in your original post you said there are enemies immune to the shrinker and you want to change that. So if this is an enemy that you DO want to be immune to the shrinker, which enemies ARE you talking about?
0

User is offline   zykov eddy 

#11

View PostReaper_Man, on 27 October 2025 - 04:23 AM, said:

I'm confused then, in your original post you said there are enemies immune to the shrinker and you want to change that. So if this is an enemy that you DO want to be immune to the shrinker, which enemies ARE you talking about?


No, I don't want this enemy to be immune to shrinker.
0

#12

Every actor can be damaged by the shrinker and shrinking only happens if you write the behavior to make it happen. The main difference between immune enemies from the rest is the location of 'ifwasweapon shrinkspark'.
  ifwasweapon shrinkspark
    break
  sound pred_pain
  guts jibs6 2


  sound pred_pain
  ifwasweapon shrinkspark
    break
  guts jibs6 2


  sound pred_pain
  guts jibs6 2
  ifwasweapon shrinkspark
  {
    ai AISHRUNK
    break
  }

The top block plays no sound and spawns no guts when hit with shrinker while the second block reacts with a pain sound but no guts and the third block reacts with pain, guts, and shrinking behavior.
If a hardcoded enemy were to be frozen with the freezer and then shot with the shrinker after thawing without using a 'break' I think it would die.
1

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