Jump to content

Home

force meter bar screwed up by %256


bsah

Recommended Posts

I'm currently making a small serverside mod for JK3 that will focus mainly on more powerful force powers, and I'm kinda hitting a wall here. I wanted to rise the maximum possible force amount from 100 to somewhere around 999 (mwah hah hah), so I temporarily changed the routine WP_ForcePowerRegenerate() in w_force.c (which is, obviously, responsible for recharging the force), so instead of:

 

	if ( self->client->ps.fd.forcePower > self->client->ps.fd.forcePowerMax )
{
	self->client->ps.fd.forcePower = self->client->ps.fd.forcePowerMax;
}

 

it reads now:

 

	if ( self->client->ps.fd.forcePower > 999 )
{
	self->client->ps.fd.forcePower = 999;
}

 

It compiled cleanly (Yay, that's a big of an achievement, isn't it? :p), and when I entered the game the force meter went beyond 100 and kept increasing until it... Wrapped around at around 250 and started increasing back from 0. At first I thought that gentity_t->client->ps.fd.forcePower was an unsigned byte, and it just simply wrapped around, but it turned out that the value of ps.fd.forcePower on the server side itself was all ok, and it's just something on the client side that does a %256 before drawing the force meter and screws my dreams up.

 

It seems that going 999 force power points in SP isn't a problem (although I forgot the exact cheat code to do that :p).

 

Can anyone see a way to overcome this little, but still big annoyance? Some gentle way of telling the client that it has hit 256 N times? Will I have to change the clientside DLL stuff (which is what I wouldn't like to do, I'd rather keep my mod 100% serverside), or even worse, does it seem to be a limit set in the jamp.exe?

 

Or maybe someone can suggest a subtle way of informing the player that he should add N*256 to his actual force power amount to get an idea of how powerful he is at the moment? A text message on the center of the screen would be annoying, wouldn't it? Or maybe hacking the jetpack fuel/cloak meter to duplicate as a second (and unscrewed) force bar? Or maybe is there a way of adding such "custom" bars depending on the actual needs of the crazy developer? It seems that E-web and ammo dispenser also have their own "bars", are these statically coded in on both client and server or are they at least somewhat dynamic? Or maybe somehow telling the client that he has four times less force power, so all force powers will seem to drain 1/4 of the cost, regen 4 times slower, etc?

Link to comment
Share on other sites

I don't think it wants you to allow more than 100 in the first place for clients.

 

Just because single player allows something, does not mean you can do it in the multiplayer codebase. A) SP is C++, B) Theres no networking, C) its only 1 module.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...