Jump to content

Home

[TSL] My conditional scripting woes


Robespierre

Recommended Posts

Well, I've tried and tried to get this conditional script to work, but for all my efforts, I get nothing. The dialog option is there regardless of whether or not the item is in my inventory. Here's the script:

 

int StartingConditional() {

{
GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "pl_visa"));
	return TRUE; 
}
return FALSE;

}

 

Can someone help me out?

Link to comment
Share on other sites

So the dialogue option must show up if pl_visa is in your inventory?

 

int StartingConditional() {

if(GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "pl_visa")))
      {
	return TRUE;
}
else {return FALSE}

}

 

This should work... Basically, in your script, you ask for a condition ("Does my PC have pl_visa with him?"), but you don't use the result of this condition. You directly tell it to "return TRUE". That's the way I understand it anyway. Tell me if it worked!

Link to comment
Share on other sites

Well, I've tried and tried to get this conditional script to work, but for all my efforts, I get nothing. The dialog option is there regardless of whether or not the item is in my inventory. Here's the script:

 

Your script is always returning TRUE since the first return statement isn't wrapped inside any conditional check. Either use an if-statement, or return the result from your item check directly. Like:

 

int StartingConditional() {
   return GetIsObjectValid(GetItemPossessedBy(GetFirstPC(), "pl_visa"));
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...