PDA

View Full Version : ID's. mr 268435456 and mrs 10000000



walfridson
01-28-2008, 05:02 PM
Could anyone please explain what the difference is between these two ID numbering - besides 258435456 ;)

In the scene editor and the lws there's 10000000. So why would I need this extra ID?

Jarno
01-28-2008, 09:02 PM
268435456 is not an ID number, it's a pointer to something. 10000000 is an ID number.

---JvdL---

mikadit
01-28-2008, 09:22 PM
I'm not a programmer, but seams that the two numers are the same number:
268435456 (Decimal or Bytes)
10000000 (Hexadecimal)
256 (Megabytes)
Maybe it has to do with memory.

Hoping to not be off topic

walfridson
01-29-2008, 02:16 AM
268435456 is not an ID number, it's a pointer to something. 10000000 is an ID number.

---JvdL---
Hm ok. :)
Reason why I'm asking is because I need to get the ID when saving a lws. .id gives me 268435456. Would be nice to get the item ID directly, .itemid or something..

Svenart
01-29-2008, 02:31 AM
maybe this can help you, but Iīm not sure, donīt have tested it...

generic
{
// Create a Mesh Object from first object loaded.
mesh = Mesh() || error("No Object Loaded!");
info("mesh id: ", mesh.id);
}

walfridson
01-29-2008, 02:37 AM
hex() helped a bit spits out 0x100000000 etc
Only need to strip the 0x part

Svenart
01-29-2008, 04:17 AM
Maybe you can use strright or strleft for this...

value = strright(“This string.”,3);
… //result: “ng.”

walfridson
01-29-2008, 04:20 AM
yes, that's what I did :)
selected=Scene().getSelect();
info(strright(hex(selected[1].id),8));

jeremyhardin
01-29-2008, 11:27 PM
why do you need the hex version? I usually just use (and save in the lws) the ID it gives me.

walfridson
01-30-2008, 01:00 AM
Hm ok. So you save the .id (ex 268435456) directly to the lws? Not following exactly.

jeremyhardin
01-30-2008, 02:29 AM
when I need the ids saved, yes. Selecting items works with ids, so if you need to use and store the id, just save and use it as-is. What exactly are you wanting to do with the id?