Making a door check for an item
This is probably the simplest thing in the world, but I'm clueless (again). I'm trying to make a door start a conversation with the PC; this part I got. Next, check the PCs inventory for a particular item, a guild insignia. If the PC has it, teleport the PC to the waypoint (WP_INSIDE_GUILDHOUSE_001) inside the guild house. If he doesn't have the item, deny access and say something silly in the conversation like, "Bugger off! Ye ain't allowed in!".
Another thing, this is with the conversation editor. I don't know how to make different text for options, such as the above. Where the conversation has 3 outcomes:
1.) (Checks inventory & HAS the item) "Yes, I have the item."
2.) (Checks inventory & DOESN'T have the item) "No, I don't have the item."
3.) Do nothing & walk away.
I searched the lexicon for "Talking Doors" and nothing showed up.
Also, have the PC KEEP the item used to enter the guild house.
Another thing, this is with the conversation editor. I don't know how to make different text for options, such as the above. Where the conversation has 3 outcomes:
1.) (Checks inventory & HAS the item) "Yes, I have the item."
2.) (Checks inventory & DOESN'T have the item) "No, I don't have the item."
3.) Do nothing & walk away.
I searched the lexicon for "Talking Doors" and nothing showed up.
Also, have the PC KEEP the item used to enter the guild house.
0
Comments
//int's are whole numbers. Can be both negative and positive. Since this is old. There are no boeans(true or false). So any positive (above 0) is true, and 0 is false. Int StartingConditional() { object player = GetLastSpeaker(); object item = GetFirstItemInInventory(pc); //literally item is equal to the first item in inventory. //saves the first item onto the variable while(GetIsObjectValid(item)) //while loop function. Literally keeps repeating everything //between the { } under it until the condition is false { If(GetTag(item) == "whatever tag you gave it") { return TRUE; //this function is essentially a variable, like the objects above. //This basically gives a value to the variable, and stops reading the rest of this functions code. //Return = stop reading lines in function, and return to previous operation. } Item = GetNExtItemInInventory(); // finds the item after whatever the previous item was } return FALSE; //once the above code finally finds an inventory slot with no valid item. The very next line is run. Which happens to return false. }Something I've found useful is to see how the OC did stuff like this. You just copy the appropriate chapter of the OC to the "modules" folder and then rename the extension to .mod so that the toolset can "see" it. You can then open the OC, open the area where you know it did something similar and see how it was done so you can copy and adapt it.
I'm assuming this is for multi-player because the simplest way of doing it for single-player is just to use the guild token as the key to unlock the door.
One way of doing it for multi-player is to allow anyone to open the door but then use the OnTransitionClick to deny non-members entry to the building, optionally with a message.
Another way is to use the OnFailToOpen script to check if the person attempting to open the door is holding the guild token and if they are, send the person inside the guild.
Both of these approaches to the problem are simpler to script and also faster for the player than having to go into a conversation.
NwN Lexicon 1.69 - Searchable chm document with all the pre-EE script functions explained.
Online lexicon list and explanation of all the new EE functions.
Just The FAQs, ma'am - Contains the scripting Frequently Asked Questions (with answers) in pdf format.
TR