Quantcast
Channel: ZDoom
Viewing all articles
Browse latest Browse all 3391

Scripting • [ZScript] Making a bulletpuff class spawn a bullethole on ceiling / floor

$
0
0
Hello!

Much like the title says, I am trying to make a bulletpuff class that can spawn bullet holes on the floor & ceiling when they're shot at, so far I have managed to make it "kinda" work but it seems very random and I cannot really figure out why.

[imgur]https://imgur.com/a/zdoom-forum-gif-eP7B0hg[/imgur]

What I have done is make a new bulletpuff, make it replace the original one and from there, made the following coding in order to try to spawn the bullet hole:

Code:

Spawn:TNT1 A 0;TNT1 A 0;PUFF A 2 bright;PUFF B 2 bright A_CheckCeiling("HitCeiling"); // Before trying another approach, I had both A_CheckCeiling and A_CheckFloor in the Spawn state.TNT1 A 0 A_SpawnDebris("Debris_Spark");PUFF CD 1 bright A_SetTranslucent(0.25,1);Death:TNT1 A 0;TNT1 A 0 A_CheckFloor("HitFloor"); // I decided to try and see if adding a death state would make any difference, as if, make it more consistent but doesn't seem to be the case.TNT1 A 0;Stop;HitFloor:            TNT1 A 0 A_StartSound("DSTINK"); // Added this part simply to get some audio feedback to know if the bullet hole appeared successfully but... This doesn't exactly work either lol.TNT1 A 0 A_SpawnDebris("Debris_Spark");            TNT1 A 0 A_SpawnItemEx("ZFloorHole",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE); // "ZFloorHole" is self-explanatory, but this is what makes the bullet hole spawn making usage of a md3 model.            Stop;                        HitCeiling: // Shameless copy-paste work here...            TNT1 A 0 A_StartSound("DSTINK");TNT1 A 0 A_SpawnDebris("Debris_Spark");            TNT1 A 0 A_SpawnItemEx("ZCeilingHole",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_CLIENTSIDE); // Same thing as ZFloorHole, makes use of the mentioned md3 model and ThrustThingZ to make it stay in the ceiling.            Stop;
I am honestly kinda lost here, because I don't really know how to pinpoint what's causing the issue here, or if it happened to be something with the engine, but I massively doubt that since I've seen this effect before in other mods, both GZDoom and Zandronum, so I really think it's something with my coding, perhaps the MD3 model?

Any kind of help and directions towards the right direction would be massively appreciated, this issue isn't something that makes my project straight up unplayable but it's something that I'd like to resolve if it's possible to do so!

If needed, I can provide more of my (messy) coding in order to help, thank you very much and I appreciate anyone taking their time to read this, have a good one!

Statistics: Posted by Bunnelby64 — Wed Mar 26, 2025 4:44 pm



Viewing all articles
Browse latest Browse all 3391

Trending Articles