Jump to content


Integer values in kitlist.2da and kit.ids

2 replies to this topic

#1 subtledoctor

  • Modders
  • 2448 posts
  • Gender:Male

Posted 21 July 2017 - 07:25 AM

When I perform READ_2DA_ENTRY on the entries in column 9 (KITIDS) of kitlist.2da, the resulting value is a decimal integer. I would like to perform the math on this number and then write it back into the table... but it is being written back in decimal format. While the existing entries are in hex format. So the result looks like:
How can I convert the integer back to hex format to write it back into the table? I don't see anything in the Weidu documentation about conversion of integer values...

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE

#2 Sam.

  • Modders
  • 126 posts
  • Gender:Male
  • Location:USA

Posted 21 July 2017 - 07:30 AM

Argent77's TO_HEX_NUMBER ?

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden


Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage

#3 argent77

  • Modders
  • 783 posts
  • Gender:Male

Posted 21 July 2017 - 08:24 AM

In this case the (undocumented) SPRINTF command would be sufficient:

SET value = 16420
SPRINTF hex ~%x~ (value)  // hex contains the string "0x4024"

Choose TO_HEX_NUMBER if you prefer a prettified output (with leading zeroes).

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users