I'm just trying to figure out how to spawn a shell sprite on the ground when the spent casing lands. any help would be appreciated,
Page 1 of 1
shells that don't disappear
#1 Posted 30 September 2019 - 07:53 PM
#2 Posted 01 October 2019 - 03:16 AM
11bush, on 30 September 2019 - 07:53 PM, said:
I'm just trying to figure out how to spawn a shell sprite on the ground when the spent casing lands. any help would be appreciated,
Well, you can just check when the default game's shells spawn (at EVENT_EGS), killit and then spawn your own shell.
onevent EVENT_EGS { switch sprite[THISACTOR].picnum case SHOTGUNSHELL <spawn here> break case SHELL <spawn here> break endswitch endevent
To spawn your own shell, I believe you can SHOOT a projectile.
#3 Posted 01 October 2019 - 03:48 AM
Here, just paste this into GAME.CON at the bottom of the file.
You can add a sound in the block of code that changes the statnum and such. It uses the default movement, and shells will be deleted before hitting the ground if they bump into something first. Making them flat (cstat 32) is something I started doing a while back and it's a great for a small sprite on the ground because it allows for different angles.
var VAR1 0 0 appendevent EVENT_GAME switch sprite[].picnum case SHELL case SHOTGUNSHELL getflorzofslope sprite[].sectnum sprite[].x sprite[].y VAR1 sub VAR1 sprite[].z ifl VAR1 512 ifg sprite[].statnum 2 { changespritestat THISACTOR 1 cstat 32 rand VAR1 256 sub VAR1 128 add VAR1 sprite[].ang seta[].ang VAR1 fall } break endswitch endevent
You can add a sound in the block of code that changes the statnum and such. It uses the default movement, and shells will be deleted before hitting the ground if they bump into something first. Making them flat (cstat 32) is something I started doing a while back and it's a great for a small sprite on the ground because it allows for different angles.
#4 Posted 01 October 2019 - 05:25 AM
Thanks alot for the help, but for some reason I can't get it to work. maybe I just don't know what the hell I'm doing.
#5 Posted 01 October 2019 - 05:49 AM
Nm it works perfectly. I was trying to add it to the platoon mod as I am working on replacing all the weapons for that. I tried it in the original Duke and it works great. Thanks again!
#6 Posted 24 May 2022 - 02:45 PM
RPD Guy, on 01 October 2019 - 03:16 AM, said:
Well, you can just check when the default game's shells spawn (at EVENT_EGS), killit and then spawn your own shell.
To spawn your own shell, I believe you can SHOOT a projectile.
onevent EVENT_EGS { switch sprite[THISACTOR].picnum case SHOTGUNSHELL <spawn here> break case SHELL <spawn here> break endswitch endevent
To spawn your own shell, I believe you can SHOOT a projectile.
It's been a long time, but back there I wasn't so experient at CON coding. (Actually I'm still learning )
This is my reparation with the community for teaching bad things.
You shouldn't kill any actor during EVENT_EGS. Use EVENT_GAME instead (as Danuken said right after me).
Share this topic:
Page 1 of 1