Duke4.net Forums: Shootable Corpses - Duke4.net Forums

Jump to content

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

Shootable Corpses  "As the title says, making corpses shootable."

User is offline   Mav3r1ck 

#1

I'm trying to make monster corpses shootable like in DN64. Though I'm having an issue with the respawning.

action AENEMYDEAD 0

state deadsprite
  action AENEMYDEAD
  cstator 256
  ifhitweapon
    break
ends

state corpsehit
  ifhitweapon
  {
    guts JIBS6 6
    ifwasweapon RADIUSEXPLOSION
    {
      state standard_jibs
      ifactor LIZTROOPDSPRITE
        state troop_body_jibs
      sound SQUISHED
      killit
    }
    ifwasweapon RPG
    {
      state standard_jibs
      ifactor LIZTROOPDSPRITE
        state troop_body_jibs
      sound SQUISHED
      killit
    }
    ifdead
    {
      state standard_jibs
      ifactor LIZTROOPDSPRITE
        state troop_body_jibs
      sound SQUISHED
      killit
    }
  }
ends


//
//
//    TROOP/LIZTROOP CODE
//
//

action ATROOPSTAND     0  1  5  1  1
action ATROOPGROW    0  1  5  1  1
action ATROOPSTAYSTAND  -2  1  5  1  1
action ATROOPWALKING   0  4  5  1   12
action ATROOPWALKINGBACK 15   4  5   -1   12
action ATROOPRUNNING   0  4  5  1  8
action ATROOPSHOOT    35  1  5  1   30
action ATROOPJETPACK  40  1  5  1  1
action ATROOPJETPACKILL 40  2  5  1   50
action ATROOPFLINTCH  50  1  1  1  6
action ATROOPDYING    50  5  1  1   16
action ATROOPPLAYDEAD   0
action ATROOPSUFFERDEAD 58  2  1   -4   24
action ATROOPSUFFERING  59  2  1  1   21
action ATROOPDUCK     64  1  5  1  3
action ATROOPDUCKSHOOT  64  2  5  1   25
action ATROOPABOUTHIDE  74  1  1  1   25
action ATROOPHIDE     79  1  1  1   25
action ATROOPREAPPEAR   74  1  1  1   25
action ATROOPFROZEN    0  1  5

move TROOPWALKVELS 72
move TROOPWALKVELSBACK -72
move TROOPJETPACKVELS 64 -84
move TROOPJETPACKILLVELS 192 -38
move TROOPRUNVELS 108
move TROOPSTOPPED
move DONTGETUP
move SHRUNKVELS 32

ai AITROOPSEEKENEMY  ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPSEEKPLAYER ATROOPWALKING   TROOPWALKVELS seekplayer
ai AITROOPFLEEING  ATROOPWALKING   TROOPWALKVELS fleeenemy
ai AITROOPFLEEINGBACK ATROOPWALKINGBACK   TROOPWALKVELSBACK faceplayer
ai AITROOPDODGE    ATROOPWALKING   TROOPRUNVELS  dodgebullet
ai AITROOPSHOOTING   ATROOPSHOOT   TROOPSTOPPED  faceplayer
ai AITROOPDUCKING  ATROOPDUCK    TROOPSTOPPED  faceplayer
ai AITROOPJETPACK  ATROOPJETPACK   TROOPJETPACKVELS seekplayer
ai AITROOPSHRUNK   ATROOPWALKING   SHRUNKVELS fleeenemy
ai AITROOPHIDE     ATROOPABOUTHIDE TROOPSTOPPED faceplayer
ai AITROOPGROW     ATROOPGROW    DONTGETUP faceplayerslow
ai AITROOPFADE     ATROOPGROW    DONTGETUP faceplayerslow

state troophidestate
  ifaction ATROOPREAPPEAR
  {
    ifactioncount 2
    {
      sound TELEPORTER
      ai AITROOPSHOOTING
      cstat 257
    }
    else
    {
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      sizeto 41 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPWALKING
  {
    ifpdistl 2448
      ifpdistg 1024
    {
      ifceilingdistl 48
        break
      ifp pfacing
        break

      ifgapzl 64 nullop
      else
        ifawayfromwall
      {
        spawn TRANSPORTERSTAR
        action ATROOPREAPPEAR
        move 0
        break
      }
    }
  }
  else
    ifaction ATROOPHIDE
  {
    ifactioncount 2
    {
      spawn TRANSPORTERSTAR
      sound TELEPORTER
      action ATROOPWALKING
      move TROOPWALKVELS faceplayer
      cstat 32768
    }
    else
    {
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      sizeto 4 40
      spawn FRAMEEFFECT1
    }
  }
  else
    ifaction ATROOPABOUTHIDE
      ifactioncount 2
    {
      action ATROOPHIDE
      cstat 0
    }
ends


state troopgunnashoot
  ifp palive
  {
    ifpdistl 1024
      ai AITROOPSHOOTING
    else
      ifactornotstayput
    {
      ifactioncount 12
        ifrnd 16
          ifcanshoottarget
      {
        ifspritepal 21
          ifrnd 4
            ifpdistg 4096
              ai AITROOPHIDE
        else
        {
          ifpdistl 1100
            ai AITROOPFLEEING
          else
          {
            ifpdistl 4096
              ifcansee
                ifcanshoottarget
                  ai AITROOPSHOOTING
            else
            {
              move TROOPRUNVELS seekplayer
              action ATROOPRUNNING
            }
          }
        }
      }
    }
    else
      ifcount 26
        ifrnd 32
          ai AITROOPSHOOTING
  }
ends

state troopseekstate
  state troopgunnashoot
  ifinwater
  {
    ai AITROOPJETPACK
    break
  }
  ifcansee
  {
    ifmove TROOPRUNVELS
      ifpdistl 1596
        ai AITROOPDUCKING
    ifp phigher
    {
      ifceilingdistl 128 nullop
      else
        ifactornotstayput
          ai AITROOPJETPACK
      break
    }
    else
      ifrnd 2
    {
      ifspritepal 21
        ifpdistg 1596
      {
        ai AITROOPHIDE
        break
      }
      ifbulletnear
      {
        ifrnd 128
          ai AITROOPDODGE
        else
          ai AITROOPDUCKING
        break
      }
    }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
              ai AITROOPSHOOTING
  }
  ifrnd 1
  {
    ifrnd 128
      soundonce PRED_ROAM
    else
      soundonce PRED_ROAM2
  }
ends

state troopduckstate
  ifaction ATROOPDUCK
  {
    ifactioncount 8
    {
      ifp palive
      {
        ifrnd 128
          action ATROOPDUCKSHOOT
      }
      else
        ifmove DONTGETUP
          break
        else
          ai AITROOPSEEKPLAYER
    }
  }
  else
    ifaction ATROOPDUCKSHOOT
  {
    ifcount 64
    {
      ifmove DONTGETUP
        resetcount
      else
      {
        ifpdistl 1100
          ai AITROOPFLEEING
        else
          ai AITROOPSEEKPLAYER
      }
    }
    else
      ifactioncount 2
      {
        ifcanshoottarget
        {
          sound PRED_ATTACK
          resetactioncount
          shoot FIRELASER
        }
        else ai AITROOPSEEKPLAYER
      }
  }
ends

state troopshootstate
  ifactioncount 2
  {
    ifcanshoottarget
    {
      shoot FIRELASER
      sound PRED_ATTACK
      resetactioncount
      ifrnd 128
        ai AITROOPSEEKPLAYER
      ifcount 24
      {
        ifrnd 96
          ifpdistg 2048
            ai AITROOPSEEKPLAYER
          else
          {
            ifpdistg 1596
              ai AITROOPFLEEING
            else
              ai AITROOPFLEEINGBACK
          }
      }
    }
    else
      ai AITROOPSEEKPLAYER
  }
ends

state troopfleestate
  ifactioncount 7
  {
    ifpdistg 3084
    {
      ai AITROOPSEEKPLAYER
      break
    }
    else
      ifrnd 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPDUCKING
        else
          ai AITROOPSHOOTING
          break
      }
  }
  ifnotmoving
  {
    ifrnd 32
      operate
    else
      ifcount 32
        ifp palive
          ifcansee
            ifcanshoottarget
      {
        ifrnd 128
          ai AITROOPSHOOTING
        else
          ai AITROOPDUCKING
      }
  }
ends

state troopdying
  iffloordistl 32
  {
    ifactioncount 5
    {
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      move TROOPSTOPPED
      state deadsprite
      strength TROOPSTRENGTH
      cactor LIZTROOPDSPRITE
    }
    break
  }
  else
  {
    state rf
    move 0
    action ATROOPDYING
  }
ends

state checktroophit
  ifaction ATROOPSUFFERING
  {
    stopsound LIZARD_BEG
    sound PRED_DYING
    cstat 0
    strength 0
    action ATROOPSUFFERDEAD
    break
  }
  ifdead
  {
    ifwasweapon FREEZEBLAST
    {
      sound SOMETHINGFROZE
      spritepal 1
      move 0
      action ATROOPFROZEN
      strength 0
      break
    }

    state drop_ammo
    state random_wall_jibs

    ifwasweapon GROWSPARK
    {
      cstat 0
      sound ACTOR_GROWING
      ai AITROOPGROW
      break
    }

    addkills 1

    ifwasweapon RPG
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
      ifwasweapon RADIUSEXPLOSION
    {
      sound SQUISHED
      state troop_body_jibs
      state standard_jibs
      killit
    }
    else
    {
      sound PRED_DYING
      ifrnd 32
        iffloordistl 32
      {
        sound LIZARD_BEG
        spawn BLOODPOOL
        strength 0
        move 0
        action ATROOPSUFFERING
        break
      }
      action ATROOPDYING
      break
    }
  }
  else
  {
    state random_wall_jibs
    sound PRED_PAIN

    ifwasweapon SHRINKSPARK
    {
      sound ACTOR_SHRINKING
      ai AITROOPSHRUNK
    }
    else
      ifwasweapon GROWSPARK
        sound EXPANDERHIT
    else
      iffloordistl 32
        ifrnd 96
          action ATROOPFLINTCH
  }
ends

state troopjetpackstate
  ifaction ATROOPJETPACKILL
  {
    ifcansee
      ifactioncount 2
    {
      resetactioncount
      sound PRED_ATTACK
      shoot FIRELASER
    }

    ifp phigher
      ai AITROOPJETPACK
    else
      ifinwater
        ai AITROOPJETPACK
    else
      ifcount 26
        iffloordistl 32
          ai AITROOPSEEKPLAYER
  }
  else
    ifcount 48
      ifcansee
  {
    action ATROOPJETPACKILL
    move TROOPJETPACKILLVELS
    seekplayer
  }
ends

state checksquished
  ifsquished
  {
    addkills 1
    sound SQUISHED
    state standard_jibs
    state random_ooz
    killit
  }
ends

state troopsufferingstate
  ifactioncount 2
  {
    ifrnd 16
      spawn WATERDRIP
    ifactioncount 14
    {
      stopsound LIZARD_BEG
      cstat 0
      strength 0
      action ATROOPSUFFERDEAD
      break
    }
  }
ends

state troopshrunkstate
  ifcount SHRUNKDONECOUNT
    ai AITROOPSEEKENEMY
  else
    ifcount SHRUNKCOUNT
      sizeto 48 40
  else
    state genericshrunkcode
ends


state troopcode fall
  ifinwater
    ifrnd 1
      spawn WATERBUBBLE
  ifaction ATROOPSTAND
  {
    ifrnd 192
      ai AITROOPSHOOTING
    else
      ai AITROOPSEEKPLAYER
  }
  else
    ifaction ATROOPFROZEN
  {
    ifcount THAWTIME
    {
      ai AITROOPSEEKENEMY
      getlastpal
    }
    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
    ifaction ATROOPSUFFERDEAD
  {
    ifactioncount 2
    {
      state deadsprite
      ifrnd 64
      {
        resetcount
        action ATROOPPLAYDEAD
      }
      else
        soundonce PRED_DYING
      strength TROOPSTRENGTH
      cactor LIZTROOPDSPRITE
    }
  }
  else
    ifaction ATROOPDYING
  {
    state troopdying
    break
  }
  else
    ifaction ATROOPSUFFERING
  {
    state troopsufferingstate
    ifhitweapon
      state checktroophit
    break
  }
  else
    ifaction ATROOPFLINTCH
  {
    ifactioncount 4
      ai AITROOPSEEKENEMY
  }
  else
  {
    ifai AITROOPSEEKPLAYER
      state troopseekstate
    else
      ifai AITROOPJETPACK
    {
      state troopjetpackstate
      ifinwater nullop
      else
        soundonce RECO_ROAM
    }
    else
      ifai AITROOPSEEKENEMY
        state troopseekstate
    else
      ifai AITROOPSHOOTING
        state troopshootstate
    else
      ifai AITROOPFLEEING
        state troopfleestate
    else
      ifai AITROOPFLEEINGBACK
        state troopfleestate
    else
      ifai AITROOPDODGE
        state troopseekstate
    else
      ifai AITROOPDUCKING
        state troopduckstate
    else
      ifai AITROOPSHRUNK
        state troopshrunkstate
    else
      ifai AITROOPGROW
        state genericgrowcode
    else
      ifai AITROOPHIDE
    {
      state troophidestate
      break
    }
  }

  ifai AITROOPSHRUNK
    break
  ifhitweapon
    state checktroophit
  else
    state checksquished
ends

state checktrooppalette
  ifai 0
  {
    ifspritepal 0
        nullop
    else
        ifspritepal 21
          addstrength TROOPSTRENGTH // Double the hitpoint vals
  }
ends


actor LIZTROOPJETPACK TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPJETPACK
  cactor LIZTROOP
enda

actor LIZTROOPDUCKING TROOPSTRENGTH
  state checktrooppalette
  ai AITROOPDUCKING
  cactor LIZTROOP
  ifgapzl 48
    move DONTGETUP
enda

actor LIZTROOPSHOOT TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSHOOTING
  cactor LIZTROOP
enda
actor LIZTROOPSTAYPUT TROOPSTRENGTH ATROOPSTAYSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPRUNNING TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  ai AITROOPSEEKPLAYER
  cactor LIZTROOP
enda
actor LIZTROOPONTOILET TROOPSTRENGTH
  ifcount 24
  {
    sound FLUSH_TOILET
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda

actor LIZTROOPJUSTSIT TROOPSTRENGTH
  ifcount 30
  {
    operate
    ai AITROOPSEEKPLAYER
    cactor LIZTROOP
  }
  else
    ifcount 2
      nullop
  else
    state checktrooppalette
enda


actor LIZTROOP TROOPSTRENGTH ATROOPSTAND
  state checktrooppalette
  state troopcode
enda

useractor notenemy LIZTROOPDSPRITE TROOPSTRENGTH
  fall
  move 0
  state checksquished
  state corpsehit
/*
  ifaction ATROOPPLAYDEAD
  {
    ifcount PLAYDEADTIME
    {
      addkills -1
      soundonce PRED_ROAM
      cactor LIZTROOP
      cstat 257
      strength 1
      ai AITROOPSHOOTING
    }
    else
    ifp pfacing
      resetcount
    break
  }
*/
  ifaction AENEMYDEAD
    ifrespawn
  ifcount RESPAWNACTORTIME
  {
    spawn TRANSPORTERSTAR
    addkills -1
    cactor LIZTROOP
    cstat 257
    strength TROOPSTRENGTH
    state checktrooppalette
    ai AITROOPSEEKENEMY
  }
enda


Above is the code that I used from the DN64 mod, and modified for DN3D (Eduke32 and non versions) all inside the GAME.CON. Everything works with the exception that the Assault Trooper doesn't respawn for some reason. I can't figure out what I'm doing wrong.
0

User is offline   Danukem 

  • Duke Plus Developer

#2

A couple things I notice right away.

Your LIZTROOPDSPRITE is constantly spamming the "move 0" command, which resets the count. So the count can never reach RESPAWNACTORTIME.

Also, I don't think "ifrespawn" works on custom actors, I'm pretty sure that check only applies to the specific tile numbers it worked on the the vanilla game. EDIT I'm less sure on that second point though; cactoring from LIZTROOP might preserve whatever ifrespawn is checking

This post has been edited by Danukem: 01 April 2022 - 10:23 AM

0

User is offline   Mav3r1ck 

#3

So should I remove "move 0" or change it to something else?
0

User is offline   jimbob 

#4

i think you re overcomplicating things with making the dead sprite a new actor in itself

i have this for a test soldier for my mod, he can be killed, and his corpse can be shot ( or blown to bits )

ai WOUNDEDAI GIWOUNDEDFRAMES 0 0 
ai GIDEADAI GIDEAD 0 0

useractor notenemy GIWOUNDED WEAK
sizeat 14 14

ifai NO

{
	cstator 257 
	ai WOUNDEDAI
	
}

ifai GIDEADAI
action GIDEAD
ifhitweapon
	ifdead
	{
 		ifwasweapon RPG
			{	
		state goredeath
			}
		ifwasweapon RADIUSEXPLOSION
			{
	state goredeath
			}
		else 
			{
			move RANDOMISER randomangle // ignore this, this is for a custom blood 'particle'
	   		zshoot -2048 BLOODDROP2
			move RANDOMISER randomangle
   			zshoot -3072 BLOODDROP2
			move RANDOMISER randomangle
  			 zshoot -3072 BLOODDROP2
			move RANDOMISER randomangle
  			 zshoot -3072 BLOODDROP2
			ai GIDEADAI
			strength 1
			}
		
	}
ifai WOUNDEDAI
ifcount 128 
    ifrnd 4
		{
		ai WOUNDEDAI
		// remove next section if not working
		move RANDOMISER randomangle
   		zshoot -2048 BLOODDROP2
		move RANDOMISER randomangle
   		zshoot -3072 BLOODDROP2
		move RANDOMISER randomangle
  		 zshoot -3072 BLOODDROP2
		move RANDOMISER randomangle
  		 zshoot -3072 BLOODDROP2
		sound DUKE_LAND_HURT
		}
ifhitweapon
	ifdead
	{
 		ifwasweapon RPG
			{	
			state goredeath
			}
		ifwasweapon RADIUSEXPLOSION
			{
			state goredeath
			}
		else 
			{
			move RANDOMISER randomangle
	   		zshoot -2048 BLOODDROP2
			move RANDOMISER randomangle
   			zshoot -3072 BLOODDROP2
			move RANDOMISER randomangle
  			 zshoot -3072 BLOODDROP2
			move RANDOMISER randomangle
  			 zshoot -3072 BLOODDROP2
			ai GIDEADAI
			strength 1
			}
	}
enda

basically i use the ifai GIDEADAI to check if he's dead, keep the cstat to blocked and hittable, and use ifwasweapon radiusexplosion to delete it and spawn some gore, and an else command to spawn blood if it gets hit by anything else. though you might keep setting the strength to 0 for your actor

This post has been edited by jimbob: 01 April 2022 - 12:37 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#5

I'm going to say this in quasi-english and it will be up to you if you want to implement it.

Do not use a new LIZTROOPDSPRITE at all, just use the regular LIZTROOP actor. At the point in the code where it goes to the dead body action, have it also use cstator 256 and strength LIZTROOPSTRENGTH. Then, make it use state corpsehit in its normal dead action, but also use the normal respawn code.
0

User is offline   Mav3r1ck 

#6

Is this part of the code you're referring to?

state troopdying
  iffloordistl 32
  {
    ifactioncount 5
    {
      cstat 0
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      strength 0
      move TROOPSTOPPED
      action ATROOPDEAD
    }
    break
  }
  else
  {
    state rf
    move 0
    action ATROOPDYING
  }
ends


Or is it this part?

state troopcode fall
  ifinwater
    ifrnd 1
      spawn WATERBUBBLE
  ifaction ATROOPSTAND
  {
    ifrnd 192
      ai AITROOPSHOOTING
    else
      ai AITROOPSEEKPLAYER
  }
  else
    ifaction ATROOPFROZEN
  {
    ifcount THAWTIME
    {
      ai AITROOPSEEKENEMY
      getlastpal
    }
    else
      ifcount FROZENDRIPTIME
    {
      ifactioncount 26
      {
        spawn WATERDRIP
        resetactioncount
      }
    }
    ifhitweapon
    {
      ifwasweapon FREEZEBLAST
      {
        strength 0
        break
      }
      addkills 1

      ifrnd 84
        spawn BLOODPOOL
      lotsofglass 60
      sound GLASS_BREAKING
      killit
    }
    ifp pfacing
      ifpdistl FROZENQUICKKICKDIST
        pkick
    break
  }
  else ifaction ATROOPPLAYDEAD
  {
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished

    ifcount PLAYDEADTIME
    {
      addkills -1
      soundonce PRED_ROAM
      cstat 257
      strength 1
      ai AITROOPSHOOTING
    }
    else
      ifp pfacing
        resetcount

    break
  }
  else
    ifaction ATROOPDEAD
  {
    strength 0
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength TROOPSTRENGTH
      sound PRED_RECOG
      ai AITROOPSEEKENEMY
    }
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
      break
    }
    else
      state checksquished
    break
  }
  else
    ifaction ATROOPSUFFERDEAD
  {
    ifactioncount 2
    {
      ifrnd 64
      {
        resetcount
        action ATROOPPLAYDEAD
      }
      else
      {
        soundonce PRED_DYING
        action ATROOPDEAD
      }
    }
  }
  else
    ifaction ATROOPDYING
  {
    state troopdying
    break
  }
  else
    ifaction ATROOPSUFFERING
  {
    state troopsufferingstate
    ifhitweapon
      state checktroophit
    break
  }
  else
    ifaction ATROOPFLINTCH
  {
    ifactioncount 4
      ai AITROOPSEEKENEMY
  }
  else
  {
    ifai AITROOPSEEKPLAYER
      state troopseekstate
    else
      ifai AITROOPJETPACK
    {
      state troopjetpackstate
      ifinwater nullop
      else
        soundonce DUKE_JETPACK_IDLE
    }
    else
      ifai AITROOPSEEKENEMY
        state troopseekstate
    else
      ifai AITROOPSHOOTING
        state troopshootstate
    else
      ifai AITROOPFLEEING
        state troopfleestate
    else
      ifai AITROOPFLEEINGBACK
        state troopfleestate
    else
      ifai AITROOPDODGE
        state troopseekstate
    else
      ifai AITROOPDUCKING
        state troopduckstate
    else
      ifai AITROOPSHRUNK
        state troopshrunkstate
    else
      ifai AITROOPGROW
        state genericgrowcode
    else
      ifai AITROOPHIDE
    {
      state troophidestate
      break
    }
  }

  ifhitweapon
    state checktroophit
  else
    state checksquished
ends


I'm more hands on, so it's difficult to determine what goes where.
0

User is offline   jimbob 

#7

try this

   ifaction ATROOPDEAD
cstat 257 // added cstat to block and block weapon shots. 
  {
    strength 0
    ifrespawn
      ifcount RESPAWNACTORTIME
    {
      spawn TRANSPORTERSTAR
      cstat 257
      strength TROOPSTRENGTH
      sound PRED_RECOG
      ai AITROOPSEEKENEMY
    }
    ifhitweapon
    {
      ifwasweapon RADIUSEXPLOSION
      {
        sound SQUISHED
        state troop_body_jibs
        state standard_jibs
        killit
      }
     else // added this else to spawn blood when hit, unless it is hit by a radius explosion then it deletes the sprite.
     {
       spawn BLOOD
     } 
      break
    }
    else
      state checksquished
    break
  }


This post has been edited by jimbob: 01 April 2022 - 03:28 PM

0

User is offline   Mav3r1ck 

#8

I'll give that a try. Lol I attempted what danukem suggested and did it wrong cause I didn't know where in those parts to put in and alter what he suggested.

Lol the trooper did it's recog and froze, so I shot it and it froze and thrusted backwards as it spawned blood so of course I did something wrong.

EDIT: Just tried your suggestion jimbob, the alien was left frozen and thrusted backwards as I shot it with a pistol while it spawned blood and not die.

EDIT: I wanted to try danukem's method but I'm still not that in depth when it comes to the GAME.CON file. Though I have modded it to fit my preferences.

This post has been edited by Mav3r1ck: 01 April 2022 - 05:44 PM

0

User is offline   Mav3r1ck 

#9

@Danukem

Is this correct?

state troopdying
  iffloordistl 32
  {
    ifactioncount 5
    {
      cstat 0
      iffloordistl 8
      sound THUD
      ifrnd 64
        spawn BLOODPOOL
      state rf
      strength 0
      move TROOPSTOPPED
      action ATROOPDEAD
      cstator 256
      strength TROOPSTRENGTH
      state corpsehit
    }
    break
  }
  else
  {
    state rf
    move 0
    action ATROOPDYING
  }
ends


Sorry for the double post, it wouldn't let me edit the above post.
0

User is offline   Danukem 

  • Duke Plus Developer

#10

The "strength 0" does nothing and should be removed (although it is harmless). Also there is no reason to use "state corpsehit" there -- that will be used constantly when the body is dead (every tic after this point), but that is also harmless.

That code you pasted there doesn't show everything you need, though. The code running when the body is lying dead also needs to be correct.
0

User is offline   Mav3r1ck 

#11

View PostDanukem, on 02 April 2022 - 02:06 PM, said:

The "strength 0" does nothing and should be removed (although it is harmless). Also there is no reason to use "state corpsehit" there -- that will be used constantly when the body is dead (every tic after this point), but that is also harmless.

That code you pasted there doesn't show everything you need, though. The code running when the body is lying dead also needs to be correct.


I reverted the code back to the original code. I only posted that part of the code because when I edited and tested it in game, the Assault Trooper died and I was able to shoot it's corpse repeatedly while it spawned blood droplets until it respawned. So I was under the impression that this was part of the code to modify. This was before I added the state corpsehit.

So I'll remove the "strength 0" and keep the cstator 256 and strength troopstrength. Where do I put the state corpse hit?
0

User is online   brullov 

  • Senior Artist at TGK

#12

Hey Mav3r1ck, let me save you some time. And save some of Danukem's nerve cells.

It's obvious that you don't have any knowledge of coding judging by the origin of your topic, and neither do I. So I'd be very clear and asked for a specific kind of help. E.g. "Hello, I'm working on project X (attached screenshots), and I don't know how to create shootable corpses. Could you share a code for the X case, please? I'd be very grateful!". Duke4 community is extremely generous in support, but you need to give some evidence that your call is not just a curiosity or a short-time play.
0

User is offline   Mav3r1ck 

#13

The GAME.CON is the one I have the most difficult time with. The other con files are easier to mess with.

I wanted to avoid having it spoon fed to me, which was why I was trying do it myself with what Danukem was trying to explain it to me and get it working. Jimbob was also trying to aid, but his method didn't work when I applied the changes. For me, it would have been easier to see an example code that works then I would apply it to not only that actor, but all the other existing actors in the game con. That was why I was saying I'm more hands on, or rather see it to understand it better.

This post has been edited by Mav3r1ck: 03 April 2022 - 01:01 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#14

View PostDanukem, on 01 April 2022 - 10:21 AM, said:

Also, I don't think "ifrespawn" works on custom actors, I'm pretty sure that check only applies to the specific tile numbers it worked on the the vanilla game. EDIT I'm less sure on that second point though; cactoring from LIZTROOP might preserve whatever ifrespawn is checking

Ifrespawn checks if the hard-coded picnum is an item, otherwise all actors are given the enemy treatment.

View PostDanukem, on 01 April 2022 - 12:54 PM, said:

Do not use a new LIZTROOPDSPRITE at all, just use the regular LIZTROOP actor. At the point in the code where it goes to the dead body action, have it also use cstator 256 and strength LIZTROOPSTRENGTH. Then, make it use state corpsehit in its normal dead action, but also use the normal respawn code.

You need LIZTROOPDSPRITE because otherwise the shoots will hit higher than the corpse.
0

User is offline   Danukem 

  • Duke Plus Developer

#15

Yeah I had forgotten about the hitbox thing. In my mods I usually have a standing actor and a ducking actor and they run the same code, cactoring back and forth depending on which action they are using.
0

User is offline   Mav3r1ck 

#16

Just out of curiosity. What parts of the actor's code can you modify to increase their aggressiveness?

This post has been edited by Mav3r1ck: 04 April 2022 - 06:34 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#17

View PostMav3r1ck, on 04 April 2022 - 06:32 PM, said:

Just out of curiosity. What parts of the actor's code can you modify to increase their aggressiveness?

You would increase the value of "ifrnd" before they attack
0

User is offline   Mark 

#18

or change the value of how far away from the player before reacting.
0

User is offline   Danukem 

  • Duke Plus Developer

#19

Those two are good suggestions. Another one is when you see "ifcount" in the code before initiating an attack, you can reduce the number. Notice I did not say "actioncount". Don't do that in the middle of an attack sequence though (e.g. the pigcop firing sequence), just do it on the parts before the attack starts.
0

User is offline   Mav3r1ck 

#20

Nice! I'll try doing that to make the game more challenging.

Also, I thought for sure I could make shootable and respawning monsters for non-eduke related ports, but I guess not.

To make this workable even for eduke32, do you need the GAME2.CON?
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