How to restrict the use of item groups not specified by itemtype
fortyseven
Member Posts: 96
Hi I'm trying to restrict a new kit from using all items flagged as magical. Does anyone have a creative idea how that could be achieved without having to implement a vast list that covers all magical items in the game via opcode 180? I initially tried to use opcode 181but there is no itemtype i believe that fits my requirements. Maybe opcode 319 could somehow be used for this but I have no idea how. My hunch is this is a dead end but I wanted to ask before writing it off entirely.
0
Comments
Just keep in mind that bits are read from right to left.
And yeah all you have to do is including it in your WeiDu file. Make sure to paste the block after the part where you actually add the kit. I put them in the wrong order once and it took me 30min to figure the issue... Kinda felt stupid afterwards
In state 961, I expected one of these tokens:
[0] EOF
[48] BEGIN
Parse error (state 961) at END
[MYMOD/SETUP-MYMOD.TP2] PARSE ERROR at line (line of 3rd END) column 1-5
Near Text: END
GLR parse error
[MYMOD/SETUP-MYMOD.TP2] PARSE ERROR at line (line of 3rd END) column 1-5
Near Text: END
Parsing.Parse_error
ERROR: parsing [MYMOD/SETUP-MYMOD.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [MYMOD/SETUP-MYMOD.TP2]: Parsing.Parse_error
FATAL ERROR: Parsing.Parse_error
I removed the 3rd END and the WeiDU file will execute again and install everything without any error but now the kit has all items restricted irrespective of their magical flag. Any ideas how this could be solved?
This is probably daft, but when you check if bit number 6 is 1 in line 4 of your code, where is 6 represented? the flag reads 1 and then there is 0b0010000 which if binary does not read as 6 more like 16 or 32 maybe?
Bit 6 is represented by the 1 in 0b00100000. They are read right to left, right one being bit 1, all the way up to left one being bit 8. 0b means it's a binary number.
But that's actually where my mistake lies: Magical flag is indeed bit 6, but the rightmost bit is bit 0, not bit 1. So here it was testing the "Not Copyable" flag (bit 5) instead. Replace 0b00100000 by 0b01000000 and you should be fine