Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: Sticz
« on: August 23, 2006, 10:30:14 AM »

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