HK-42 Posted January 16, 2009 Share Posted January 16, 2009 Does anybody have a script that checks for your credit amount? I would like one. I know there is one that takes credits but how does it work if you dont have that much. Thanks! Link to comment Share on other sites More sharing options...
Star Admiral Posted January 16, 2009 Share Posted January 16, 2009 Does anybody have a script that checks for your credit amount? I would like one. I know there is one that takes credits but how does it work if you dont have that much. Thanks! I'm almost certain there is a built-in script, but I can't find it. Ah well, it is rather simple to create a custom one. Assuming this is for K1: int StartingConditional() { int nGold = GetGold( GetFirstPC() ); if( nGold >= xxx ) return TRUE; return FALSE; } This conditional script checks if you have xxx amount of gold or more. If you're just looking to get how much gold the player has, you can just use the GetGold() function. - Star Admiral Link to comment Share on other sites More sharing options...
HK-42 Posted January 16, 2009 Author Share Posted January 16, 2009 I'm almost certain there is a built-in script, but I can't find it. Ah well, it is rather simple to create a custom one. Assuming this is for K1: int StartingConditional() { int nGold = GetGold( GetFirstPC() ); if( nGold >= xxx ) return TRUE; return FALSE; } This conditional script checks if you have xxx amount of gold or more. If you're just looking to get how much gold the player has, you can just use the GetGold() function. - Star Admiral Thanks I will try it out. Link to comment Share on other sites More sharing options...
HK-42 Posted January 16, 2009 Author Share Posted January 16, 2009 One more thing. Could someone give me a conditional script that checks to see if a quest entry is activated and if it is display a different node of dialog instead of the main one. Link to comment Share on other sites More sharing options...
Star Admiral Posted January 16, 2009 Share Posted January 16, 2009 For quest entries, you can use the GetJournalEntry() function. The conditional script for the dialog file would look something like this. int StartingConditional() { if( GetJournalEntry( "xxx" ) == zzz ) return TRUE; return FALSE; } "xxx" refers to a string with the PlotID and zzz refers to the quest entry for that particular plot. - Star Admiral Link to comment Share on other sites More sharing options...
HK-42 Posted January 16, 2009 Author Share Posted January 16, 2009 For quest entries, you can use the GetJournalEntry() function. The conditional script for the dialog file would look something like this. int StartingConditional() { if( GetJournalEntry( "xxx" ) == zzz ) return TRUE; return FALSE; } "xxx" refers to a string with the PlotID and zzz refers to the quest entry for that particular plot. - Star Admiral Won't seem to work:(. What I'm trying to get it to do is after it says one thing of dialog I get the quest. But if I talk to that guy again I want to have that option disappear and select a diffenent option. I tried attacting this script to both of those 2 options and if attached to the one that gives the quest, the dialog that dosent always comes up, regardless if you have the quest or not. However if I attach it to the one that dosent give the quest, the quest one appears every time. Any ideas? Link to comment Share on other sites More sharing options...
Star Admiral Posted January 16, 2009 Share Posted January 16, 2009 How many nodes do you have in your dialog file? The best way to set it up would be something as follows. - Branch #1 (checks if the quest is there; NPC uses this branch if the quest doesn't exist) - Branch #2 (checks if the quest is there; NPC uses this branch if the quest already exists) - Branch #3 (generic branch that is used if all other branches return false) - Star Admiral Link to comment Share on other sites More sharing options...
HK-42 Posted January 16, 2009 Author Share Posted January 16, 2009 How many nodes do you have in your dialog file? The best way to set it up would be something as follows. - Branch #1 (checks if the quest is there; NPC uses this branch if the quest doesn't exist) - Branch #2 (checks if the quest is there; NPC uses this branch if the quest already exists) - Branch #3 (generic branch that is used if all other branches return false) - Star Admiral Alright I have 3 now. Quest NonQuest if already there Generic. Should I attach the script above to the first 2 or just one of them? Link to comment Share on other sites More sharing options...
Star Admiral Posted January 16, 2009 Share Posted January 16, 2009 Use this conditional for branch 1. int StartingConditional() { if( GetJournalEntry( "xxx" ) == 0 ) return TRUE; return FALSE; } Use this conditional for branch 2. int StartingConditional() { if( GetJournalEntry( "xxx" ) == zzz ) return TRUE; return FALSE; } And no conditionals for the generic branch. - Star Admiral Link to comment Share on other sites More sharing options...
HK-42 Posted January 16, 2009 Author Share Posted January 16, 2009 Use this conditional for branch 1. int StartingConditional() { if( GetJournalEntry( "xxx" ) == 0 ) return TRUE; return FALSE; } Use this conditional for branch 2. int StartingConditional() { if( GetJournalEntry( "xxx" ) == zzz ) return TRUE; return FALSE; } And no conditionals for the generic branch. - Star Admiral I got it to work. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.