I am needing to add two additional lines of code to the block below, but I don't really know where to get them from. I want to add a specific key "PARKEY" to open it, and set the lock difficulty to 100. I was considering writing code to lock the door too, but should be able to do that with scripting since I am going to add .cres to the area anyways.
Is there an example of adding a key and setting the lock difficulty out there?
// makes doors actually require keys that they are listed as requiring
COPY_EXISTING ~AR2600.ARE~ ~override~
READ_LONG 0xa4 "door_num"
READ_LONG 0xa8 "door_off"
WHILE ("%door_num%" > 0) BEGIN
SET "door_num" = ("%door_num%" - 1)
READ_ASCII ("%door_off%" + ("%door_num%" * 0xc8)) "doorname"
READ_BYTE ("%door_off%" + 0x29 + ("%door_num%" * 0xc8)) "usekey"
PATCH_IF ((("%doorname%" STRING_COMPARE_CASE "DOOR02" = 0))
AND ("%usekey%" BOR 0b11111011 = 0b11111011)) BEGIN
WRITE_BYTE ("%door_off%" + 0x29 + ("%door_num%" * 0xc8)) ("%usekey%" BOR 0b00000100) // sets uses key bit
END
END
BUT_ONLY_IF_IT_CHANGES
Sticz