Altering the damage values of weapons (SP)

Discussions about modding, questions, mod requests or just show off what you're working on.
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Altering the damage values of weapons (SP)

Post by imrightyourleft »

HI,

Could anyone help me with this?

How would I go about altering the amount of damage each weapon does in the game?

For example, say I want to make the bryar pistol more damaging or the bowcaster less damaging?

I've looked in weapon.dat but I can't seem to see anything to do with damage values.

I'd appreciate so much if someone could help me with this.

Thanks.
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

I think this is only changed through the source code, since my edits there didn't require any updating in weapons.dat.

We intend to put out some guides, links etc on how to get started with source modding and more, but in the meanwhile (unless you're familiar with compiling), the values can easily be edited by opening g_weapon.c in the source code and changing the defines in the top. Someone else would have to answer whether this changes the SP part as well, not just MP. Then it needs to be compiled through a .bat file.

I'll see if I can make some time for a little guide like this either on Tuesday or Thursday, perhaps.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: Altering the damage values of weapons (SP)

Post by Tr!Force »

the only way to modify damages is via code, in the source code for SP, file g_weapon.cpp u can found all the weapon damages (for the player and bots weapons), something like:

Code: Select all

// Bryar Pistol
//--------
#define BRYAR_PISTOL_VEL			1800
#define BRYAR_PISTOL_DAMAGE			14
#define BRYAR_CHARGE_UNIT			200.0f	// bryar charging gives us one more unit every 200ms--if you change this, you'll have to do the same in bg_pmove

// E11 Blaster
//---------
#define BLASTER_MAIN_SPREAD			0.5f
#define BLASTER_ALT_SPREAD			1.5f
#define BLASTER_NPC_SPREAD			0.5f
#define BLASTER_VELOCITY			2300
#define BLASTER_NPC_VEL_CUT			0.5f
#define BLASTER_NPC_HARD_VEL_CUT	0.7f
#define BLASTER_DAMAGE				20
#define	BLASTER_NPC_DAMAGE_EASY		6
#define	BLASTER_NPC_DAMAGE_NORMAL	12 // 14
#define	BLASTER_NPC_DAMAGE_HARD		16 // 18
etc...

and correction to @boothand, is g_weapon.CPP not .C hee, and there is no .bat files to generate "QVM's", because SP uses only jk2gamex86.dll and jk2mp.exe, so u need compile with visual studio only to generate them :D

an easy way to make it customizable is creating a cvar for it, like:

Code: Select all

#define BRYAR_PISTOL_DAMAGE			g_bryar_pistol_damage.integer //original value 14
so u can manage via the "g_bryar_pistol_damage" ingame

so, if u want edit them (or make it customizable) u need generate ur own files.
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

Ah, I guess I only have the multiplayer source. Will look into it!
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

[Topic moved to Modding discusson]
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Altering the damage values of weapons (SP)

Post by ouned »

If I remember correctly, there is a tutorial in the original jk2 source which explains exactly that.
User avatar
Kazuka
Moderator
Posts: 260
Joined: 10 Aug 2015, 20:30

Re: Altering the damage values of weapons (SP)

Post by Kazuka »

ouned wrote:If I remember correctly, there is a tutorial in the original jk2 source which explains exactly that.
Yep, in this tutorial/example they changed the rocket velocity.
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

Was that for singleplayer though? Can't seem to find this in my Tools folder, but I remember such a guide.
Kevin
Administrator
Posts: 393
Joined: 07 Jun 2015, 08:36

Re: Altering the damage values of weapons (SP)

Post by Kevin »

Boothand wrote:Was that for singleplayer though? Can't seem to find this in my Tools folder, but I remember such a guide.
No, but the concept is the same :)
User avatar
Kazuka
Moderator
Posts: 260
Joined: 10 Aug 2015, 20:30

Re: Altering the damage values of weapons (SP)

Post by Kazuka »

The example I was talking about is located here:

code/MakeAMod_readme.txt.

This example was for the multiplayer part.
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

Thank you so much for the responses and discussions to this.

Your replies have fulfilled my worst fears though - editing the source code etc. which I'm not confident in doing. Indeed I would greatly appreciate if boothand or anyone could compile me a short step by step guide on how to do this - just for single player though.

Thanks again.
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

Okay so I've got the JK2 source code, and I've found the g_weapon.cpp file.

If I change the damage values of the weapons to my liking, my question is how do I then implement those changes in to the SP game? In which folder of the GameData itself do I save the source code alterations for my changes to take effect?
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: Altering the damage values of weapons (SP)

Post by Tr!Force »

imrightyourleft wrote:Okay so I've got the JK2 source code, and I've found the g_weapon.cpp file.

If I change the damage values of the weapons to my liking, my question is how do I then implement those changes in to the SP game? In which folder of the GameData itself do I save the source code alterations for my changes to take effect?
i recommend u to use OpenJK for jk2 SP, i will try, if works, i will make a tutorial for u :P

i DONT recomend u to use original JK2 SP source, because u will get lot of problems to compile the final files, ive tried yet, and the only way for me was running a windowsXP machine with visual c++6 (really old). u need to understand (in basic words) the whole jk2 SP source is like the jk2sp.exe unpacked, u need "compile" to get the jk2sp.exe modified and ready to test.

openJK one's already have a lot of improvements specially in jk2 sp code.
Last edited by Tr!Force on 19 Jan 2016, 16:27, edited 1 time in total.
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
ouned
Administrator
Posts: 596
Joined: 23 Feb 2015, 13:03
Location: Gliese581c

Re: Altering the damage values of weapons (SP)

Post by ouned »

openJK one's already have a lot of improvements specially in jk2 sp code.
+ bugs which make the game crash in some places.

I'd rather fix the compiler problems... shouldn't be too hard
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

^^ This.

I've already tried, unsuccesfully, to run JK2 SP using OpenJK and it seemed buggy and unstable.

Until an official final version of OpenJK is released for SP JO, is there another way around this?
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

I've started cleaning up the SP code so it can be compiled on VS 2015: https://github.com/Boothand/jedioutcast ... f60d2cd1db

The errors that remain (at least until it compiles further) are a bit out of my league apparently. Now it's you guys' turn (looking at all the coders of jk2.info) :D
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: Altering the damage values of weapons (SP)

Post by Daggolin »

I've played around with the OpenJK version of SP for jk2 in April 2013 and I didn't run into too many issues I think. I think the best approach would be to fix remaining issues in the OpenJK version for JK2SP (assuming there aren't too many). That way one wouldn't end up with too many codebases and JK2SP would benefit from the OpenJK fixes and changes.
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

Though that requires people to get JKA just to play JK2, right? Been a while since I tried the OpenJK approach.
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: Altering the damage values of weapons (SP)

Post by Daggolin »

No. The OpenJK single player binaries (compiled in jk2-mode) are simply put into your jk2 game data and you play with your normal jk2 assets (at least the last time I checked). ;)
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

I desperately need to learn how to code just for JK2 lol but it seems impossibly daunting for a beginner.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: Altering the damage values of weapons (SP)

Post by Tr!Force »

imrightyourleft wrote:^^ This.
I've already tried, unsuccesfully, to run JK2 SP using OpenJK and it seemed buggy and unstable.
Until an official final version of OpenJK is released for SP JO, is there another way around this?
there is no current builds executables for JK2 SP, if u got one from the openJK builds, these are for JKA only. for jk2 u need generate it manually
Daggolin wrote:No. The OpenJK single player binaries (compiled in jk2-mode) are simply put into your jk2 game data and you play with your normal jk2 assets (at least the last time I checked). ;)
thats right, i compiled and tested, no JKA requiried,
imrightyourleft wrote:I desperately need to learn how to code just for JK2 lol but it seems impossibly daunting for a beginner.
im making an small tutorial for JK2 SP (OpenJK Version), i will post here this night! dont worry :lol:
Image
"The dark side? I've been there. Do your worst." - Kyle Katarn
  • JK2 & JK3 Code-Mod Developer
  • Jedi Knight Plus Mod Project: Click Here
  • E-Mail: triforce@gznetwork.com
  • Discord: TriForce#8785
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

Well, then :D Some good experience either way, hacking and slashing at that code.
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

Tr!Force wrote:im making an small tutorial for JK2 SP (OpenJK Version), i will post here this night! dont worry :lol:
Fabulous! That's very helpful of you, thanks :)

However, I honestly am not sure how to manually make a jk2sp executable file... :?
User avatar
Boothand
Administrator
Posts: 986
Joined: 24 Feb 2015, 08:21
Contact:

Re: Altering the damage values of weapons (SP)

Post by Boothand »

It's all about opening a solution file in a program and hitting the 'Compile' button, then receiving builds in a folder that can replace your JK2sp.exe (and dll's and other files) :D
imrightyourleft
Posts: 30
Joined: 16 Jan 2016, 21:10

Re: Altering the damage values of weapons (SP)

Post by imrightyourleft »

Boothand wrote:It's all about opening a solution file in a program and hitting the 'Compile' button, then receiving builds in a folder that can replace your JK2sp.exe (and dll's and other files) :D
Ah I see, that makes sense now you put it that way... So basically it's going in to the jk2sp.exe, altering whatever you want to alter, applying it and then making a new jk2sp.exe with the new values applied... right, I get it now. Well, I get the basic concept, that is - but not how to actually do it, just yet :lol:
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited