Duke4.net Forums: shells that don't disappear - Duke4.net Forums

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

shells that don't disappear

User is offline   11bush 

#1

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,
0

User is offline   RPD Guy 

#2

View Post11bush, 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.
1

User is online   Trooper Dan 

  • Duke Plus Developer

#3

Here, just paste this into GAME.CON at the bottom of the file.
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.
1

User is offline   11bush 

#4

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.
0

User is offline   11bush 

#5

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!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks are property of their respective owners. Instead of reading this text, you could be playing Ion Fury! ;) © 2019 Voidpoint, LLC

Enter your sign in name and password


Sign in options