Jump to content

Home

How to create a key to open a door


Pavlos

Recommended Posts

I can't find this one. Is it possible to create a key to open certain doors, like in Khoonda with the Security door key? And also what is the script for giving an item in a conversation. And on top of that (lol getting longer) how do I script that a certain conversation option is available if the PC has weapons equipped- So you may be told to relinquish your weapons if you have them out.

Link to comment
Share on other sites

yes , it's possible: make a plot item that will be your key (.uti file). Then, go to your .utd file and in the lock tab, check the box: key required to unlock or lock and insert the tag of the key. Yoiu could also attach a script that checks if you have the item in your inventory.

 

And also what is the script for giving an item in a conversation.

To give an item to your PC:

void main()
{
 CreateItemOnObject("myitem",GetFirstPC());
}

or


void main()
{
   object oPC = GetPCSpeaker();
   object oItem = GetItemPossessedBy(GetObjectByTag("npc_tag", "item_resref");
   ActionGiveItem(oItem, oPC);
}

 

 

And on top of that (lol getting longer) how do I script that a certain conversation option is available if the PC has weapons equipped- So you may be told to relinquish your weapons if you have them out.

int StartingConditional()
{
   object oPC= GetPCSpeaker(); 
   //check the slots in nwscript.nss
   object oItem = GetItemInSlot( INVENTORY_SLOT_*, oPC);

   if (GetIsObjectValid(oItem)

   {
       return TRUE;
   }
   return FALSE;
}

More here: http://www.lucasforums.com/showthread.php?t=154032

 

There are other ways of doing this depending on your needs but I don't have time right now. Try using the search function for this: there are tons of threads discussing this.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...