Hexediting question

Discuss EAW and find answers to problems.

Moderator: rotton50

Post Reply
rotton50
Warrant Officer
Warrant Officer
Posts: 2963
Joined: Sun Sep 10, 2006 1:30 pm
Location: Cape Charles, Virginia, USA

Hexediting question

Post by rotton50 »

I'm pretty comfortable with hexediting but here's something I've always wondered about. How do you represent a negative number?

I have a weapons mod that requires the ordinance to go up, not down. I can make stuff go forward or backward or even straight down but not up. Is it even possible?

And no, it's not the German "waterfall" weapon that used vertically fired cannon rounds. (i can't remember the German word for it - and couldn't spell it if I could remember it )

It's something much more perverse than that. :lol:
Moggy
Site Admin
Site Admin
Posts: 4501
Joined: Tue Feb 03, 2004 12:52 am
Location: A slit trench near RAF Gravesend
Contact:

Post by Moggy »

Which particular value are you editing?
rotton50
Warrant Officer
Warrant Officer
Posts: 2963
Joined: Sun Sep 10, 2006 1:30 pm
Location: Cape Charles, Virginia, USA

Post by rotton50 »

In the weapons.dat file the 5th and 6th bytes effect the flightmodel for the weapon in that slot. But it depends what the weapon is designated as. If designated as a bomb or rocket the bytes act differently than if the slot is designated as a drop tank.

There are actually two mods I have in mind, one is the German weapon I refered to above and the other I will keep as a surprise. But I will say that it only came to mind due to the development of Wudpecker's glider mod.

The mod will not be dead if I can't get the "up" motion, it would just be a little closer to the action I desire.
VonBeerhofen

Post by VonBeerhofen »

Hi rotton,

a negative number depens on how the number is formatted, i.e. floating point or just a 2 or 4 byte number.
The first one isn't easy to explain and to be honoust I still don't exactly understand how to calculate it manually, however most hexeditors have converters for it build in.
In case of just 2 or 4 byte hex numbers the negative is represented by it's
postive value deducted from (FF FF or FF FF FF FF) + 1, since FF FF is allready minus one. I think it's called two's complement, so anything above 1/2 it's maximum value will be negative.

VonBeerhfoen
Post Reply