View previous topic :: View next topic |
Author |
Message |
Argonn
Joined: 03 May 2010 Posts: 13
|
Posted: Mon May 03, 2010 9:43 Post subject: Print Command NWNX2 |
|
|
Goodmorning
Im searching for some help with the following matter, the print command.
What i need is a print from the file ( bic ) into a NWN variable inside a nwn script.
I need to do some calc on these values but all i get from the print command is a '0' symbol
My string looks like
string Script =
"$RealFile = q<" + BicPath + "> + FindNewestBic q<" + BicPath + [color=red]">;" +
"%bic = $RealFile + '.utc';" +
"$Return = /FirstName;" +
"%bic = '>';" +
"close %bic;";
LetoScript(Script);
return LetoScript("print $Return;");
Anyone ? |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Mon May 03, 2010 10:03 Post subject: |
|
|
Code: | string Script =
"$RealFile = q<" + BicPath + "> + FindNewestBic q<" + BicPath + ">;" +
"%bic = $RealFile + '.utc';" +
"$Return = /FirstName;" +
"%bic = '>';" +
"close %bic;"+
"print $Return;";
return LetoScript( string ); |
Perhaps?
Or see this thread: http://www.nwnx.org/phpBB2/viewtopic.php?t=1523 _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
Argonn
Joined: 03 May 2010 Posts: 13
|
Posted: Mon May 03, 2010 14:58 Post subject: |
|
|
Darn thnx for you fast reply =D
I will put it to the test, although i have tested it with :
Code: | string sLastName = LetoScript("print 'bert';"); |
And still getting a '0' value. Do you know anything of it being broken ( like in nwnx4 ? ) |
|
Back to top |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Tue May 04, 2010 15:42 Post subject: |
|
|
Instead of /FirstName, try /FirstName/0. FirstName is a "CExoLocString", meaning it can have multiple values for different languages. /FirstName/0 is the English version. The same applies for /LastName and /Description. |
|
Back to top |
|
|
Argonn
Joined: 03 May 2010 Posts: 13
|
Posted: Tue May 04, 2010 15:50 Post subject: |
|
|
That doenst seems to be working ( from Moneo that is )
Code: | Moneo> %file = 'D:\Priv\NWN\servervault\AccountName\meram.bic' or die;
Moneo> /LastName/0 = 'Test';
[Error] Can't modify /field in scalar assignment at - line 1 pos 13.
Moneo> print /FirstName/0;
[Warning] Use of undefined value in print at - line 1 pos 7.
Moneo> print /LastName/0;
[Warning] Use of undefined value in print at - line 1 pos 7.
Moneo> |
|
|
Back to top |
|
|
|