Jump to content

Home

[TSL] Parameters


Soulforged

Recommended Posts

I'm looking into scripts now. I basically understand how they function, but there's somethings that I still don't understand. For example:

 

// Checks the level and alignment of the PC for the Kreia prestige class scripts.

// Had to be done as a seperate script because ran out of conditional slots to do properly.

// Param1 = Level to be checked (inclusive)

 

int StartingConditional()

{

 

// What's the PC level you're checking for?

int nCompareAmount = GetScriptParameter( 1 );

 

// What value does the player have to be equal to or more evil than?

int nAlignLow = GetScriptParameter( 2 );

 

// What value does the player have to be equal to or more good than?

int nAlignHigh = GetScriptParameter( 3 );

 

// What's the PC alignment?

int nAlign = GetGlobalNumber( "G_PC_Align_Val" );

 

// What's the PC's level?

int nLevel = GetHitDice( GetFirstPC () );

 

// If PC's level is greater than or equal to Param1, return TRUE.

// AND if their alignment is less than Param 2 (they're really evil) or greater than Param 3 (they're really good).

if ( ( nLevel >= nCompareAmount ) && ( ( nAlign <= nAlignLow ) || ( nAlign >= nAlignHigh ) ) ) return TRUE;

else return FALSE;

 

}

This is from c_pc_prestige.nss sourse script. Now if I understood it correctly Param 1 is stolen from someother place, but I don't know where that place is? Or is the Param set on the same script? Or in another script?

 

Why do I ask this? Well I'm trying to reduce Kotor II to level 20 max. and I know some events are attached to your global character level. So I was wondering if I could change those parameters to reflect my other changes so far. I was thinking to set it on level 7 and leave the alignment requirement as it is but I just can't figure from where the game extracts all this parameters spread through several scripts.

 

Can anyone help me on this one? Are they on the "nwscript.nss" script?

 

Also if anyone could tell me what other events are tied to PC level, that would be great. Thanks.

Link to comment
Share on other sites

This is from c_pc_prestige.nss sourse script. Now if I understood it correctly Param 1 is stolen from someother place, but I don't know where that place is? Or is the Param set on the same script? Or in another script?

 

That script is a dialog conditional script, which returns TRUE or FALSE to determine if the dialog node it is attached to should be visible (if a Reply node) or used (if an Entry node).

 

The GetScriptParameter() function is used to retrieve the values of the five numerical script parameter values that can be set on a dialog node (in the DLG file) for a conditional script. Those slots are indexed from 1 to 5, and you specify the parameter index of the value you want returned as parameter to the function. If you use tk102's dialog editor those parameter fields are labeled P1 to P5.

 

In the script you posted it checks the level and alignment of the main character against specified values. The P1 is set to the character level the player must have reached, P2 is set to the Light/Dark alignment (0-100) value the player must be at or below, and P3 is set to the Light/Dark alignment (0-100) value the player must be at or above. The P2 and P3 is mutually exclusive, so of course only one of them have to be true. :)

 

So, if you set...

P1 = 15

P2 = 0

P3 = 100

...on the dialog node using the c_pc_prestige conditional script that dialog node would only be available if the main character is at least level 15 and either has Lightside mastery or Darkside mastery.

Link to comment
Share on other sites

That script is a dialog conditional script, which returns TRUE or FALSE to determine if the dialog node it is attached to should be visible (if a Reply node) or used (if an Entry node).

 

The GetScriptParameter() function is used to retrieve the values of the five numerical script parameter values that can be set on a dialog node (in the DLG file) for a conditional script. Those slots are indexed from 1 to 5, and you specify the parameter index of the value you want returned as parameter to the function. If you use tk102's dialog editor those parameter fields are labeled P1 to P5.

 

In the script you posted it checks the level and alignment of the main character against specified values. The P1 is set to the character level the player must have reached, P2 is set to the Light/Dark alignment (0-100) value the player must be at or below, and P3 is set to the Light/Dark alignment (0-100) value the player must be at or above. The P2 and P3 is mutually exclusive, so of course only one of them have to be true. :)

 

So, if you set...

P1 = 15

P2 = 0

P3 = 100

...on the dialog node using the c_pc_prestige conditional script that dialog node would only be available if the main character is at least level 15 and either has Lightside mastery or Darkside mastery.

Thank you very much!! :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...