PDA

View Full Version : disabling saber


Barada
09-08-2004, 12:17 AM
aye, yup, disabling the saber.. but can't figure out best way to do this.

changing the cvar default for g_weapondisable in g_main accomplishes nothing. Any other attempts either crash or don't compile. This has got to be a simple one, and it's not like I haven't seen a mod with a disabled saber.

anyone know the best way to disable a weapon??

Also could be accomplished by disabling FP_SABER_OFFENSE, but I can't seem to even disable that, even with a g_weapondisable number. Again, multiple errors and no compile.

thx in advance!

razorace
09-08-2004, 09:54 AM
OJP (ojp.jediknight.net) has code that allows you go use the weapon disable cvar to disable any of the weapons.

Barada
09-08-2004, 05:39 PM
same problem. Using G_weapondisable does not work on the saber as far as I have gotten. Most people just take points off of saber attack to access melee.

Typing g_weapon disable 8 (the value for saber) doesn't work. And it wigs out and disables EVERYTHING EXCEPT the saber.

However typing 2048 (rocket) for instance, works fine.

I noticed in the INSTAGIB mod, the default for G_weapondisable and G_forcepowerdisable were both 0. The mod disables weapons and certain force without the cvar command. That's what I'm missing.

razorace
09-09-2004, 12:18 AM
So, are you saying that you actually tried OJP?

When I fixed the weapondisable code for OJP, it worked even for the saber.

Barada
09-09-2004, 12:10 PM
Maybe I'm not looking in the right place on your site.

I'm going to Documentation>Open Jedi Project Cvars
and using -
g_weaponDisable 0
Multiplayer, Weapons

Description:
Controls which weapons are useable in etc...

g_weapondisable 8 for saber.

razorace
09-09-2004, 12:29 PM
You have to actually RUN OJP for the fixes to work. gees.

Barada
09-09-2004, 01:19 PM
ok, I'm not understanding what OJP is. Reading documents now.

count_coder
09-12-2004, 09:24 AM
so uhh.. is there no easy way to do this without downloading OJP?

razorace
09-12-2004, 02:09 PM
yep

GangsterAngel
09-16-2004, 02:20 AM
There is a real easy way. look in

g_client.c
ClientSpawn
then find: WP_SABER)

just stick a boolen in there

count_coder
09-18-2004, 06:18 PM
Thanks angel for the replay.. I'm a little confused though.. You said stick a boolean in there, could you be a little obvious? I know what booleans are of course but I fail to see what to do with it.. Anyway..

Thanks

Barada
09-19-2004, 12:21 AM
count_coder, in g_client..

Around line 3418 (I don't know how many changes I made here, so just look around that line)

{
if (client->ps.fd.forcePowerLevel[FP_SABER_OFFENSE])
{
client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_SABER ); //these are precached in g_items, ClearRegisteredItems()
}
else
{ //if you don't have saber attack rank then you don't get a saber
client->ps.stats[STAT_WEAPONS] |= (1 << WP_MELEE);
}
}

Altering that will remove the saber, downside is melee takes a hike too. I'm over removing the saber, instead I removed the deflect missle function which is pretty much all I wanted to accomplish in the first place.