Author Topic: Item flags for colorization  (Read 2336 times)

Item flags for colorization
« on: June 02, 2018, 01:35:19 pm »
hello, i just found this in _defines.fos

Code: [Select]
#define ITEM_COLORIZE                            (0x00400000)
#define ITEM_COLORIZE_INV                        (0x00800000)

setting this flag on an item via `itemflags makes the item disappear. does this flag do what i think it does? colorizing item sprites like with DrawSprite?

another question, how do i make an item completely clickable through? if its even possible

Offline Wipe

  • Rotator
  • Random is god
Re: Item flags for colorization
« Reply #1 on: June 07, 2018, 12:04:09 am »
ITEM_COLORIZE is just a part of what you need.

Next step you -most likely- need is to pack RGB/RGBA into single (u)int, just like it's done internally by engine. For that, run `getcolor R G B or `getcolor R G B A replacing letters with wanted value. You'll get a number which you're supposed to remember/note.

And finally, apply the color to Item itself using `itemlight -c NUMBER which should make everything working. I *think* Item::LightColor was used for both, light and colorizing but i can't be 100% sure without time machine.

another question, how do i make an item completely clickable through? if its even possible
Not sure if it's possible but hey, in worst case you can mark item as hidden and use DrawSprite( item.PicMap ) :D

If you need item just for decoration, you can experiment with ITEM_NO_LOOT/ITEM_NO_STEAL/ITEM_CAN_LOOK/ITEM_CAN_PICKUP/ITEM_CAN_USE flags; setting all NO flags and unsetting all CAN flags should make it practically same as scenery. Pay attention to testing hotkeys and such on edited items; your scripts may ignore itemflags and do things you don't want - like decrafting APAs into materials etc. They most likely will still "steal" mouseclicks so it might not be useful in some cases
Games are meant to be created, not played...