adasiok Posted April 23, 2023 (edited) 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 April 23, 2023 by adasiok 0 Quote Share this post Link to post
1 HorseJockey Posted April 23, 2023 (edited) 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 April 23, 2023 by HorseJockey 0 Quote Share this post Link to post
0 SOF2Fragger Posted April 23, 2023 (edited) 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 April 23, 2023 by SOF2Fragger 0 Quote Share this post Link to post
0 adasiok Posted April 24, 2023 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 0 Quote Share this post Link to post
0 HorseJockey Posted April 25, 2023 (edited) 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 April 25, 2023 by HorseJockey 0 Quote Share this post Link to post
0 adasiok Posted April 25, 2023 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. 0 Quote Share this post Link to post
0 HorseJockey Posted April 25, 2023 What source port are you making this for? 0 Quote Share this post Link to post
0 adasiok Posted April 26, 2023 18 hours ago, HorseJockey said: What source port are you making this for? GZDoom 0 Quote Share this post Link to post
0 HorseJockey Posted April 26, 2023 (edited) 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 April 26, 2023 by HorseJockey 0 Quote Share this post Link to post
0 adasiok Posted April 26, 2023 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 0 Quote Share this post Link to post
0 HorseJockey Posted April 26, 2023 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. 0 Quote Share this post Link to post
Question
adasiok
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 adasiokShare this post
Link to post
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.