Staredit Network

Staredit Network -> UMS Assistance -> Byte Detection Problem
Report, edit, etc...Posted by DT_Battlekruser on 2006-07-30 at 02:18:16
As I was going along, writing MemCalc 5, a sudden and huge problem hit me about EUD Conditions. I thought I'd put this out to some of the ingenious minds of the community to see if a way around it can be found. The problem is thus:

If I have a DWORD that is a death count, such as the following byte:

00 00 00 00

Now, let's say I want to detect if the value on byte 2 is, say, 37. However, I want to find whether it is 37 regardless of the other byte values. I would want both byte situations to trip the trigger(s):

00 37 00 00

07 37 6D F2

The problem is, for detecting a single byte as byte 1 or 2, the byte value occurs very commonly throughout a set pattern across a wide number of deaths.

For example, if I wanted to find when byte 1 is 07, that will happen if the DWORD is 07000000 (dec 7), 07010000 (dec 263), 07020000 (dec 519), and so on. In fact there are 16,777,216 different possibilities for byte 1 to be 07.

Is there a way to reduce the number of triggers it would require to detect something like this?

Note: If you have no idea what I just said, don't bother posting.
Report, edit, etc...Posted by MoonlighTurtle on 2006-07-30 at 03:14:55
Try using a binary countoff

I believe it can be used to isolate a specific byte by breaking the number down.

Like for the examples you posted, 263 - 256 = 7, 519 - 512 = 7

EDIT:

Actually, it wouldn't be binary, because that wouldn't tell you exactly what it is, you would need to do base 16.

Here's a table of numbers. By trying to subtract each of them starting with the highest, you can tell exactly what hex value is in each place.

These are the numbers you will need to subtract. It goes up to 16^7
QUOTE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Report, edit, etc...Posted by DT_Battlekruser on 2006-07-30 at 03:45:29
The value I'm checking is an EUD value so it's an uneditable death amount. I can't seem to find a way to transfer the death count into another editable counter to isolate the byte...

Good try though.
Report, edit, etc...Posted by MoonlighTurtle on 2006-07-30 at 03:50:53
Oh sorry didn't know you couldn't edit an EUD valued death counter.

Hmm, so how to check the value of it without the ability to edit it. Can't think of anything now. Not sure if it's possible.

Unless there's some kind of trick, I don't think there's any way to do it. Everything I know is dependent on being able to add/subtract from the original death counter.
Report, edit, etc...Posted by Demaris on 2006-07-30 at 09:53:04
It seems to me this is the same problem as health detection. You can't detect every possibility unless you actually define a case for every possibility.
Next Page (1)