Jump to content

Question to Unlock("doorname")


jastey

Recommended Posts

For Gavin BG1, in Ulgoth's Beard the Door to the house (AR1007.are) should be unlocked. The area script of the main area (AR1000.bcs) runs the block:

/* Unlocking the door to the Mor home */

IF
  AreaCheck("%UlgothsBeard%")
  Global("B!UnlockDoor","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("Door1007")
    SetGlobal("B!UnlockDoor","GLOBAL",1)
END

Variable "B!UnlockDoor" is set to "1", when I look with NI at door Door1007 it says "no flags set" (i.e. not locked), but when I try the door in the game (new game, never been to the area, mod is installed), the door is locked and I need thieving skills to unlock it.

Did I miss something obvious?

Link to comment

For Gavin BG1, in Ulgoth's Beard the Door to the house (AR1007.are) should be unlocked. The area script of the main area (AR1000.bcs) runs the block:

/* Unlocking the door to the Mor home */

IF
  AreaCheck("%UlgothsBeard%")
  Global("B!UnlockDoor","GLOBAL",0)
THEN
  RESPONSE #100
    Unlock("Door1007")
    SetGlobal("B!UnlockDoor","GLOBAL",1)
END

Variable "B!UnlockDoor" is set to "1", when I look with NI at door Door1007 it says "no flags set" (i.e. not locked), but when I try the door in the game (new game, never been to the area, mod is installed), the door is locked and I need thieving skills to unlock it.

Did I miss something obvious?

Not obvious - took me a bit to find it.

There are two objects Door1007 in the area (Door itself and travel trigger).

I renamed the door to Dor1007

and

IF

AreaCheck("%UlgothsBeard%")

Global("B!UnlockDoor","GLOBAL",0)

THEN

RESPONSE #100

Unlock("Dor1007")

SetGlobal("B!UnlockDoor","GLOBAL",1)

END

 

And it works.

You need to test yourself as I did that on an EET install in BG1000. Anyway, EET without this change has the same issue.

 

PS - at least in EET it is pointless nevertheless as the parents are not spawned?

Link to comment

Thank you! I will try it out. EDIT: What do you man with remaned the door?

The parents will be spawned in v10, as will the door unlock be fixed. Hopefully.

Rename the door means change the attributes for *Name* and *Door ID* in Door4 object in the are-file. (offset 415c and 417c).

 

But...

 

As it means that you will need to change something in the are-file anyway, you might as well consider to change the flags of that door to unlocked right away and skip the script?

Link to comment

That worked like a charm! Thanks! Only I noticed that for bgt, the hex offset of that door is different. Can I assume the offset of the door will always be the same for all bgt installs? (Or maybe for bgt the script worked - I'll have to check that.)

Link to comment

That worked like a charm! Thanks! Only I noticed that for bgt, the hex offset of that door is different. Can I assume the offset of the door will always be the same for all bgt installs? (Or maybe for bgt the script worked - I'll have to check that.)

In BGT (in different installs) I always have it at 4524.

Link to comment

If you want to be absolutely certain, then

COPY_EXISTING ar1000.are override
  GET_OFFSET_ARRAY doors 0xa8 4 0xa4 4 0 0 0xc8
  PHP_EACH doors AS i => r BEGIN
    READ_ASCII r+0x20 id (8)
    PATCH_IF ~%id%~ STRING_EQUAL_CASE ~door1007~ BEGIN
      WRITE_BYTE r+0x28 THIS `& BIT1
    END
  END
BUT_ONLY
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...