Duke4.net Forums: Editing Weapon Stats in DK3D - Duke4.net Forums

Jump to content

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

Editing Weapon Stats in DK3D

#1

Hello everyone. I have a few questions regarding weapons in Duke Nukem 3D. I haven't been able to find these in the game's code, but I know they must be buried in there somewhere.

1.) How do I access factors like:
- Number of shots before the pistol reloads
- Number of projectiles fired
- Bullet Spread
- The speed of rockets, freezer blasts, etc
- The fading to black of the microwave expander as it pulsates and other non art-related effects
- Change the projectile that a weapon shoots. For instance, make the pistol shoot rockets or make the might foot a ranged attack?
- The physics of pipe bombs

2.) Is it possible to create new weapons for Duke Nukem 3D? For instance, could I make a clone of the pistol and go from there?

I hate to bother you with these questions, but I haven't been able to come up with much on my own. I figured I might as well ask some people who really know what they're doing. If this has already been covered, just send me the link and I'll check it out. Thanks in advance. :D
0

User is offline   Danukem 

  • Duke Plus Developer

#2

This will not make much sense to you, but here: http://wiki.eduke32....efined_gamevars

Changing those variables will allow you to accomplish about half of the things on your list. The other half would require adding new code for certain game events, and for projectile definitions.
0

#3

Thanks. I'll see what I can understand from that.
0

User is offline   Danukem 

  • Duke Plus Developer

#4

 scandalousrucksack, on 11 February 2012 - 09:58 PM, said:

Thanks. I'll see what I can understand from that.


I'll give you a few more hints, because you seem like you are serious. When you said you looked through the game's code, I'm assuming you mean the CON files (GAME.CON etc). You won't find any code pertaining to the player's weapons in there. That's because those old CON files from 1996 used the original scripting system, which did not allow direct manipulation of the weapons. It was possible to modify the behavior of certain weapons indirectly by adding code to certain actors (EXPLOSION2, for example) but it was not pretty.

Nowadays, the scripting system allows you to change just about anything in the game in a fairly straightforward way. For example, if you want to make the pistol shoot trooper lasers, then you could do it by adding this line of code in one of the CON files (at the end of USER.CON, perhaps):

gamevar WEAPON1_SHOOTS FIRELASER 1
0

User is offline   Micky C 

  • Honored Donor

#5

Does the weapons.con.sample have any relevance here?
0

#6

Thanks, DeeperThought. I got it working now. :D

Right now I'm looking at turning the freezer into a light machine gun or something like that.
0

User is offline   Danukem 

  • Duke Plus Developer

#7

 Micky C, on 11 February 2012 - 10:21 PM, said:

Does the weapons.con.sample have any relevance here?


Do you mean the enhance.con.sample file that comes with EDuke32? Not really. If you change the name of it to weapons.con or something appropriate, then have it be included by GAME.CON, then it could be somewhat useful, but only because it re-declares all the weapon variables so you can easily see what they are. The declarations it contains are totally redundant and pointless. I would start by commenting out the entire file, then uncommenting only those declarations where I wanted to change the initial value.
0

User is offline   Jimmy 

  • Let's go Brandon!

#8

 DeeperThought, on 11 February 2012 - 10:17 PM, said:

I'll give you a few more hints, because you seem like you are serious. When you said you looked through the game's code, I'm assuming you mean the CON files (GAME.CON etc). You won't find any code pertaining to the player's weapons in there. That's because those old CON files from 1996 used the original scripting system, which did not allow direct manipulation of the weapons. It was possible to modify the behavior of certain weapons indirectly by adding code to certain actors (EXPLOSION2, for example) but it was not pretty.

I remember hacking the Freezer into a really ghetto chainsaw back in the day. So glad we don't have to fumble around in the dark anymore, hahaha.
0

User is offline   Micky C 

  • Honored Donor

#9

 DeeperThought, on 11 February 2012 - 10:30 PM, said:

Do you mean the enhance.con.sample file that comes with EDuke32?


No, there's a more recent file Hendricks had something to do with called weapons.con.sample that I think he said had something to do with changing some properties of some of the weapons but my memory's a bit hazy there.
0

User is offline   Danukem 

  • Duke Plus Developer

#10

 Micky C, on 11 February 2012 - 11:10 PM, said:

No, there's a more recent file Hendricks had something to do with called weapons.con.sample that I think he said had something to do with changing some properties of some of the weapons but my memory's a bit hazy there.


What you are remembering is a script that replicates all of the hardcoded weapon characteristics in CON, not just the gamevars. That's very useful, because it means, for example, that you can easily manipulate the way that the weapon is displayed. That would indeed be a good base to start from.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #11

Weapons.con.sample contains all of the weapon HUD drawing code and only the weapon HUD drawing code.
0

User is offline   Danukem 

  • Duke Plus Developer

#12

 Hendricks266, on 12 February 2012 - 03:20 AM, said:

Weapons.con.sample contains all of the weapon HUD drawing code and only the weapon HUD drawing code.


So where is it? It's not on your web site and I can't find a thread for it.

EDIT: nvm found it http://eduke32.svn.s...pons.con.sample
0

User is offline   Hendricks266 

  • Weaponized Autism

  #13

It's in the samples directory included with every synthesis build. As a general rule files with .sample on the end are found there, if I ever make any more.

This post has been edited by Hendricks266: 12 February 2012 - 01:07 PM

0

#14

Hello again. I'm having an issue but I don't think it is worth starting a new thread.

I redid the explosion as .pngs using eduke's texture capabilities. There is one problem, the cloud no longer rises up. All of the animations play out nicely, but as the explosion cloud gets smaller, it stays in the same place. The DEF Language article at EDukeWiki doesn't seem to clarify what to do in this instance.

Thanks.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #15

It's hard to say specifically what to do. In general, if you keep each texture an exact scalar multiple of its original dimensions of its 8-bit tile, and properly replicate the positioning of your artwork within that frame, it should work just fine.

It sounds like you just made some new explosions and added them to the game, with the result of course not being what is expected.
0

#16

Quote

It's hard to say specifically what to do. In general, if you keep each texture an exact scalar multiple of its original dimensions of its 8-bit tile, and properly replicate the positioning of your artwork within that frame, it should work just fine.

It sounds like you just made some new explosions and added them to the game, with the result of course not being what is expected.


They are all exact scalar multiples. What do you mean exactly by "positioning of your artwork within that frame"? All of the files are directly modified from the originals. I've noticed that in DukeRes (an art viewing utility) the y-offset and x-offset change repeatedly within the animation (as well the speed that the sprite goes by). I know that this is what I need to access in order to fix my problem.

I think I need to use the setuptile def language.

This post has been edited by scandalousrucksack: 15 February 2012 - 07:33 PM

0

#17

The problem's been resolved. Sorry to waste your time.
0

Share this topic:


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


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options