Jump to content


Photo

Question to Unlock("doorname")


13 replies to this topic

#1 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 20 March 2017 - 11:40 PM

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?



#2 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 21 March 2017 - 09:39 AM

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?


Edited by Roxanne, 21 March 2017 - 09:49 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 21 March 2017 - 10:39 AM

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.


Edited by jastey, 21 March 2017 - 10:40 AM.


#4 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 21 March 2017 - 10:49 AM

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?


Edited by Roxanne, 21 March 2017 - 10:53 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#5 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 21 March 2017 - 10:56 AM

That would be the same effort, yes. How would I change the flags of the door with weidu?



#6 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 21 March 2017 - 11:28 AM

COPY_EXISTING ~bg1000.are~ ~override~    //you may want something like "%UlgothsBeard%.are?
WRITE_LONG 0x4184 0 
BUT_ONLY


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#7 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 21 March 2017 - 12:20 PM

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.)



#8 Roxanne

Roxanne
  • Modders
  • 1576 posts
  • Gender:Not Telling

Posted 21 March 2017 - 12:27 PM

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.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#9 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2551 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 21 March 2017 - 12:37 PM

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

Edited by Ardanis, 21 March 2017 - 12:38 PM.

"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#10 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 21 March 2017 - 09:18 PM

Thank you! This is great, because I need code for all BG1 games, anyway.

 

Thank you both!



#11 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 21 March 2017 - 10:52 PM

Ardanis: weidu gives me a parse error for the ` in the WRITE_BYTE line, and I don't know enough about this to know whether I should change it to ' or just delete it or what to do to fix it without breaking the are. :cry:



#12 Gwendolyne

Gwendolyne
  • Members
  • 151 posts
  • Gender:Male
  • Location:France

Posted 21 March 2017 - 11:45 PM

If you have problems with typing ` with the keyboard, use this :

WRITE_LONG r+0x28 (THIS BAND BNOT BIT1)

CARPE DIEM...



In progress : Menace sur le Royaume de Diamant Éternel

#13 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2551 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 22 March 2017 - 12:54 AM

No, it's just me mistyping it as

THIS `& BIT1

instead of
THIS & `BIT1

:D


Edited by Ardanis, 22 March 2017 - 12:55 AM.

"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#14 jastey

jastey
  • Gibberlings
  • 6896 posts
  • Gender:Female

Posted 22 March 2017 - 04:36 AM

Now it works!

Thank you both.





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users