lfnetwork.com mark read register faq members calendar

Thread: force meter bar screwed up by %256
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 03-25-2008, 03:01 PM   #1
bsah
Rookie
 
Join Date: Mar 2008
Posts: 16
force meter bar screwed up by %256

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:

Code:
	if ( self->client->ps.fd.forcePower > self->client->ps.fd.forcePowerMax )
	{
		self->client->ps.fd.forcePower = self->client->ps.fd.forcePowerMax;
	}
it reads now:

Code:
	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?
bsah is offline   you may: quote & reply,
Old 03-25-2008, 05:28 PM   #2
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
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.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 03-28-2008, 05:57 AM   #3
bsah
Rookie
 
Join Date: Mar 2008
Posts: 16
Screw SP :P I think I'll try hacking the cloak bar.
bsah is offline   you may: quote & reply,
Old 03-28-2008, 11:59 AM   #4
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Hacking? You might as well just directly change the memory if u want some higher value. :S


iojamp project lead / coder
ensiform 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 > force meter bar screwed up by %256

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 02:49 AM.

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