PDA

View Full Version : using hex?



Gleeok
12-15-2007, 08:47 PM
Link->PitWarp(0, 1x1);

Link->PitWarp(0x11);

Link->PitWarp(0, 1x01);


How do you write these? I can't get it to compile.

DarkDragon
12-15-2007, 08:51 PM
To use a hexadecimal number in ZScript (like in C), stick a "0x" before the number. For instance 15 decimal is F hex, which would be 0xF in ZScript. Similarly 17 decimal = 11 hex = "0x11".

The "0x" does nothing more than tell the compiler, "this number is hex." It's not multiplication or anything like that.

Joe123
12-15-2007, 08:55 PM
The reason your's aren't compiling is that you need to put (dmap, screen) in them though, so:
dmap of 1, screen of 17:
Link->PitWarp(1, 0x11);

EDIT: Oh, after looking, you did do that on the first and third ones, just not the second one. Sorry.

Gleeok
12-15-2007, 09:02 PM
Ah yes, got it! Thanks.

Link->PitWarp(0,0xF-4);
Link->PitWarp(0,0x11);
Link->PitWarp(0,0x03+(4*2));