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  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jan 23, 2005 22:38    Post subject: Reply with quote

Areas are loaded on module load, so I am not sure if they can be replaced at run time. If I had to guess I would say no.

Placeables, doors, and 2das are also routed through that function, so it might be possible to load them externally as well. This has not been tried yet, so I can not really comment on this.

Even if certain resources are only requested once, it would still be able to load them externally, just not to replace them while the module is running.

Creatures and items are handled by ODBC2 through SCO/RCO.

Well, keep the ideas coming and tell me how you plan to use this plugin. This certainly helps my motivation to improve this stuff Smile
_________________
Papillon


Last edited by Papillon on Mon Jan 24, 2005 0:03; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jan 23, 2005 22:39    Post subject: Reply with quote

Btw, try loglevel 2 to see what is routed through the scripter plugin.

Did anybody have success with the demo module yet ? I would like to know if we run into the same problems as we did with ODBC2...
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Alosynth



Joined: 06 Jan 2005
Posts: 24

PostPosted: Sun Jan 23, 2005 23:48    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Sun Jan 23, 2005 23:53    Post subject: Reply with quote

"Creatures and placeables are handled by ODBC2 through SCO/RCO."


You meant creatures and items correct?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Jan 24, 2005 0:02    Post subject: Reply with quote

Alosynth, this is one of the rough edges that still needs to be rounded. The solution with the "!" is not ideal either, because most dialogs in the toolset will not accept that character.

I guess a better solution would be to check if the resource has already been loaded, and if not, let the scripter plugin load it. If it can not find the resource, the normal Bioware routine would get a chance to load it. That means one extra file or database operation for each resource, but only once, on first load. It would also make the plugin more plug-and-play, since you could just remove the scripts from the module and put them into the sourcepath folder.

Blacksting, yes, of course I meant items, not placeables.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Alosynth



Joined: 06 Jan 2005
Posts: 24

PostPosted: Mon Jan 24, 2005 0:07    Post subject: Reply with quote

Well, I look forward to when I will be able to execute my 2da impact scripts from an external source. But even as it is now, it will greatly reduce my testing cycles when it comes to troubleshooting new scripts, which I greatly appreciate.

I probably could've save myself at least an hour or two if I had had this plugin yesterday. Razz

Thanks for the great work Papillion and iselweo.
Back to top
View user's profile Send private message
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Mon Jan 24, 2005 1:50    Post subject: Reply with quote

i've tested plugin and it worked correctly (sco/rco crashes) so i think there'll be no problem withi this.

Too bad that areas are not loaded with this function, but it's only matter of time to find the right function that loads areas Wink I've done some work on that subject today but it seems i've found only a function which loads values of given name from gff files.i can't see any use of it (maybe someone have idea what we could use it for?)
Back to top
View user's profile Send private message
Themicles



Joined: 23 Jan 2005
Posts: 30
Location: Wolverine Lake, MI

PostPosted: Mon Jan 24, 2005 10:32    Post subject: Reply with quote

Well, if it turns out areas can't be loaded on the fly, it would still be nice to have them loaded externally for a code vault type system on the module. Wink

I'd still like to see an on-the-fly area replacement tried, but it's your show, so I wont beg too much. Smile

-Themicles
_________________
World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Jan 24, 2005 10:48    Post subject: Reply with quote

"Too bad that areas are not loaded with this function..."

They ARE loaded with this function, just not when someones enters the area, but statically when the module is first beeing loaded.

Btw, I had the same crash problems as with SCO/RCO in ODBC2 when I dynamically allocated memory for the script. Now I just allocate 100KB statically. Someone needs to figure out how to correctly allocate dynamic memory soon Wink
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Mon Jan 24, 2005 12:26    Post subject: Reply with quote

I don't know if that's good thread to discus area loading but.

About areas
After area is loaded on module load only few (2 as i remember) gff values are loaded from area content. If only two of them are loaded you can still exchange area content in memory and when player enters area it should show new area. I can check that in a moment (and i will). The only thing is to find somehow pointer to area content. I've done basic research on area object in memory but we can't depend on memory pointer cause they can change.

btw. maybe all that technical discusions could have their own reverse forum?
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Mon Jan 24, 2005 13:45    Post subject: Reply with quote

And what about the reload when empty functionality of the server? Does that reload also the area's? If so, there is still a possibility to locate the reload function and call that one Smile
Back to top
View user's profile Send private message Visit poster's website
Blacksting



Joined: 03 Jan 2005
Posts: 107

PostPosted: Mon Jan 24, 2005 21:55    Post subject: Reply with quote

Even if we can't load areas on the fly it still would be nice to have seasonal tilesets loaded at module start. The idea of dynamic persistent worlds (even if not on the fly) would be a HUGE draw to keep players currently leaving NWN for other things from heading that way I think. Leto could be used to keep .are and .git files in a folder "updated" to current happenings like an NWNX "save game" file that can be loaded after a crash or reset.
Back to top
View user's profile Send private message
Themicles



Joined: 23 Jan 2005
Posts: 30
Location: Wolverine Lake, MI

PostPosted: Thu Jan 27, 2005 14:54    Post subject: Reply with quote

Blacksting wrote:
Even if we can't load areas on the fly it still would be nice to have seasonal tilesets loaded at module start. The idea of dynamic persistent worlds (even if not on the fly) would be a HUGE draw to keep players currently leaving NWN for other things from heading that way I think. Leto could be used to keep .are and .git files in a folder "updated" to current happenings like an NWNX "save game" file that can be loaded after a crash or reset.


That's a lot of work to duplicate areas with seasonal versions. Wink
Not something a PW like Avlis would do, considering the size. heh.
Unless someone wants to write an area converter to do this... but even then, not all the tilesets have a seasonal counterpart that is exactly the same except for the textures.

-Themicles
_________________
World Leader of Tairis'nądur http://www.tairisnadur.com
Member World of CoPaP http://www.copap.org
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
isilweo



Joined: 29 Dec 2004
Posts: 22
Location: poland

PostPosted: Tue Feb 01, 2005 1:20    Post subject: Reply with quote

One thing i've noticed and it's quite useful. You can group your scripts in directories and invoke them using !directory/script. Don't use \ cause nwscript handles it quite badly and it won't work.
Example

Directory: dlgs
Directory: city1
and so on... and use: !dlgs/dialog1 or city1/maindoor
of course you can make more directories in depth
!city1/guards/onpercp
Back to top
View user's profile Send private message
Blacksting



Joined: 03 Jan 2005
Posts: 107

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

ExecuteScript("!language_listen.ncs",GetLastSpeaker());

SourcePath = D:\Games\NWN\Scripts\

o Error - File not found: D:\Games\NWN\Scripts\language_listen


I can not seem to make the plugin find the scripts. Am I missing something. Since the full path is in the .ini I used backslashes.... although I tried forward slashes too.

Am I missing something?
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  Next
Page 2 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