Log in

View Full Version : A strange question (bytes)


Aquatic
March 14th, 2003, 01:44
Let's say you know that a certain value in a game can only be a '1 byte' value (0-255). How would you change the code so that this value can become a 2 byte value?

Sometimes you want to set a value higher than 255 but you can't because when the programmer made the game he declared that variable to be a 1 byte value. It would be nice to find a way around this.

FoolFox
March 14th, 2003, 02:37
Hello,

I think you may face a big problem, rewriting
nearly all the code.

If the code handle the var the way it's declared (working
on 1 byte), even if you extend the var(storage) to two
bytes, you'll have to goes through all parts where the prog
access the data in order to be sure that the prog handle
correctly (if the prog use al to read the var, you 'll have
some trouble to take your 2nd byte in account)....

I'm not able to think of 'a way around this' right now...

Regards
FoolFox

dELTA
March 14th, 2003, 07:24
Just as FoolFox says, this will most likely be a quite hard and most of all tedious task, due to several reasons. But there might be much easier ways to achieve your goal. Please be a little more specific about your current project, and we might be able to give some other good tips and solutions.

dELTA