Jump to content

Home

Scripts I need


Elven6

Recommended Posts

I am working on a mod and I need a few scripts for it that I cannot find in the tutorials. I also need to know where to put them lol

 

I need one to initiate pazzak, a warping script and I need one that initiates a conversation line ONLY when the PC has a certain item with him.

Link to comment
Share on other sites

For the availability of a dialog line based on if the PC has an item you would use this:

int StartingConditional()
{
sTag=GetScriptStringParameter();
int iResult = 0;
object oPC = GetFirstPC();
object oItem;
for(int i = 0;i<a;i++)
{
oItem = GetNextItemInInventory(oPC);
if(GetTag(oItem)sTag)
{
iResult=1;
return iResult
}
}
return iResult
}

You have to set a to the number of inventory slots which i dont know how to do. Also if you are looking for scripting functions use kotor tool to look them up in the text editor.

If you are using TK102s GUI dialog editor then when clicking on the correct node in the tree at the bottom under Conditional put the script name and then the tag of the item under the string parameter. Put the actual script file in override.

Link to comment
Share on other sites

For the availability of a dialog line based on if the PC has an item you would use this:

(snip)

 

If you know the tag of the item you don't have to loop through the player's inventory to see if they have the item. This should be enough:

 

int StartingConditional() {
   string sTag = GetScriptStringParameter();
   return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), sTag));
}

Link to comment
Share on other sites

But where would I put it? I am using the dlgeditor you get off the Holowan site, their is a box for conditionals and one for scripts. I looked throught previous dialouges for mods made by other people and they only had a few characters in them.

 

Using the code stroffe gave were would I put the name of the item?

Link to comment
Share on other sites

Using the code stroffe gave were would I put the name of the item?

Put it in the StringParam field for Conditional #1

 

717f863a.jpg

where "elven6_itemchk" is the name of the script stoffe -mkb- gave above, and "elven6_item_tag" is the tag name of the item you want to check for. The conditional script will return TRUE if the PC possesses the item (allowing the dialog to initiate).

Link to comment
Share on other sites

Were does the script go? When I put it into the Script 1 or 2 box it gets cut after i click away

 

like int StartingConditional() {

string sTag = GetScriptStringParameter();

return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), sTag));

}

 

Becomes

int StartingCon

int StartingCon

Link to comment
Share on other sites

Ok I compiled the script and I entered a tag, but the thing is the dialouge dosen't appear. I also need one that will make a dialouge line disappear after the conversation is over.

 

Edit: I made a scripting tutorial, its on my website under Tutorials so if anyone needs help check it out

 

http://www.freewebs.com/kotorstuff/

 

I am closing this redundant thread, please continue any and all of your many scripting questions here. -RH

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...