Jump to content


Photo

Hex colors for .cre files.


  • Please log in to reply
11 replies to this topic

#1 AnnabelleRose

AnnabelleRose

    The great pretender... of modding!

  • Modder
  • 2083 posts

Posted 11 January 2006 - 10:03 PM

I think I asked this once before, but I cannot remember where. Might have been though PM or IM. Either way, I cannot find it.

When I go to Shadow Keeper, I get one set of hex colors. The template I stole borrowed from SConrad shows two sets. How do I find the second, or is the second the one shown in SK?

If possible, would I be able to do this with only the first set from SK as well?

- The transitioned former modder once known as MTS.


#2 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 12 January 2006 - 06:41 AM

My template shows you... two sets? Uh, how can that be?

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#3 igi

igi

    IESDP Guardian

  • Administrator
  • 1065 posts

Posted 12 January 2006 - 11:09 AM

IIRC, the code had 1 offset and 1 colour (both were specified in hex).

IIRC, the code had 1 offset and 1 colour (both were specified in hex).

Visit the IESDP


#4 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 12 January 2006 - 12:28 PM

Ah, that'd explain it. ;)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#5 AnnabelleRose

AnnabelleRose

    The great pretender... of modding!

  • Modder
  • 2083 posts

Posted 15 January 2006 - 10:35 AM

Ah, that'd explain it. ;)


Not to me it doesn't. :(

Still need some help.

- The transitioned former modder once known as MTS.


#6 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 15 January 2006 - 10:36 AM

Show me an example code of what it is you don't understand, and I'll help you. :)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#7 AnnabelleRose

AnnabelleRose

    The great pretender... of modding!

  • Modder
  • 2083 posts

Posted 16 January 2006 - 01:08 AM

I'll use the PGK script as an example:

COPY_EXISTING ~J#Klsy09.CRE~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN
	WRITE_BYTE 0x32 0x42 // Metal colour
	WRITE_BYTE 0x2d 0x2e // Minor colour
	WRITE_BYTE 0x2e 0x15 // Major colour
	WRITE_BYTE 0x2f 0x69 // Skin colour
	WRITE_BYTE 0x32 0x42 // Leather colour
	WRITE_BYTE 0x32 0x42 // Armor colour
	WRITE_BYTE 0x32 0x42 // Hair colour

I figured out how to get the first one (though ShadowKeeper), but I have no clue how to get the seecond part. Can't remember if I guessed or copied on that one.

- The transitioned former modder once known as MTS.


#8 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 16 January 2006 - 01:35 AM

Ah, yeah, just as I (and igi) thought.

The first offset is not a colour, but a location in the creature file. If you open up a creature in NI and have enabled Options -> Show Hex Offsets, you will see that all different information are located in different places of the file. So, first, you need to specify *what* in the file you want to change, before you can enter the new value. Just putting up values doesn't really make any sense - WeiDU can't guess what you want to patch. It can easily be the saving throws or the deathvariable instead of colours.

Also, the second value isn't just the colour - it's the hex value of the colour, which is not quite the same thing.

I'll explain it with my own code from BGothII:

COPY_EXISTING ~aerie.cre~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN
	WRITE_BYTE 0x2c 0x1b // Metal colour
	WRITE_BYTE 0x2d 0x2e // Minor colour
	WRITE_BYTE 0x2e 0x15 // Major colour
	WRITE_BYTE 0x2f 0x69 // Skin colour
	WRITE_BYTE 0x30 0x16 // Leather colour
	WRITE_BYTE 0x31 0x1d // Armor colour
	WRITE_BYTE 0x32 0x42 // Hair colour
  END
BUT_ONLY_IF_IT_CHANGES
is the full code, but I'll just grab one of them as example:

WRITE_BYTE 0x2c 0x1b // Metal colour
The first value is the location, 2c, in the file. We can see that the next 'entry' in NI is at 2d, which means that the field we want to edit is only one byte (hence WRITE_BYTE instead of SHORT or LONG).

The second value is the color in hex. 1b is the same as colour number 27. To check what the hex value of the desired colour is, simply right-click in NI and select "Edit as hex".

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#9 AnnabelleRose

AnnabelleRose

    The great pretender... of modding!

  • Modder
  • 2083 posts

Posted 07 February 2006 - 03:30 PM

So just to check myself (so I can get some more of my projects released, finally), The second value will always be the same?

- The transitioned former modder once known as MTS.


#10 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 07 February 2006 - 03:41 PM

No, the second value is the colour code you want the colour 'slot' to have, in a hexadecimal format.

The first values are always the same; 0x2c for metal colour, 0x2d for minor colour, 0x2e for major colour and so on.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#11 AnnabelleRose

AnnabelleRose

    The great pretender... of modding!

  • Modder
  • 2083 posts

Posted 07 February 2006 - 03:44 PM

Glad I asked. That could have been a disaster....

- The transitioned former modder once known as MTS.


#12 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 07 February 2006 - 03:52 PM

Possibly, yes. ;)

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner