I want to control whether a door is locked or not locked via script.
However, I don't seem to be able to find any functions that will allow me to do this - the only ones I can see are GetPlaceablePickLockLevel or UT_OpenDoor. Obviously neither of these are particularly helpful.
My aim is to keep a player inside a certain area until he/she has completed a certain task. Now, while I could simply set doors to be non-interactive, that isn't a particularly intuitive option, and there's no simple way to point out to the player when the door becomes interactive.
Control Door Lock Status?
Débuté par
AmstradHero
, déc. 28 2009 11:55
#1
Posté 28 décembre 2009 - 11:55
#2
Posté 29 décembre 2009 - 12:45
#3
Posté 29 décembre 2009 - 01:10
I used a trigger to lock the door behind the PC for the final boss fight of my module. This was the script I used in full:
#include "wrappers_h"
#include "events_h"
void main() {
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oDoor = GetObjectByTag("alpha_last_door");
SetPlaceableState(oDoor, PLC_STATE_DOOR_LOCKED);
DestroyObject(OBJECT_SELF);
break;
}
}
HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
}
#include "wrappers_h"
#include "events_h"
void main() {
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oDoor = GetObjectByTag("alpha_last_door");
SetPlaceableState(oDoor, PLC_STATE_DOOR_LOCKED);
DestroyObject(OBJECT_SELF);
break;
}
}
HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
}
Modifié par Mengtzu, 29 décembre 2009 - 01:17 .
#4
Posté 29 décembre 2009 - 02:29
Thank you very much. Obviously I must still be getting used to the differences between NWN2 and DAO! :-P





Retour en haut






