Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

[TSL] Parameters

Page: 1 of 1
 Soulforged
11-28-2006, 12:18 AM
#1
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.
 stoffe
11-28-2006, 8:17 AM
#2
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.
 Soulforged
11-29-2006, 9:34 PM
#3
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!! :)
Page: 1 of 1