Duke4.net Forums: Scripting new weapons help - Duke4.net Forums

Jump to content

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

Scripting new weapons help  "Adding Shadow Warrior guns to the duke"

User is offline   Yellow 

#1

Hey everyone, I was wondering if anyone has any advice for starting to work on adding new weapons into duke3d, I've spent about 30 hours in the past two days diving through the CON files and recreating some of blood enemies and I think its time to start working on some guns.
I have the weapons.samples.con file, I'm just not sure what a good jumping off point would be.

Thanks in advanced.
You guys rock, yellow.
0

User is offline   jimbob 

#2

start with small things, adjust the firing speed, amount of bullets it has. add a reload function by playing with the various vars and then work from there. there are good tutorials on https://wiki.eduke32.../wiki/Tutorials
look at various mods and see how they achieved things. unfortunatly its not really straightforward, but its not rocket science either.
0

User is offline   Yellow 

#3

Thank you for the reply. I've edited the pistol with several vars and found some success with that.

I did download a custom weapons pack and tear into it.
Your correct its not rocket science but its definitely intimidating.
0

User is offline   eniojr 

#4

Quote

Your correct its not rocket science but its definitely intimidating.

Yes, dealing with CON scripts is intimidating when dealing with more complex things, such as adding weapons and adding new sector effects, or even complex actors.

I had problems with weapons.samples.con.

The Legacy Edition uses it. I tried adding secondary fire to weapons that didn't have it, but this ended up interfering with the primary weapons. That was one of the reasons I gave up on using that file as a base for creating weapons. I started about 2 years ago making a mod using Legacy as a base, but then I had problems and migrated to other mods. I started just making maps, but then I wanted to add different gameplay features, more textures, sounds, enemies, etc.

I'm now making a mod based on a partial fusion between Dukeplus and Kickass, to which I will later add several things I had added for the Legacy Edition, although I'm no longer working with the latter as a base. The first stage of development was with Legacy. The second stage (current), a fusion of Dukeplus and Kickass. The third stage will be adding many things I made myself for Legacy to Kickass-Dukeplus, including a few pieces of content from AA, Naferia, Legacy, etc. The fourth and final stage will be the development of the levels and episodes, but that will still take time. Not until I finish all the coding. At most, a test map.

I chose Dukeplus because of several effects that change the classic gameplay, as well as altered enemy behavior, such as infighting. I chose Kickass because of the weapons and items. Since I'm still learning how to modify and script CON, I don't yet know how to add new weapons and inventory items from scratch, so I had to use items and weapons from existing mods. Adding weapons requires several steps, such as creating states and adding lines to events. I realized there's a whole undocumented step-by-step process for this... This step-by-step isn't in the documentation, but here's a tip...

The weapons and ammunition (actors), states for drawing weapons on the screen, events (select, shoot, reset, switch, numbered slots, etc.), and in a way that is compatible with the classic game's weapon system. Furthermore, variables to distinguish primary from secondary weapons, primary and secondary fire, etc. It's also necessary to create new projectiles and enemy lines so they react appropriately to the created projectile, in addition to new textures and sounds.

I've already tried adding weapons based on the Dukeplus code, but that mod uses a mix of sprite weapons and models, plus weapon replacement, and that confused me more than it helped. Besides, those codes don't seem well-structured, so in this fusion of Dukeplus and Kickass, I eliminated most of the weapon-related code, replacing it with Kickass code (Kickass's weapon system is far superior).

In fact, Kickass's weapon system is the best of all the mods! It may seem harder to read (due to the use of many variables), but at least it seems more organized and easier to place state and event scripts close together in a CON file (which I did). Also, compared to weapons.samples.con, it seems to have less redundancy. I don't intend to use interchangeable weapons in my mod, nor models. Kickass has a weapon replacement system based on the episode and stage, but I removed it because I don't intend to use that feature. This will give me more freedom when planning my maps. And because I'm not a big fan of that type of feature. One thing I noticed is that it seems Kickass was made based on Dukeplus, so there's some compatibility between the two. Many lines of code show this.

Much more compatibility than what I did using Legacy as a base.

A Kickass with Dukeplus effects, since I used Kickass as a base, not Dukeplus. I tried the opposite first (using Dukeplus as a base and adding things from Kickass), but this way worked better. So much so that most of the Dukeplus effects already work as they should, just as I did for Legacy. Besides, I managed to create new simple sector effects. But using the Kickass code, which seems more organized and advanced in structure, I could try to create new weapons based on existing ones. I'll even see if I can put the Dukeplus Gravitygun into Kickass, since I've already managed to add the object-picking and throwing effect to Kickass, which is a game changer. Not as a replacement weapon for the expander, but as a new and independent one. And if possible, see if I can add Dukemon as well. I also plan to add melee weapons, like a chainsaw (even though Kickass already has a freezer weapon mode like that). I'll see what I can do.

I'm not making a sequel to Dukeplus or Kickass (especially since Kickass is still in slow development), but a crazy alternate version of the two merged into one, plus the things I've done myself. It's not exactly a mod, but a combination of mods. This was necessary because in Doom you can combine mods by loading files, which isn't possible in Duke Nukem 3D, where you would have to manually modify those mods, which is what I did.

Maybe you should try the Kickass weapon system to test, if you have problems with weapons.samples.con... ;)

It looks promising. :D

This post has been edited by eniojr: 07 December 2025 - 12:21 PM

0

User is offline   brullov 

  • Senior Artist at TGK

#5

weapons.samples.con is the cleanest and easiest code to follow. It is well written and properly optimized. Tinkering with other projects is not a good idea, as they are likely structured and implemented differently. If you struggle to understand this file, that is a skill issue. You need to learn basic programming first. Come back later. Still struggling? Repeat this step until you are no longer confused.


1

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