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.

How to pass parameters to a script from a dialog ??

Page: 1 of 1
 Pontifice
02-02-2005, 5:16 AM
#1
Someone knows how to pass parameters to a script from a dialog ???


Thank you
 Darkkender
02-02-2005, 5:48 AM
#2
What do you mean by paramaters? Such as if the script returns true to have it say so?
 Pontifice
02-02-2005, 6:02 AM
#3
No.

I want to know if it is possible to pass a value to a script from the dialog.

I am searching a way to use less scripts in a complex dialog, i want to know from where ( the path i choose in the dialog ) i called the script.

An example:

int main(int parameter){

switch(parameter){
case '1':
( something )
break;
case '2':
( something 2)
break;
default:
( something 3)

}

}



I suppouse i could use Local parameters but i don't know
 tk102
02-02-2005, 6:09 AM
#4
You can't pass parameters directly, but you can use the Set/GetLocalNumber functions to accomplish the same thing.

To go the other way, there is a function called something like SetCustomToken that allows you to set a dialog token string from a script.
 Pontifice
02-02-2005, 6:13 AM
#5
Thanks to both of you.

Very useful information :D ( the token thing was my next question )
 Pontifice
02-05-2005, 1:06 AM
#6
It seems that dialogs in kotor2 can pass parameters.

There are dialog entries called ActionParamX ( X is a number ) ActionParamXb and ActionParamStrA/B.

And in nwnscript.nss:

// DJS-OEI
// 768. GetScriptParameter
// This function will take the index of a script parameter
// and return the value associated with it. The index
// of the first parameter is 1.
int GetScriptParameter( int nIndex );
Page: 1 of 1