modding Duke Nukem 3D weapons
#1 Posted 10 August 2016 - 02:19 PM
Can someone give me a tutorial, please?
This post has been edited by dukenukemforevernever: 11 August 2016 - 11:28 AM
#2 Posted 11 August 2016 - 09:25 AM
If you want to change the behavior and properties of weapons, then you do it by editing/adding CON scripting code in the game. There is information about that scripting language that can be found here, but it will be difficult for you to determine what aspects of scripting you need to focus on. That's why I would suggest looking at existing mods.
If you want to change the appearance of the weapons, then you need to understand how art tiles work in Duke 3D and how to replace them. Tiles can be edited, replaced, and new ones can be added. Models can also be added to be drawn in the place of defined art tiles. To add models, you should look at examples such as in the HRP.
It's hard, and there are many things you need to know. Making a good tutorial is hard, too, which is why they don't exist.
#3 Posted 11 August 2016 - 11:40 AM
I have seen a desert eagle in a Duke 3D mod, what files would I have to import from there to add to a non modded Duke 3D game?
After that I will have to place the desert eagle in the game to the location where it will be found, and place the ammo to locations they will be found, is that easy to do?
#4 Posted 11 August 2016 - 01:59 PM
#5 Posted 11 August 2016 - 02:06 PM
#6 Posted 11 August 2016 - 02:19 PM
Fox, on 11 August 2016 - 02:06 PM, said:
To be completely accurate, the weapons are hardcoded in EDuke32 as well, but using CON script it is possible to override all of the hardcoded weapon behavior.
#7 Posted 11 August 2016 - 02:26 PM
#9 Posted 11 August 2016 - 02:55 PM
dukenukemforevernever, on 11 August 2016 - 11:40 AM, said:
I downloaded Duke 3D, opened up GAME.CON and looked at the script. I could understand some of it from the context. I tried some edits to see how things worked. I looked at guides such as ones in the link I provided above. I asked a lot of questions, got some helpful answers, and made a lot of mistakes.
dukenukemforevernever, on 11 August 2016 - 11:40 AM, said:
That depends on a lot of factors. In general, you would need the art or model for the weapon (the model would be md3 and the art could be in various formats), then you may or may not need a .def file with commands for adding the art or model (you would not need a .def file if the weapon used 8-bit art in the original palette). You would also need code in the CON scripting language to add the weapon or change the behavior of the standard pistol. That file could potentially have any name ending in the .CON extension (but if the name is not GAME.CON or EDUKE.CON, then you would need to use a .bat or shortcut to tell the game to use the file). Finally, you would need the gun sounds, which could either replace the original pistol sounds with the same names, or they could have new names and be added to the game via CON script.
dukenukemforevernever, on 11 August 2016 - 11:40 AM, said:
If the desert eagle replaces Duke's standard pistol, then you don't need to place it or its ammo in maps, since the new pistol and its ammo would simply replace the standard sprites.
#10 Posted 11 August 2016 - 03:02 PM
Trooper Dan, on 11 August 2016 - 02:19 PM, said:
You can manipulate the kickback_pic to make a weapon from zero.
#11 Posted 11 August 2016 - 03:09 PM
Fox, on 11 August 2016 - 03:02 PM, said:
You can do a lot of things, but I don't understand how that relates to the post you were quoting (unless it's just an example of using CON to override hardcoded behavior).
#12 Posted 11 August 2016 - 03:20 PM
#13 Posted 11 August 2016 - 03:35 PM
Trooper Dan, on 11 August 2016 - 02:55 PM, said:
That starts to lose its effectiveness as members trickle away from the community over time. It's a slow process but on-going.
IMO more community members should start writing documentation. I myself have written the wiki's TROR mapping guide which has helped out a lot of people. I've also written a speed-mapping guide, and a guide to making good maps. I'm not sure if the latter two are hosted anywhere other than my google docs account though.
I've tried to get into scripting for eduke a few times over the years and just couldn't really get into it. It's not that I can't code; I'm a whiz with analytical languages such as fortran and R, but the current guides lack some of the extreme basics that they seem to assume you already know.
#14 Posted 11 August 2016 - 04:17 PM
Micky C, on 11 August 2016 - 03:35 PM, said:
I'm not sure what you mean. What I found when I was learning is that the "extreme basics" were covered, but there wasn't any one guide that took me by the hand and covered everything in the perfect order. A big part of the challenge in writing documentation is that the knowledge that a modder needs is divided into several different, related but disparate categories. In my experience, the most difficult aspect of modding Duke 3D is learning about all the quirky hardcoded behavior of the game engine and various actors and effectors. That's not something that is easily addressed in tutorials. Another challenge is that our scripting system has a very large number of primitives. This can be very handy, but it also makes it hard to document and potentially very confusing. Unlike Doom, Duke 3D had a scripting language when it shipped, and all of the additions since then have to be compatible with it, which of course leads to complications.
This is still a good document when it comes to learning how to script with the old commands (which still work): http://wiki.eduke32.com/wiki/Confaq42
If you have a good grasp of that, and then you look at wiki entries on how to use gamevars, events, and access struct members, then you can do pretty much anything. Potentially. But admittedly, it's not an efficient or user-friendly journey.
#16 Posted 12 August 2016 - 01:04 AM
dukenukemforevernever, on 10 August 2016 - 02:19 PM, said:
dukenukemforevernever, on 12 August 2016 - 12:38 AM, said:
I have a question for you. Do you actually have the art or model with animation ready to put into the game? If not, all the tutorials in the world won't get Duke his desert eagle. If you do, go ahead and post it -- you may be surprised at how much help you get.
#17 Posted 12 August 2016 - 12:24 PM
That's not true, to make the art I first have to know the requirements for it (e.g., how many frames are needed). Besides, learning how to add a weapon to the game is the hardest part, making the art is not a problem and will depend on how skilled I am at drawing.
This post has been edited by dukenukemforevernever: 12 August 2016 - 12:26 PM
#18 Posted 12 August 2016 - 04:44 PM
#19 Posted 12 August 2016 - 07:12 PM
#20 Posted 12 August 2016 - 08:21 PM
MusicallyInspired, on 12 August 2016 - 07:12 PM, said:
Yeah, I'm talking more about weapon behavior or coding.
#21 Posted 12 August 2016 - 09:29 PM
dukenukemforevernever, on 12 August 2016 - 12:24 PM, said:
That's not true, to make the art I first have to know the requirements for it (e.g., how many frames are needed). Besides, learning how to add a weapon to the game is the hardest part, making the art is not a problem and will depend on how skilled I am at drawing.
Difficulty is relative to skillset. To me, the coding seems very easy because I know how to do it and have coded many weapons for this game. But making new art is extremely difficult for me because I lack those skills.
I can show you exactly which art needs to be replaced. This album contains the original pistol tiles, all labeled for you:
http://imgur.com/a/zUvfi
I recommend producing tiles of the same proportions at a resolution of your choice (you could use the same scale or a higher scale). If you want to maintain compatibility with the classic 8-bit renderer, then you will need to use the Duke 3D color palette. If not, then you can use whatever colors you like. I recommend exporting the completed tiles in .png format. Note that you do not necessarily need to replace the clip tile, the hand tile or the hand holding clip tile -- it depends on whether you want your own desert eagle clip art.
This post has been edited by Trooper Dan: 12 August 2016 - 09:33 PM
#22 Posted 13 August 2016 - 07:08 AM
#23 Posted 13 August 2016 - 12:08 PM
MusicallyInspired, on 13 August 2016 - 07:08 AM, said:
Yeah, the coding will be easy. I would like to see some evidence that he is actually willing to make an effort before I spend any time writing code or a code tutorial, though.
@dukenukemforevernever: Keep in mind that you have the option of keeping the original number of frames (advantage: you can just swap them in to the same tile numbers and the pistol will work correctly), OR you can make more elaborate animations if you like (in that case code would need to be added to display the animations on different tile numbers, with correct timing, etc)
#24 Posted 13 August 2016 - 05:05 PM
http://wiki.eduke32....efined_gamevars
These WEAPONx_SOMETHING vars are what will get you most of the way there. Tweaking just a couple of the values for the pistol would do a good job of it. I won't say which though because you should read up on it! Between the art and the basic code it shouldn't really take long, actually!
When I was learning CON I did it completely by task. I started with a simple small task like "give an enemy more health" or "play different pickup sound effect" and by going one step at a time I was able to string together larger bits.
I used a version of this information (which I still have on my HDD):
http://wiki.eduke32.com/wiki/Confaq42
To learn EDuke I actually used some FAQ pages which don't exist anymore and had some incorrect information in retrospect, but still got me started. I have them on my HDD somewhere... However they don't render correctly in a modern browser. Maybe I should throw them at Hendricks.
#25 Posted 15 August 2016 - 11:33 AM
That's YOUR situation, not a beginner's situation. Modding requires a specific way to do it. For art you can just draw a poop and it wouldn't matter as long as you like it.
#26 Posted 15 August 2016 - 11:40 AM
#27 Posted 15 August 2016 - 12:09 PM
dukenukemforevernever, on 15 August 2016 - 11:33 AM, said:
That's YOUR situation, not a beginner's situation. Modding requires a specific way to do it. For art you can just draw a poop and it wouldn't matter as long as you like it.
Are you trying to start an argument? People have been providing helpful information, and you seem more interested in debating than actually making something. No one person has any special obligation to write tutorials. Anyone with the time and interest can gather the relevant information and do it.
#28 Posted 15 August 2016 - 12:32 PM
dukenukemforevernever, on 15 August 2016 - 11:33 AM, said:
That's the key isn't it.
No need to be snippy. No one's saying you should know how to do it just because others do. We're telling you it's not as hard as you think it is. That's all. Take Hendrick's advice and just experiment.
This post has been edited by MusicallyInspired: 15 August 2016 - 12:33 PM
#29 Posted 15 August 2016 - 08:21 PM
Hendricks266, on 15 August 2016 - 11:40 AM, said:
Thanks for this! Do I just put weapons.con in the directory? Or do I need to paste it into GAME.CON?