current_item_count_change
Global of Kamidori Alchemy Meister: the cell G:0x2d2847, of type int, choice-output, values signed count; a negative one takes items away.
ADDITEM's second argument, beside current_item_id: ADDITEM@0x00016 adds it to item_inventory_counts[current_item_id], clamps the count at 0 (ADDITEM@0x00024) and pays a count past 999 out as money (ADDITEM@0x00041). About 70 scripts use it, setting it before call-script ADDITEM; ADDSTOCK reads it too. The base mod's give_item helper sets it and puts it back.
OME’s registry gives it with high confidence, from investigation. The base mod kamidori-base exports the name, so Lua and an event’s fields can use it.
Scripts that use it
The game’s scripts whose instructions read, write or index (take as an array’s base) the cell, with how many of their operands do each, from OME’s script index.
| Script | Reads | Writes | Indexes |
|---|---|---|---|
$3$SC2920 | 0 | 11 | 0 |
SC1160 | 0 | 8 | 0 |
$3$SC2910 | 0 | 7 | 0 |
$3$SC2960 | 0 | 7 | 0 |
$3$SC2940 | 0 | 6 | 0 |
$3$SC2950 | 0 | 6 | 0 |
SC0740 | 0 | 6 | 0 |
SC0800 | 0 | 5 | 0 |
SC0000 | 0 | 4 | 0 |
SC0750 | 0 | 4 | 0 |
$3$SC2930 | 0 | 3 | 0 |
ADDSTOCK | 3 | 0 | 0 |
FELLOW | 0 | 3 | 0 |
FIELD | 0 | 3 | 0 |
GAMESTART | 0 | 3 | 0 |
SC1520 | 0 | 3 | 0 |
$3$SC2900 | 0 | 2 | 0 |
DEBUGADV | 0 | 2 | 0 |
DEBUGMAP | 0 | 2 | 0 |
SC0320 | 0 | 2 | 0 |
SC0700 | 0 | 2 | 0 |
SC0760 | 0 | 2 | 0 |
SC1060 | 0 | 2 | 0 |
SC1150 | 0 | 2 | 0 |
SC1250 | 0 | 2 | 0 |
SC1270 | 0 | 2 | 0 |
SC1280 | 0 | 2 | 0 |
SC1390 | 0 | 2 | 0 |
SC1600 | 0 | 2 | 0 |
SC3550 | 0 | 2 | 0 |
SHOP | 0 | 2 | 0 |
UNITECH | 0 | 2 | 0 |
$1$SC2630 | 0 | 1 | 0 |
$2$SC2700 | 0 | 1 | 0 |
ADDITEM | 1 | 0 | 0 |
ALCHEMY | 0 | 1 | 0 |
ARRANGE | 0 | 1 | 0 |
CHECKIMPROVE | 0 | 1 | 0 |
DEBUGAM | 0 | 1 | 0 |
DEBUGMAP2 | 0 | 1 | 0 |
ENHANCE | 0 | 1 | 0 |
INVITECH | 0 | 1 | 0 |
RECEIPT | 0 | 1 | 0 |
REWARD | 0 | 1 | 0 |
SC0050 | 0 | 1 | 0 |
SC0170 | 0 | 1 | 0 |
SC0470 | 0 | 1 | 0 |
SC0500 | 0 | 1 | 0 |
SC0510 | 0 | 1 | 0 |
SC0560 | 0 | 1 | 0 |
SC0580 | 0 | 1 | 0 |
SC0710 | 0 | 1 | 0 |
SC0830 | 0 | 1 | 0 |
SC0900 | 0 | 1 | 0 |
SC1020 | 0 | 1 | 0 |
SC1090 | 0 | 1 | 0 |
SC1100 | 0 | 1 | 0 |
SC1170 | 0 | 1 | 0 |
SC1190 | 0 | 1 | 0 |
SC1290 | 0 | 1 | 0 |
SC1300 | 0 | 1 | 0 |
SC1500 | 0 | 1 | 0 |
SC1510 | 0 | 1 | 0 |
SC1730 | 0 | 1 | 0 |
SC1800 | 0 | 1 | 0 |
SC2020 | 0 | 1 | 0 |
SC4520 | 0 | 1 | 0 |
SC6150 | 0 | 1 | 0 |
SETSTUDIO | 0 | 1 | 0 |
STAGECLEAR | 0 | 1 | 0 |