JK2 Source Code for Mods

Modifications of weapon sounds, certain fixes, demos, map objects/resources and other less categorizable files can be found here!
Post Reply
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

JK2 Source Code for Mods

Post by Tr!Force »

Tr!Force wrote:Some people asked me for a jk2 source ready to compile (to make code-mods), so i will share here my current project i have on GitHub, (i copied exactly the readme below), Here we go :)
JK2SourceCode

Full Source Code of Jedi Knight II ready to use (1.02, 1.03 and 1.04 versions)

Features
  • JK2 1.02, 1.03 and 1.04 version projects
  • Main Compilers (cpp.exe, lcc.exe, q3asm.exe, rcc.exe)
  • Configured Batch Compilers (game_2.bat, cgame_2.bat, ui_2.bat)
Notes

This first upload only aim to get the main game-code QVM's ready to use.
  • Server Side jk2mpgame.qvm
  • Client Side cgame.qvm
  • User Interface ui.qvm
Instructions

To get the main QVM's for each version, you just need to join to a jk2 version folder and choose what you want to compile, For example: to compile the server-side part, enter to the game folder and run game_2.bat, then read the console output, if everything is ok you should see something like writing to jk2mpgame.qvm. After that, back to the base folder and QVM's will store in the vm folder.

For Developers

This repository aims to make mods for JK2, if you want to modify the engine code instead the game code, you should follow another project called JK2MV (Multi Version), it supports all three game versions and comes with various features and optimizations.

Requirements
  • Windows XP SP2 or higher
  • Visual Studio C++ 2008 or higher
Legal

The initial release for the game-code was released in 2002 in the JK2 Editing Tools. These tools are released "as is" and are unsupported by Raven Software, Activision or LucasArts.

The full release was in 2013 and can be found on SourceForge, posted by James Monroe and Rich Whitehouse. Thanks to Raven Software for making this available to us.

Code: Select all

GNU GENERAL PUBLIC LICENSE Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Download

If you have a GitHub account, you can fork the project to get it in your account, if not, just press the "Download ZIP" button at the right corner.

https://github.com/TriForceX/JK2SourceCode
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
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: JK2 Source Code for Mods

Post by fau »

Requirements

Windows XP SP2 or higher
Visual Studio C++ 2008 or higher
Why would you need any of that?
User avatar
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: JK2 Source Code for Mods

Post by fau »

Also you apparently threw together files from GPL2 release and SDKs which is against gpl. Not that anyone cares.

edit: By the way, what's the point of bundling together SDK and full source code?
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: JK2 Source Code for Mods

Post by Tr!Force »

fau wrote:
Requirements

Windows XP SP2 or higher
Visual Studio C++ 2008 or higher
Why would you need any of that?
Most of people who asked me for the source to make mods are beginners, is the reason why i added that.
fau wrote: Also you apparently threw together files from GPL2 release and SDKs which is against gpl. Not that anyone cares.
I know there was two releases by James Monroe and Rich Whitehouse, the first was from 0.54, 1.02, 1.02a, 1.03 and 1.04. so i had understood that those codes had some licence issues. The source i uploaded is the second release, which contains 1.02, 1.03 and 1.04 only, with licence issues fixed. (idk what they did, i dont understand to much of these things)
fau wrote: edit: By the way, what's the point of bundling together SDK and full source code?
Most of people who asked me for the source cant compile QVM's properly with the current full jk2 source code, so they doesnt have the main compilers or the batch files configured. is why i added that (only that). they only had the hability to compile qvms with the old jk2 sdk tools (1.04 only)

Note: I posted this mostly considering beginners :D
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
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: JK2 Source Code for Mods

Post by fau »

What's wrong with JK2 SDK for beginners (and others)?
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: JK2 Source Code for Mods

Post by Tr!Force »

fau wrote:What's wrong with JK2 SDK for beginners (and others)?
the full jk2 sdk doesnt contain the main qvm compilers (cpp.exe, lcc.exe, q3asm.exe, rcc.exe). and current batch files inside game,cgame and ui arent the same from the old jk2 sdk tools, so you cant compile qvm's with the new batch files. you need do some changes to get working, and obiously, had the main compilers, is what i did here.

most of the people who have contacted me has no knowledge of how to compile QVMs, they tried to test with the official releases without results to start creating their mods, thats why I uploaded the code " ready to use" with instructions and details for beginners.

:)
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
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: JK2 Source Code for Mods

Post by fau »

Tr!Force wrote:
fau wrote:What's wrong with JK2 SDK for beginners (and others)?
the full jk2 sdk doesnt contain the main qvm compilers (cpp.exe, lcc.exe, q3asm.exe, rcc.exe).
It does (at least SDK2). Moreover it contains batch scripts (although they don't work without some changes on newer windows I heard) and instructions for beginners.

I think bundling full source code will be extremly confusing for beginners (ie why this change I made in client/cl_main.cpp doesn't work???)
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: JK2 Source Code for Mods

Post by Tr!Force »

fau wrote:
Tr!Force wrote:
fau wrote:What's wrong with JK2 SDK for beginners (and others)?
the full jk2 sdk doesnt contain the main qvm compilers (cpp.exe, lcc.exe, q3asm.exe, rcc.exe).
It does (at least SDK2). Moreover it contains batch scripts (although they don't work without some changes on newer windows I heard) and instructions for beginners.

I think bundling full source code will be extremly confusing for beginners (ie why this change I made in client/cl_main.cpp doesn't work???)
Because ure modifying the ENGINE-CODE, i added a note saying: "This repository aims to make mods for JK2, if you want to modify the engine code instead the game code, you should follow JK2MV". and ure working in an ENGINE-CODE folder, i said in the another note: "This first upload only aim to get the main game-code QVM's ready to use, Server Side: jk2mpgame.qvm, Client Side: cgame.qvm, User Interface: ui.qvm" same in the instruction, and features, etc... to make mods you need only the GAME-CODE (game, cgame and ui)

i dont want to make it FULL compatible (gamecode + enginecode),this is just only for mods. JK2MV project has the engine-code work done. i dont want to convert the entire projects, fix build problems, or the other stuff needed to get the engine-code binaries get compiled.

if someone doesnt want to use JK2MV to edit the engine-code, he will have to convert all that, or use a windows xp sp2 + visual c++ 6 if u dont want convert anything, just obtain the binaries.

Currently this had a positive reception from those who have contacted me. Anyways im working on a some tutorials for mods here. :P
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
fau
Staff
Posts: 433
Joined: 16 Aug 2015, 01:01
Location: Warsaw / Poland
Contact:

Re: JK2 Source Code for Mods

Post by fau »

echhh…
User avatar
Fudasys
Posts: 14
Joined: 02 Sep 2015, 18:32
Location: Germany
Contact:

Re: JK2 Source Code for Mods

Post by Fudasys »

Could u possibly explain how I can debug through the Mod Sourcecode? (for example with Visual Studio)

When I'm debugging through the engine code, I usually replace the binary files with debug binary files, start the game and use the "Attach to process" option of Visual Studio. But I wonder how it works with the QVM...
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: JK2 Source Code for Mods

Post by Daggolin »

You need to adjust the code to compile a dll using Visual Studio. I think for the basejk code it's enough to rename the function "powf" to "Q_powf" and replace every occurence of "powf" with "Q_powf" (that's cause the standard headers already bring a powf function which conflicts with jk2's powf function when you compile a native library and you can't just remove jk2's powf function, because jk2's powf is not doing what the powf function is supposed to do).

If you have adjusted your code you can just compile the jk2mpgamex86.dll using Visual Studio. If you change the output-file to be "gamepath/modname/jk2mpgamex86.dll" and the application to run for debugging to be jk2ded.exe in gamepath with the parameters "+set fs_game modname +set vm_game 0" it should be enough to simply click the "play" button to compile the mod and start a server with your mod. To use the mod with jk2mv you need to use the x86 version of jk2mvded and change the output-file to "gamepath/modname/jk2mpgame_x86.dll" (yes, jk2mv needs the additional "_").

Sorry for the short and undetailed post, I am a bit in a hurry at the moment. I hope this helps you anyway. If you have more questions feel free to ask. ;)
User avatar
Fudasys
Posts: 14
Joined: 02 Sep 2015, 18:32
Location: Germany
Contact:

Re: JK2 Source Code for Mods

Post by Fudasys »

<3

I might come back to you, annoying you with further questions. :)
User avatar
Daggolin
Administrator
Posts: 794
Joined: 23 Feb 2015, 13:05

Re: JK2 Source Code for Mods

Post by Daggolin »

Feel free to. ;)
Tom Arrow
Posts: 92
Joined: 21 Sep 2016, 03:05

Re: JK2 Source Code for Mods

Post by Tom Arrow »

TriForce, have you excluded the compilers now? I don't see any 'bin' folder inside and it gets referenced in the .bat files.
User avatar
Tr!Force
Posts: 433
Joined: 26 Feb 2015, 12:25
Location: Chile
Contact:

Re: JK2 Source Code for Mods

Post by Tr!Force »

Tom Arrow wrote:TriForce, have you excluded the compilers now? I don't see any 'bin' folder inside and it gets referenced in the .bat files.
ure right, i already checked, i dont know why these files (and another files) wasnt uploaded, now i re-uploaded the entire project 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
Tom Arrow
Posts: 92
Joined: 21 Sep 2016, 03:05

Re: JK2 Source Code for Mods

Post by Tom Arrow »

Tr!Force wrote:
Tom Arrow wrote:TriForce, have you excluded the compilers now? I don't see any 'bin' folder inside and it gets referenced in the .bat files.
ure right, i already checked, i dont know why these files (and another files) wasnt uploaded, now i re-uploaded the entire project files. :)
Hah! No worries though, I realized it was basically just the bin folder from the editing tools or something, so I'm good.
Post Reply
Created by Matti from StylesFactory.pl and Warlords of Draenor (modified by jk2.info)
Powered by phpBB® Forum Software © phpBB Limited