There was a mod of JF Shadow Warrior I have been thinking of creating, a very overhauled mod. Editing the script files would be insufficient, but since the source code is available I can actually code in any of the changes I need... assuming I can actually code with any skill, which I kind of don't. I have failed enough programming classes to know how a lot of the basics work though, so I am feeling hopeful that I might be able to create the changes I need. Even still, I definately want some help.
If someone here is already familiar with the code, I'm asking you to tell me where in the code I can find the operations I need to alter, and what other functions are dependant upon them, etcetera. From there I can study the existing code and determine how things work, I think. If I have aditional questions I'll post them.
To start off with, let's talk weapons. Weapons.c is some 22,000 lines long and probobly doesn't include EVERYTHING that the weapons rely upon. I'll just want to start off with some general modifications of what is already there before I create something entirely new. So how can I tweak things such as firing rates, ammunition used, the bullet created, and the sound that's used? Equally important I need to know how to customize the sprites and animations used in the first person view. But in addition to this I want to add a melee attack. It could be technically considered as an alt fire, but with animation and weapon types that coinside with it being a melee attack. Alternatively it could be created from porting/modding Duke3D's "Quick Kick" but with modifications to have it check what weapon is being held and thusly modify the animation, timining, strength, and also forcefully stop normal weapon firing. But as it stands right now I know too little about the source to know what this would entail, only that it it possible.
So there we have it, that's the start of what I want to do. Please, can someone kindly tell me where the various commands are, and offer any advice on altering them?
ProAsm at
Re: Modding the game from the code
JFSW comes with a Custom.txt file in which you can do what you want regarding weapons, strengths, quantities and a host of other things. A shortcut would be to download XGroup which is a windows based .Grp grouping / extracting tool which also creates this Custom.txt file which you add with your mod. XGroup does the same for Duke3d. Goto my site and look for XGroup http://www.proasm.com
Marscaleb at
Well I saw in the release notes that I can alter things like dammage and ammocounts or names, basically everything that one could alter in the .con files in Duke Nukem (Never tried doing the same in SW, so I don't know if this couldn't be done back in the day) but I'm not looking to simply alter some superficial statistics. I would want the ability to create a whole new weapon. On top of that, I'm also trying to add in a whole new form of attack. I'm not looking just to modify the weapons already there, even if that's the process I use to create what I'm trying to do.
0xC0DE at
Nobody is going to study the code for you. That’s something you need to do on your own. And probably nobody is going to point it out for you either.
I’m not trying to be rude or discourage you, but “tell me where the various commands are, and offer any advice on altering them” is a ridiculous favor to ask. Since that would be 90% of your project. In fact it would be more work to explain ‘why and how’ things need to be changed then implementing them.
So you probably best of studying the code yourself, find out which functions are responsible for which actions,etc and come back when you have very specific code questions.
Marscaleb at
Seeing as how this forum appears to be visited by some folks who are very knowledgeable about the source code, and even the engine's creator (or someone doing a good job of pretending to be him, you never know on the internet,) I was supposing that there might be someone who already knew where I should be directed to. And since I was starting off with something, well, not uncommon to desire (apart from the melee attack) it is plausible that someone might have already assembled a tutorial about the processes. Even if not, I would think that there's a good chance someone else has tried making a new weapon, and would already be able to give me a heads up to a few things that grieved them when they did so.
And finding it is in no way only 70% of the work. Perhaps if I were making only slight changes that require only five lines to be revised, then that would be so, but creating a whole new weapon is too involved. Although I will admit, for something as involved as creating a weapon, it might be possible for someone who has not altered anything before to spend almost that much of their time simply trying to find the code that they are forgetting. I already suspect that manipulating a weapon would require working in many many different areas of the code. Not only are there the fundamental "mechanics" of firing the weapon, but also the ability to select the weapon, creating a weapon pick-up, creating the new bullets and so on.
Assuming someone already knows it, which I am, I do not think it is too much to ask for someone to say "in X.c there's X-function and it handles the ammunition, and don't forget to go to Y.c and define the variable to hold the ammo amount."
Awesoken at
..and even the engine's creator (or someone doing a good job of pretending to be him,
Calling me a fraud? Shame on you. I'm sorry, but I completely agree with what 0xCODE said. If you can't even find the code, one has to wonder what else you aren't willing to do.
Very few people are familiar with the weapons code from Shadow Warrior. One reason is because the source code was only released in 2005. Porting does not require a deep understanding of code, and I did not work on weapons code back in the day. Sorry, but you're on your own here.
ProAsm at
;D @ Ken.
Marscaleb, the first and obvious place to try would be weapons.c - its the biggest file there and if its weapon related, its in there :)
Marscaleb at
Darnn!
I'm sorry, but I completely agree with what 0xCODE said. If you can't even find the code, one has to wonder what else you aren't willing to do.
Alright, that's fair. But please don't confuse apathy with a general ineptitude. I may be willing to work, but well, I am also very poor at programming, and crap, they don't even teach code like this anymore (at least at my college.)
Thank you though; I do understand why you cannot help me.
Marscaleb at
In weapons.c, somewhere around line 15000 they start the initWeapon lines. I really can't figure out anything worthwhile, though, but I can certainly say that this code depends upon much more code elsewhere. The code is so full of commands built from other sections that I can barely identify even half of the syntax. There's truckloads of things that have been built out of just two letters, so I'm even more lost than normal. (nx = sp->x; ?!? WTF does that mean? daang = 64; ? I thought this was C!) The Uzi code is over 200 lines, and I thought it would be the simplest. Guess not. It looks like its just the data for the bullets themselves, and I don't know where to find all of the remaining calls to create. There's nothing in player.c, game.c, or jweapon.c and I don't know where else to look.
There is some code for an EMP (I don't remember that one, was it something that was cut from the game?) that looks like some good sample code to base a new weapon off of, but since I don't know what it does or how to make one in game, the fact that I can make heads or tails out of that one bit of code doesn't help me.
Altogether this is slightly worse than what I thought the situation would be before I asked anything. And that's it. That's all I can do. Everything else is simply beyond me, and I don't even know enough that I can experiment. (After several years of pretending to learn code I finally think I understand what OOP is, and this code doesn't utilize classes. What a bummer.)
Maaan, and I really wanted to make this too. I had so much fun with the Build engine in the past, and I just wanted to make something with it.
Awesoken at
If you're having trouble finding declarations, you probably are not using grep, or if you use a GUI, "Find in Files".
'sp' is a pointer to a SPRITE structure, which according to GAME.H, is an alias for spritetype, located in BUILD.H of the Build Engine code. If you're a mapper, you would recognize most of those fields if you've ever pressed Alt+Tab on a sprite (remapped to Ctrl+Tab in JonoF's).
'daang = 64;' is a temporary variable holding some angle in Build units. Build angles range from 0-2047.
Marscaleb at
Thank you, but the explanation of two specific words does not make up for the wealths of knowledge that I do not possess.
Y'know, pretty much all of the code I've dealt with in the past I have been able to comprehend by examining it and duplicating it, but it looks like I'm not ready for this.