Duke4.net Forums: DNF Modding Discoveries - 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

DNF Modding Discoveries  "Posting my findings on DNF"

User is online   Futuretime23 

  • 12


So I decided to post some of the findings I made while modding DNF. Some of these aren't new though, but are worth mentioning again.

First off, Noesis is a godsend. This is a key tool for any and all DNF modding (the other being a hex editor)

How to do engine/dngame gameplay mods:

In order to get some gameplay mods going, what I did was extract megapackage.dat and copy dngame.u and engine.u to the system folder of DNF. Any mods you make to these scripts will override the scripts in megapackage.dat This works on ALL versions of DNF as far as I know.

I keep a downgraded copy of DNF to have access to the SOS console which helps out a lot for doing this. For example, say I want to make Duke walk fast, I go to engine.u and replace the three 260 floats with say 390. (2 of the floats are for single player, namely one is for a level load and one's for a checkpoint load. the third I believe is for MP Duke as he has different variables than SP Duke)

You can make the ego regen disable mod also permanent in this way (I need to find the variables for the recovery rate again though) as well as other mods. It's possible to read the .u scripts with the unreal tournament packaging tool, just be prepared to see a lot of unknownfunctions show up.

How to get past the weapon limit:

This doubles as an explanation as to how the weapon limit works in DNF.
The guns, items, pipe/trip and the fists in DNF have a bIsPrimaryWeapon property. By default, items, pipe bombs, tripmines and the fists have this set to false while the guns all have them set to true. This places the guns in the limit, i.e, PrimaryWeapon1: RPG, PrimaryWeapon2: Machinegun, etc.

In order to get past the weapon limit, you need to set each gun's bIsPrimaryWeapon property to false. Unfortunately I haven't been able to do this via dngame.u (where all of the guns and their scripts are located) because ATM it's unknown what byte handles this property.
An alternative way consists of doing it via set commands, for example, set rpg bisprimaryweapon false. On 1.00 and 1.01 with SOS console this is fairly easy, but it can be a pain in 1.03 since you need to edit the user.ini and bind this command, which for some godforsaken reason, keeps resetting randomly. Fortunately there's a way around this by editing your inputs in 1.00 with the sos console and then copying that user.ini to 1.03. It seems to work so far.

What are the issues with this mod?

Unfortunately, you can't use the mouse wheel to cycle thru your guns as the SwapWeaponsDown and Up command don't work well by using this old weapon select logic. You need to use keybindings to select each gun. For example 1=useweapon dngame.pistol_gold and so on.
Also, because of how the weapon wheel for controllers work, I don't believe the weapon limit mod works with it since the logic for that specifically points towards PrimaryWeapons. Speaking of which, another issue I've encountered is that infinite ammo boxes no longer give ammo. This is because it's programmed to give ammo to your current PrimaryWeapons. And also, the first gun pickup will only give you the ammo on the current clip, but not other pickups of the same gun. No clue why, maybe it's a glitch or it's an old piece of leftover code back when initial pickups weren't meant to give you full ammo?

Another thing, but this is relating to how the weapon limit bypass mod is working for now, is that occassionally some guns may reset back to their default true setting for the bisprimaryweapon property. Press the bind to reenable that and reload the checkpoint if the guns disappeared entirely. Typically, if this happens, the guns just drop on the floor and you can pick em up again with what ammo they originally had.

For the record, I have not tried this in MP (each gun has a MP counterpart) or the DLC. Only in the SP campaign.

I'll probably either edit this post later or make a new one and put some other findings I made (like replacing enemies/pickups/npcs in maps, or editing specific variables for enemies, weapons, items, etc)

User is offline   zwieback 

  • 76


very cool stuff! keep up the good work :)

"Some people are “for” things. They are for Freedom, or for technical superiority, or for a sports team, or whatever. Some people are “against” things. They are against political candidates, or Games, or people from certain places, or whatever. Some people define themselves on the basis of what they want, others on the basis of what they do not want."

User is online   Futuretime23 

  • 12


So here's a classic style gameplay mod for DNF.
Attached File  DNF Classic style gameplay v0,1.rar (1.29MB)
Number of downloads: 10
Installation is as follows: extract the engine.u and dngame.u files in DNF's system folder, while in order to disable the weapon limit, you need to grab one of the user.ini files depending on which mode you are gonna play (multiplayer or single player)
and replace your user.ini file in Steam/userdata/"PlayerID"/57900/remote with the one you selected.
To get the user.ini to save permanently, I believe you have to (please correct me if wrong) launch dnf first, replace your user ini while dnf is running, set it to read only, then quit the game.
The Engine.u and dngame.u mods are the following: no ego or health regen, faster movement (walk speed has gone from 260 to 390. Duke walks faster than he can sprint. Jump speed has gone from 280 in sp and 330 in mp to 420 in both)

In order to disable the weapon limit, press X on the keyboard. Keys have been rebinded (items are on the F1-F3 keys, pipe bomb is g and trip mine is q)
Occasionally it will forget you set each gun to not be a primary weapon, so if that happens, press X again and reload a checkpoint.
The gun bindings are as follows: 1 is gold pistol, 2 is shotgun, 3 is machinegun, 4 is at laser, 5 is at captain laser, 6 is rpg, 7 is railgun, 8 is shrink ray, 9 is devastator, 0 is freeze ray and backspace is enforcer gun.

I haven't added any of the DLC guns yet and I haven't tested the MP version of the weapon limit disabler in a real match (I'd assume the host and the players would have to have the same user.ini config? idk)

Have fun! I'll do an updated version some day so you don't need to rely on hitting X to disable the weapon limit, but until then, stay tuned I guess lol

User is offline   Mark Charles 

  • 60


Didn't know any of this was possible, but great job there

User is offline   fuegerstef 

  • 598


Great work. :)

A few free casual games by me: http://gamejolt.com/...uegerstef/2615/

User is online   Futuretime23 

  • 12


So, the old save system STILL exists in DNF, to an extent.
On your downgraded copy (or via key bindings I assume, in 1.03. Haven't tested it there yet though) open up the sos console and type save_mode 0
then type savegame. Next time you load your savefile, you'll go back to your last save.
This still functions even when you die, or quit to main menu. If you quit the game, you need to switch back to the old save_mode before you can reload your save. 1 save slot only it seems.

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 Maiden! ;) © 2018 Voidpoint, LLC

Enter your sign in name and password

Sign in options