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 
 
RunExternalScript() - Full Idea
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Tue Feb 01, 2005 10:50    Post subject: Reply with quote

Try ExecuteScript without .ncs in script name and also remove .ncs extension from your script that is to be loaded
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Tue Feb 01, 2005 21:11    Post subject: Reply with quote

Time to jump the next hurdle.......

Loading script !language_listen
o Critical error - script too large (>102400)

Is this an NWNX limit that can be raised?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue Feb 01, 2005 23:10    Post subject: Reply with quote

That is a limit set at compile time (100 KB). I noticed that is a bit too small and raised it to 512 KB in the resource manager plugin (see other thread). If you need an updated scripter plugin, I can compile one with a more relaxed limit for you (but I would rather not, since the upcoming resource manager does this so much better).
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Wed Feb 02, 2005 1:29    Post subject: Reply with quote

I can wait. I have many other things I can work on besides putting the Scripter plugin through its paces. So Scripter is going to be replaced by a more robust Resource Manager?
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Sat Feb 05, 2005 22:21    Post subject: Reply with quote

Ok I have done my other things Smile. Is the Resource Manager near release? If not I could probably use the scripter plugin recompiled with a higher size limit.
Back to top
View user's profile Send private message
Alosynth



Joined: 06 Jan 2005
Posts: 24

PostPosted: Sun Feb 06, 2005 2:04    Post subject: Reply with quote

Alosynth wrote:
I did have success with the demo module. I modified the nwnx.nss to report a different string and recompiled it with clcompile.exe all while the server was running and the client was connected. I was able to see the change in the string being sent to the PC immediatly after recompiling. Very Happy

One issue I came across in my brief testing was trying to point an impact script from the spells.2da to use an external script. I first modified the .2da to change the impact scripft from scriptname to !scriptname which would not call the script. The scripter log reported the following:
Code:

o Error - File not found: c:\NeverwinterNights\nwn\scripts\scriptname


Obviously, it wasn't sending the extension through so it was looking for scriptname instead of scriptname.ncs.

I then tried adding the .ncs to the scriptname in the in the 2da. I changed the entry to !scriptname.ncs. Doing this, I recieved a similar error in the log:
Code:

o Error - File not found: c:\NeverwinterNights\nwn\scripts\scriptname.


Finally, I tried surrounding the 2da entry with quotes, "!scriptname.ncs", hoping it would then pass the extension through. Unforutnalty, I get the exact same error as above, it sees scriptname. but not the ncs.

Would it be possible to have the plugin assume .ncs if no extension is given?


Just an update on this. I noticed today my problem here had nothing to do with trying to use an external script as an impact script, rather it had to do with the length of the script name.

It seems that the information that gets passed along with ExecuteScript() only uses the first 16 characters it comes across. In the above case, the actual script name I was using was "ul_skills_mast" (14 characters). The string that went into execute script was (or in this case the 2da) was "!ul_skills_mast.ncs" (19 characters).

So, the ExecuteScript only uses the first 16 characters ("!ul_skills_mast.") and the scripter plugin strips off the ! when it looks for the file, leaving "ul_skills_mast." as the file name to look for.

In otherwords, for this to work properly, the script name (before any extensions) can not be any longer than 11 characters (16 - the ! and .ncs) or else the external script will not be found.

I tested this by changing the name of the script in the test mod from nwnx to "16charscriptname" both in the mod and in my script folder.

The upside is that I can indeed put !scriptname into my spells 2da to fire a spell script so long as I keep my script name less than 11 characters.

Edit: Though, this begs the question, how does the correct information get passed along for using subdirectories as isilweo posted about previously? Unless of course the character length of the sub directories was short enough that the problem wasn't encountered.
Back to top
View user's profile Send private message
Liberty Valance



Joined: 06 Jan 2005
Posts: 21
Location: A Persistent World West2

PostPosted: Sun Mar 13, 2005 23:17    Post subject: Reply with quote

seeing this, i'm quite excited, as it appears to be the solution to a number of problems i've been coming across in the expansion of my module... what are the chances of getting the resource loader to load things (scripts, objects, etc) from a DB instead of a file? Xildjian suggested that if the info were being loaded from a DB that's resident in memory, the load times should be significantly faster - perhaps to a point where it would become efficient to put even small two- or three-liner scripts into the DB rather than in the module itself?

also, perhaps i missed it, but can conversations be loaded in via this system as well? if so, it might prove interesting to add quest NPCs on the fly Very Happy
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Guest






PostPosted: Mon Mar 14, 2005 5:18    Post subject: Reply with quote

currently u can do both objects and conversations already. All you need is SCORCO for the objects (except for placeables) and a conversation template that uses custom tokens to retrieve data from the database (the latter is a bit complicated).

The external scripts are truly a godsend, however. But im also waiting for another plugin that RUNS the scripts externaly, forgot wat tread that is (under this forum). "proof of concept" or something like that.
Back to top
Alosynth



Joined: 06 Jan 2005
Posts: 24

PostPosted: Mon Mar 14, 2005 22:38    Post subject: Reply with quote

The plugin in this thread I think only works with scripts. However, the resource manager plugin that spawned from this plugin does work with pretty much all objects.

See this thread for the resource manager plugin.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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