Open/close door by code

+
Open/close door by code

Hello, I need a bit of help, I would need to know if these 2 things can be done and how.1) Open/close doors (and chests) by code lines and not involving keys2) Check if a container has a determinated item (the function to ask for an item tag)I haven't touched D'jinni in months but I had an idea.... ;D Thanks for the help in advance!!!
 
I'll try to answer myslef a part of the question.... digging NWN functions I found this:
// Unlocked an object with the tag DOOR_TAGvoid main(){ object oDoor = GetObjectByTag("DOOR_TAG"); SetLocked(oDoor, FALSE);}
Is that ok for D'jinni too? ???
 
seems like it would work, but i'm curious, why would you need this anyway ? i guess i'd need a scenario to get my brain around your question ....
 
I can only tell a 'puzzle' ;D What about the checking contents of a container? I want the player to have put certain items in certain containers.... I saw the 'inventorydisturb' trigger, would that do? :angel:Thanks!!!
 
if you make your containers into "storage" (by setting "is storage" to True) would that not achieve the same thing without a script ? That way you can even take stuff out again
 
I believe arkray wants to create a puzzle in which the player has to put specific items in specific containers, and only then will a door be unlocked.Yes, SetLocked should do. As for the OnInventoryDisturbed action, this might be of help:void main() { object oItem = GetInventoryDisturbItem(); int nAction = GetInventoryDisturbType(); if (nAction == INVENTORY_DISTURB_TYPE_ADDED && CompareTag(GetTag(oItem),"item_tag_here",TRUE) { SetLocked(GetObjectByTag("puzzle_door"),FALSE); SpeakString("*click*"); }}
 
Ailinon said:
I believe arkray wants to create a puzzle in which the player has to put specific items in specific containers, and only then will a door be unlocked.Yes, SetLocked should do. As for the OnInventoryDisturbed action, this might be of help:void main() { object oItem = GetInventoryDisturbItem(); int nAction = GetInventoryDisturbType(); if (nAction == INVENTORY_DISTURB_TYPE_ADDED && CompareTag(GetTag(oItem),"item_tag_here",TRUE) { SetLocked(GetObjectByTag("puzzle_door"),FALSE); SpeakString("*click*"); }}
THANK YOU!!!!!! That is what I need!!! Or aproximately, because the number of puzzles is increasing :whistle: I have a friend who is writing the clues. :peace: speakstring function will be useful too if it does what I think it does, make inanimated objects display a message.
 
But if you use the SpeakString function how can you do for translating the string in others languages without modify the script?bye
 
Errr, that would be impossible, it is being written in English for especific reasons.... sorry. You'll know why if I ever complete it.
 
OOOOOOOK!I have a problem, Ican't make a placeable to store items... I even assigned an storage template in the store part, set usable when empty to true and nothing... I can't put things inside the container... any help please?What I would actually want is something similar to the sephirots thing, where every pylon only accepted a sephi...Thanks!
 
Top Bottom