lfnetwork.com mark read register faq members calendar

Thread: [QuickFix/Guide] Compiling on Visual Studio C++ 2008
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 12-07-2009, 03:42 AM   #1
TrippHop
Lurker
 
Join Date: Dec 2009
Posts: 5
Exclamation [QuickFix/Guide] Compiling on Visual Studio C++ 2008

Step #1: Fixing the resource files:
Inside the win32 folder there are a couple resource files.
Open up JK2cgame.rc, JK2game.rc, and ui.rc with a text editor and change all instances of "afxres.h" to "winresrc.h"

Quote:
inside you will find
Code:
#include "afxres.h"
change to:
Code:
#include "winresrc.h"
also change:
Code:
"#include ""afxres.h""\r\n"
to:
Code:
"#include ""winresrc.h""\r\n"
Step #2: Fixing the powf function conflict
Find all the instances of powf and rename it to Q_powf.
( you will find it once in q_shared.h and q_math.c, twice in cg_view.c )

You may choose to use Visual Studio's provided powf function, which yields better results ingame imo, but it may mess up third person aim.

Step #3: Fixing botlib

Find this function in l_precomp.cpp
Code:
int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define, token_t **firsttoken, token_t **lasttoken)
and just underneath where it says:
Code:
unsigned long t;	//	time_t t; //to prevent LCC warning
change it to:
Code:
time_t;
then look for this in the switch() in the same function:
( this will appear twice, once under case BUILTIN_DATE, and case BUILTIN_TIME )
Code:
curtime = ctime((const long *)&t);
and change it to:
Code:
curtime = ctime(&t);
Step #4: Disable warnings
(optional)
paste this into disablewarnings.h after the #ifdef _WIN32

Code:
//for VS2008
#pragma warning(disable : 4005)		// macro redefinition
#pragma warning(disable : 4996)		// This function or variable may be unsafe...
#pragma warning(disable : 4204)		// nonstandard extension used : non-constant aggregate initializer
#pragma warning(disable : 4431)		// missing type specifier - int assumed. Note: C no longer supports default-int
now you are all ready to make your mod.
but i would pay a visit to this thread first:
http://www.lucasforums.com/showthread.php?t=140104

if anyone would like to contribute on how to setup the debugger that would be great.

I will add a guide later for compiling on linux when i get to it.
TrippHop is offline   you may: quote & reply,
Old 12-11-2009, 02:00 AM   #2
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
For the debugger, here is my setup..

Client Game
Configuration: Debug
Linker -> General -> Output File: ..\..\ArbModding\cgamex86.dll

Game
Configuration: Debug
Linker -> General -> Output File: ..\..\ArbModding\jampgamex86.dll
Debugging -> Command: D:\Games\Star Wars Jedi Knight Jedi Academy\GameData\jampded.exe
Debugging -> Command Arguments: +set fs_cdpath "D:\Games\Star Wars Jedi Knight Jedi Academy\GameData" +set fs_game "ArbModding" +set fs_dirbeforepak 1 +set sv_pure 0 +set viewlog 1
Debugging -> Working Directory: ../..

User Interface
Configuration: Debug
Linker -> General -> Output File: ..\..\ArbModding\uix86.dll
Debugging -> Command: D:\Games\Star Wars Jedi Knight Jedi Academy\GameData\jamp.exe
Debugging -> Command Arguments: +set fs_cdpath "D:\Games\Star Wars Jedi Knight Jedi Academy\GameData" +set fs_game "ArbModding" +set fs_dirbeforepak 1 +set sv_pure 0 +set viewlog 1 +exec raz0r.cfg
Debugging -> Working Directory: ../..

Then set 'User Interface' as your start-up project, and use F5 to run JA.


Personally, I chose to remove the botlib module as it's completely unused. I also restructured my directories so it's easier to manage.
PM or ask here if anyone needs help setting up and tweaking things.


Last edited by -=*Raz0r*=-; 12-11-2009 at 02:10 AM.
-=*Raz0r*=- is offline   you may: quote & reply,
Old 04-18-2010, 02:54 PM   #3
TrippHop
Lurker
 
Join Date: Dec 2009
Posts: 5
Sorry guys, I still haven't gotten to writing a linux tutorial yet. I still plan on writing one for linux, and I will also write one for mac. I am just really busy with Uni :P
TrippHop is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > [QuickFix/Guide] Compiling on Visual Studio C++ 2008

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:01 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.