Robespierre Posted June 22, 2008 Share Posted June 22, 2008 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 More sharing options...
Gavroche Posted June 22, 2008 Share Posted June 22, 2008 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 More sharing options...
stoffe Posted June 22, 2008 Share Posted June 22, 2008 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 More sharing options...
Robespierre Posted June 23, 2008 Author Share Posted June 23, 2008 Ah wonderful. Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.