Jump to content

Home

cgame changes....


Trimbo

Recommended Posts

Hi,

I'm just getting warmed up with the whole jkii moding thing, and i've hit a problem already. When I make a change to the cgame module and rebuild it using the scripts, the changes never seem to be reflected ingame. I Start jk2 (client) with the parameter:

 

+fs_game myModName

 

I have also tried placing the /vm dir (which the scripts produce) into a pk3 file as suggested by the document that comes with the source, and it does show up ingame (ie, i can select it from the mod list), but still my changes do not take effect. To test, i've added a new cvar to the client so that I can test to see if it is there when I load the game, but it never is.

 

So I have tried putting the generated vm files into:

GameData/MyMod/vm/

 

and also tried pk3'ing the MyMod into MyMod.pk3 and placing it here:

GameData/MyMod/MyMod.pk3

 

But no joy.

 

Any ideas what i'm doing wrong?

 

BTW, i can modify the server code fine, and these changes do show up when i start a server (new cvars etc).

 

Also, the client reports to me its using "basejk-1" even though i've changed that value for my mod in the shared local header - which implies that my mod isnt running, basejk-1 is.

 

One last thing, the JK2 sourcecode has a header thats says its version is 1.03a, NOT 1.04, is there a later version of the sourcecode that I need to get?

 

Thanks,

 

Trimbo

Link to comment
Share on other sites

Hi again,

 

Just an update on where I am. I have been looking at other clientside mods to see how they do it and am now convinced that I am not incorrectly loading my mod. I have copied exactly the dir structure of another mod, both inside and outside the pk3 file and still no change. Therefore, it must be something in the code I need to change.

 

Can someone please suggest a VERY simple change to the vanilla cgame module, which I will be able to detect when I load the client?

 

Thanks,

 

Trimbo

Link to comment
Share on other sites

Have the cgame module modified so that your view angle is different in third person by default. That way, you'll know if you loaded your mod when you switch to third person. It's really an easy change, you sound like you could teach me a thing or two about this stuff.

Link to comment
Share on other sites

Wudan, thanks for replying. I'll try your suggestion and see if that shows up, although i'm fairly sure that I am not correctly running the modified cgame code. But its worth a try.

 

I really hope I can get this sorted, as I have a good series of mods planned, and i'd hate to give up becuase of lack of information.

Link to comment
Share on other sites

To test, i've added a new cvar to the client so that I can test to see if it is there when I load the game, but it never is.

 

are you sure you added the cvar corectly ?

you have to declare the cvar first and put it in the cvarTable[].

 

put something like this :

 

where cvars are declared :

vmCvar_t cg_mynewcvar;

 

and this in the cvartable :

{ &cg_mynewcvar, "cg_mynewcvar", "15", CVAR_ARCHIVE},

 

then launch the game and type "cg_mynewcvar" in the console .

it should display "cg_mynewcvar is 15"

 

and there is no 1.04 source code .

but the 1.04 is the 1.03a with a new netcode (which is in the exe not in the vms)

 

so there almost are no differences.

Link to comment
Share on other sites

Originally posted by Tchouky

 

are you sure you added the cvar corectly ?

you have to declare the cvar first and put it in the cvarTable[].

 

put something like this :

 

where cvars are declared :

vmCvar_t cg_mynewcvar;

 

and this in the cvartable :

{ &cg_mynewcvar, "cg_mynewcvar", "15", CVAR_ARCHIVE},

 

then launch the game and type "cg_mynewcvar" in the console .

it should display "cg_mynewcvar is 15"

 

and there is no 1.04 source code .

but the 1.04 is the 1.03a with a new netcode (which is in the exe not in the vms)

 

so there almost are no differences.

 

Hello,

 

Thanks for your reply. I don't have my source code to hand right now (i'm at work), but from what I can remember I did what you have suggested, obviously i'll check when I get home to make sure. I think I also had to declare the vmCvar_t as external in another module, as thats seemed to be the pattern with the existing cvars.

 

It would be very help if someone could post a simple "walkthrough" of making a clientside mod. The "how to make a mod" document supplied with the source was useful for showing me how to make a server side modification (altering the rocket speed), but I could do with an example of how to make a simple client side mod aswell.

 

My process so far has been to:

 

1: alter some aspect of the cgame module in CV++6 and save it

2: run the "makevms" script(s) to build the qvm files.

3: copy the generated code/vm/ dir into gamedata/MyMod/ to give me gamedata/MyMod/vm/

4: create a file "description.txt" and put it in the MyMod dir

5: zip and rename MyMod into MyMod.pk3

6: place MyMod.pk3 into the MyMod dir, giving gamedata/MyMod/MyMod.pk3

7: Start the client with the parameter: +set fs_game MyMod

 

I have also tried several other variations on this, such as not making the pk3 file.

 

Sorry for harping on about this, once i've passed this hurdle i'm sure I will be fine.

Link to comment
Share on other sites

I think I also had to declare the vmCvar_t as external in another module, as thats seemed to be the pattern with the existing cvars.

you only have to do that if you want to use these cvars in other files than cg_main.c

 

 

your process is good.

 

if nothing is working try to build a dll using msvc and put the dll in your mod folder :

 

gamedata\mymod\cgamex86.dll

 

and launch the game with the command line :

 

jk2mp.exe +set fs_game mymod +set vm_cgame 0

 

so it will tell the engine to load a dll instead of a vm.

Link to comment
Share on other sites

Originally posted by Tchouky

...

gamedata\mymod\cgamex86.dll

and launch the game with the command line :

 

jk2mp.exe +set fs_game mymod +set vm_cgame 0

 

so it will tell the engine to load a dll instead of a vm.

 

You'll probably want to go ahead and add:

 

+set vm_game 0 +set vm_ui 0

 

along with the .dll's for game and ui, as you'll probably end up editing those at some point.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...