Jump to content
  • 0

Breaking Ice?


adasiok

Question

Hello (again)!

 

In my mod the ice is pretty immortal which is unrealistic. What i would like to create is: after a grenade explosion on the ice, a cracked ice decal should summon in the place. How can I do it?

Edited by adasiok

Share this post


Link to post

10 answers to this question

Recommended Posts

  • 1

https://zdoom.org/wiki/A_CheckFloor

 

Edit: Should have also mentioned that you will need to set up a decal and DECALDEF for the floor ice cracks as the engine doesn't apply decals to floor or ceiling flats. These are the states from a projectile that one of my enemies throw, when it hits the floor or ceiling it spawns a decal named "ink splat"

States
	{
		Spawn:
			BALL A 1;
			BALL A 1 ThrustThingZ (0, 6, 0, 1);
			Goto Flight;
		Flight:
			BALL A 1;
			Loop;
		Death:
			TNT1 A 1 A_CheckFloor ("FloorDeath");
			TNT1 A 1 A_CheckCeiling ("FloorDeath");
			Stop;
		FloorDeath:
			TNT1 A 1 A_SpawnItemEx ("InkSplat", 0.0, 0.0, 0.0);
			Stop;
		XDeath:
			TNT1 A 5;
			Stop;
		Crash:
			TNT1 A 1;
			Stop;
	}

 

Edited by HorseJockey

Share this post


Link to post
  • 0

You can use UDB to create models to use as "sprites" in floors and ceilings.

Make the crack an actor and spawn it on the explosion

Edited by SOF2Fragger

Share this post


Link to post
  • 0

No no no, I think you got me wrong. I want the decal to be spawned but ONLY on the ice, not in any other texture than ICE

Share this post


Link to post
  • 0

If you only want it to spawn on your ice texture you could set up that texture as a specific terrain type and use GetFloorTerrain() in the grenades death state to check for what type of terrain it is on. If it's on ice you would spawn the crack decal/model/sprite, if not they you could spawn a scorch mark.

 

Edit: I'm assuming you are using Zscript for your mod?

Edited by HorseJockey

Share this post


Link to post
  • 0
14 hours ago, HorseJockey said:

If you only want it to spawn on your ice texture you could set up that texture as a specific terrain type and use GetFloorTerrain() in the grenades death state to check for what type of terrain it is on. If it's on ice you would spawn the crack decal/model/sprite, if not they you could spawn a scorch mark.

 

Edit: I'm assuming you are using Zscript for your mod?

DECORATE.

Share this post


Link to post
  • 0

Ok, so you can use Zscript which is going to be the easiest way. Otherwise I think you would have to use a combination of ACS CheckFloortexture and Decorate. Can you post your grenade's decorate code? You can either make a function that checks floor terrain on projectile death or you can make an annonymous function something like this 

Death:
	TNT1 A 1 A_CheckFloor ("FloorDeath");
	TNT1 A 1 A_CheckCeiling ("FloorDeath");
	Stop;
FloorDeath:
	TNT1 A 0
	{
		if (GetFloorTerrain() == "YourIceTerrain")
		{
			SpawnItemEx()//you would fill this in with the postition you want to decal to spawn and decal
		}
		else
		{
			//do something else on differnt terrain
		}
	}
	Stop;

GetFloorTerrain() info

A_CheckFloor info

TERRAIN info

Edited by HorseJockey

Share this post


Link to post
  • 0
41 minutes ago, HorseJockey said:

Ok, so you can use Zscript which is going to be the easiest way. Otherwise I think you would have to use a combination of ACS CheckFloortexture and Decorate. Can you post your grenade's decorate code? You can either make a function that checks floor terrain on projectile death or you can make an annonymous function something like this 


Death:
	TNT1 A 1 A_CheckFloor ("FloorDeath");
	TNT1 A 1 A_CheckCeiling ("FloorDeath");
	Stop;
FloorDeath:
	TNT1 A 0
	{
		if (GetFloorTerrain() == "YourIceTerrain")
		{
			SpawnItemEx()//you would fill this in with the postition you want to decal to spawn and decal
		}
		else
		{
			//do something else on differnt terrain
		}
	}
	Stop;

GetFloorTerrain() info

A_CheckFloor info

TERRAIN info

Hmm, I'm not so happy about the use of ZScript, i prefer working in Decorate. I will think of it, then I will post the code if i will need it

Share this post


Link to post
  • 0

Good luck. Maybe someone else has an elegant solution utilizing ACS and Decorate that can post a solution. I'm just not familiar with any functions that would allow you to check floor texture or terrain in Decorate.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...