Jump to content

Home

Credit Script


HK-42

Recommended Posts

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

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

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

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

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

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

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

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

Archived

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

×
×
  • Create New...