How to make actor disappear in contact with water

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Ahpiox
Posts: 98
Joined: Fri Dec 22, 2017 1:52 am

How to make actor disappear in contact with water

Post by Ahpiox »

How to make actor disappear in contact with liquid (in TERRAIN lump)?
Im still dont know how to make their disappear

Code: Select all

ACTOR JamBloodPool
{
  +NOBLOCKMAP
  -NOGRAVITY
  +NOEXTREMEDEATH
  +FLATSPRITE
  +MOVEWITHSECTOR
  +EXPLODEONWATER
  +CORPSE
  Height 2
  Radius 1
  Scale 0.18
  Mass 1999
  Gravity 1
  States{
	Spawn:
	 DRPP A 0 A_Jump(100,"Spawn2")
	 DRPP A 450 A_Stop
	 DRPP A 29 A_SetRenderStyle(0.9,STYLE_Translucent)
	 DRPP A 26 A_SetRenderStyle(0.8,STYLE_Translucent)
	 DRPP A 23 {A_SetRenderStyle(0.7,STYLE_Translucent);A_Stop;}
	 DRPP A 20 {A_SetRenderStyle(0.6,STYLE_Translucent);A_Stop;}
	 DRPP A 17 {A_SetRenderStyle(0.5,STYLE_Translucent);A_Stop;}
	 DRPP A 14 {A_SetRenderStyle(0.4,STYLE_Translucent);A_Stop;}
	 DRPP A 11 {A_SetRenderStyle(0.3,STYLE_Translucent);A_Stop;}
	 DRPP A 8 {A_SetRenderStyle(0.2,STYLE_Translucent);A_Stop;}
	 DRPP A 5 {A_SetRenderStyle(0.1,STYLE_Translucent);A_Stop;}
	 Stop
	Spawn2:
	 DRPP B 0 A_Jump(79,"Spawn3")
	 DRPP B 450 A_Stop
	 DRPP B 29 A_SetRenderStyle(0.9,STYLE_Translucent)
	 DRPP B 26 A_SetRenderStyle(0.8,STYLE_Translucent)
	 DRPP B 23 {A_SetRenderStyle(0.7,STYLE_Translucent);A_Stop;}
	 DRPP B 20 {A_SetRenderStyle(0.6,STYLE_Translucent);A_Stop;}
	 DRPP B 17 {A_SetRenderStyle(0.5,STYLE_Translucent);A_Stop;}
	 DRPP B 14 {A_SetRenderStyle(0.4,STYLE_Translucent);A_Stop;}
	 DRPP B 11 {A_SetRenderStyle(0.3,STYLE_Translucent);A_Stop;}
	 DRPP B 8 {A_SetRenderStyle(0.2,STYLE_Translucent);A_Stop;}
	 DRPP B 5 {A_SetRenderStyle(0.1,STYLE_Translucent);A_Stop;}
	 Stop
	Spawn3:
	 DRPP C 450 A_Stop
	 DRPP C 29 {A_SetRenderStyle(0.9,STYLE_Translucent);A_Stop;}
	 DRPP C 26 {A_SetRenderStyle(0.8,STYLE_Translucent);A_Stop;}
	 DRPP C 23 {A_SetRenderStyle(0.7,STYLE_Translucent);A_Stop;}
	 DRPP C 20 {A_SetRenderStyle(0.6,STYLE_Translucent);A_Stop;}
	 DRPP C 17 {A_SetRenderStyle(0.5,STYLE_Translucent);A_Stop;}
	 DRPP C 14 {A_SetRenderStyle(0.4,STYLE_Translucent);A_Stop;}
	 DRPP C 11 {A_SetRenderStyle(0.3,STYLE_Translucent);A_Stop;}
	 DRPP C 8 {A_SetRenderStyle(0.2,STYLE_Translucent);A_Stop;}
	 DRPP C 5 {A_SetRenderStyle(0.1,STYLE_Translucent);A_Stop;}
	 Stop
	 Remove:
	 Stop
	}
}

Code: Select all

ACTOR FirePoint
{
  Radius 5
  Gravity 1
  DamageType Fire
  RenderStyle Add
  Mass 15
  bouncefactor 0.1
  -NoGravity
  -MISSILE
  +NOTELEPORT
  +FLOORCLIP
  +DROPOFF
  Height 9
  States
  {
  Spawn:
	TNT1 A 0 A_PlaySound("Flamethrower/Flame")
    FLME A 2 bright {A_Explode(6, 32);A_JumpIf(WaterLevel > 1,"Death");}
    FLME BCDEFGHIJKLMN 2 bright {A_Explode(5, 16);A_JumpIf(WaterLevel > 1,"Death");}
	TNT1 A 0 A_PlaySound("Flamethrower/Flame")
    FLME A 2 bright {A_Explode(6, 32);A_JumpIf(WaterLevel > 1,"Death");}
    FLME BCDEFGHIJKLMN 2 bright {A_Explode(5, 16);A_JumpIf(WaterLevel > 1,"Death");}
	TNT1 A 0 A_PlaySound("Flamethrower/Flame")
    FLME A 2 bright {A_Explode(6, 32);A_JumpIf(WaterLevel > 1,"Death");}
    FLME BCDEFGHIJKLMN 2 bright {A_Explode(5, 16);A_JumpIf(WaterLevel > 1,"Death");}
	TNT1 A 0 A_PlaySound("Flamethrower/Flame")
    FLME A 2 bright {A_Explode(6, 32);A_JumpIf(WaterLevel > 1,"Death");}
    FLME BCDEFGHIJKLMN 2 bright {A_Explode(5, 16);A_JumpIf(WaterLevel > 1,"Death");}
	TNT1 A 0 A_Jump(120,"Death")
	Loop
  Death:
	FLME MN 2 Bright
    Stop
  }
}
Last edited by Ahpiox on Mon Jul 30, 2018 6:42 am, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 26991
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How to make actor disappear in contact with water

Post by Enjay »

Just to check that what you seem to be trying to do is actually what you want to do. When you say " disappear in contact with water" what do you mean? Do you mean when the actor goes into deep water or do you just mean when it comes in contact with a water-looking floor.

If you mean with a true deep water sector, then checking waterlevel can help you out.

If you mean a floor that looks like water (like the default Doom liquids) but which are actually just normal floors with an animated watery-looking texture on them, waterlevel won't help because the actor can't go below the water.
User avatar
Ahpiox
Posts: 98
Joined: Fri Dec 22, 2017 1:52 am

Re: How to make actor disappear in contact with water

Post by Ahpiox »

Im talking about TERRAIN-lump liquid.
Post Reply

Return to “Scripting”