Page 1 of 2

Saurbraten Cube 2 question

Posted: December 22nd, 2010, 11:03 am
by owenisred
I have been trying, instead of coding my own guns anew, simply heavily editing saurbraten and replacing its guns and models with mine.

Is this possible? I mean my plan to begin with is to dramatically increase the kickback of a particular gun, along with its damage. I dont know how this would effect me playing online: whether I'd have awesome beefed out guns, I couldnt play online, or that I simply couldnt edit the game at all.

Anyway I had a look in game.h and I found this line:

static const struct guninfo { short sound, attackdelay, damage, projspeed, part, kickamount, range; const char *name, *file; } guns[NUMGUNS] =
{
{ S_PUNCH1, 250, 50, 0, 0, 0, 14, "fist", "fist" },
{ S_SG, 1400, 10, 0, 0, 20, 1024, "shotgun", "shotg" }, // *SGRAYS
{ S_CG, 100, 30, 0, 0, 7, 1024, "chaingun", "chaing"},
{ S_RLFIRE, 800, 120, 80, 0, 10, 1024, "rocketlauncher", "rocket"},
{ S_RIFLE, 1500, 100, 0, 0, 30, 2048, "rifle", "rifle" },
{ S_FLAUNCH, 500, 75, 80, 0, 10, 1024, "grenadelauncher", "gl" },
{ S_PISTOL, 500, 25, 0, 0, 9000, 1024, "pistol", "pistol" },
{ S_FLAUNCH, 200, 20, 50, PART_FIREBALL1, 1, 1024, "fireball", NULL },
{ S_ICEBALL, 200, 40, 30, PART_FIREBALL2, 1, 1024, "iceball", NULL },
{ S_SLIMEBALL, 200, 30, 160, PART_FIREBALL3, 1, 1024, "slimeball", NULL },
{ S_PIGR1, 250, 50, 0, 0, 1, 12, "bite", NULL },
{ -1, 0, 120, 0, 0, 0, 0, "barrel", NULL }
};



So I tried to change one of the values in the list (i.e. the 9000 part for the pistol) However apparently this file has no effect on gameplay at all... When I saved this and entered the game NOTHING changed.


I got confused - can anyone help?

Thanks a lot,
Owen.

Re: Saurbraten Cube 2 question

Posted: December 22nd, 2010, 1:55 pm
by Leo_V117
Try compiling the cbp file in src/vcpp. You need Code::Blocks.

Re: Saurbraten Cube 2 question

Posted: December 22nd, 2010, 4:19 pm
by chocolatepie33
couldn't you use the command instead of putting it straight out like that?

Also, the guys over at Sauer would probably know better than we would.

Re: Saurbraten Cube 2 question

Posted: December 22nd, 2010, 7:31 pm
by owenisred
AHHH it would need compiling - regardless of how much I edited the .h file - yes?

Re: Saurbraten Cube 2 question

Posted: December 22nd, 2010, 8:00 pm
by owenisred
YES! I love life :) thanks Leo!

Re: Saurbraten Cube 2 question

Posted: December 22nd, 2010, 8:08 pm
by chocolatepie33
I'm gonna guess that it worked for you...

Can you try something? Look what's on here: viewtopic.php?f=15&t=1203&start=0
It's about playermodel changing. If you change part of a file (see the 2nd page), you can change the number of playermodels... but maybe it works only if you compile it. I'd like to see if that's true, please...

Re: Saurbraten Cube 2 question

Posted: December 23rd, 2010, 8:23 am
by Leo_V117
Any file that ends with ".h" or ".cpp" would require you to compile the main source file if you edit them. In theory, you wouldnt even need to release the "src" folder as part of the engine as the modes are compiled and connected to a ".exe" file, executed through a batch. Providing you compile the project, it should work fine.

Having trouble? Not Anymore!
- PAS Support Team
- Leo

Re: Saurbraten Cube 2 question

Posted: December 23rd, 2010, 8:53 am
by owenisred
Yea I know - thanks a lot dude :)

Re: Saurbraten Cube 2 question

Posted: December 23rd, 2010, 9:05 am
by Leo_V117
No problem. Post closed?

Re: Saurbraten Cube 2 question

Posted: December 23rd, 2010, 3:51 pm
by chocolatepie33
It's your choice, you have the powers. I'd say so.