logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Print Command NWNX2

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Argonn



Joined: 03 May 2010
Posts: 13

PostPosted: Mon May 03, 2010 9:43    Post subject: Print Command NWNX2 Reply with quote

Goodmorning Smile

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
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Mon May 03, 2010 10:03    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Argonn



Joined: 03 May 2010
Posts: 13

PostPosted: Mon May 03, 2010 14:58    Post subject: Reply with quote

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
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue May 04, 2010 15:42    Post subject: Reply with quote

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
View user's profile Send private message
Argonn



Joined: 03 May 2010
Posts: 13

PostPosted: Tue May 04, 2010 15:50    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group