Set/Get Local Int
Zephirius
Member Posts: 419
Ok...
1. The PC first reads a book (uses the placeable) and sets a local int on the PC.
2. Travel to the door where the Local Int script is placed - OK. "Door code" -
Nothing is doing. Door still locked.
I'm uncertain which handler to use at this point. I've tried all of the pertinent ones that I can think of.
Note: The door is marked as having a key required to open. Purposefully no key exists. I just wanted it to be locked absolutely. I don't think a key is required as the code should supersede the lock flags. At least that is the way I understand it...
This is where I bow out...
1. The PC first reads a book (uses the placeable) and sets a local int on the PC.
SetLocalInt(oPC, "council_six", 1);At this point the PC should be wandering the desolate tomb with a giant "1" on her forehead!
2. Travel to the door where the Local Int script is placed - OK. "Door code" -
void main() { object oPC = GetLastOpenedBy(); if (!GetIsPC(oPC)) return; if (GetLocked(OBJECT_SELF) == TRUE) { if (GetLocalInt(oPC, "council_six") == 1) { SetLocked(OBJECT_SELF, FALSE); AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_DOOR_OPEN1)); } } }
Nothing is doing. Door still locked.
I'm uncertain which handler to use at this point. I've tried all of the pertinent ones that I can think of.
Note: The door is marked as having a key required to open. Purposefully no key exists. I just wanted it to be locked absolutely. I don't think a key is required as the code should supersede the lock flags. At least that is the way I understand it...
This is where I bow out...
Post edited by Zephirius on
0
Comments
TR
Thanks for the help TarortRedhand.
TR
Proleric had the answer all along in this thread. OnFailToOpen tells us that GetClickingObject() is the function to use. "Proleric"
In case there are still novices out there - I very much consider myself a novice-Using the OnFailToOpenhandler with GetClickingObject(), the final code should read:
So everything is copasetic as it stands. Thank guys!
wtf copasetic?
... disappears ...
...and with no one immediately in distress, like a phantom - he's gone. "Whoosh"