Could it be that your module issues requests for persistent data immediately after SQLInit() ? Make sure this function is the first thing you call in your module load event and also make sure no other APS function is called in the same event. This should have been in the documentation, we'll need add it.Originally posted by Timendainum
When I load the demo mod
it says
* Found 1024 bytes for requests, 4096 bytes for responses
What am I doing wrong?
APS/NWNX released
Moderator: Event DM
-
- Whiney Peasant
- Posts: 15
- Joined: Wed Jan 29, 2003 10:42 am
- Mikel of Avalon
- Newbie
- Posts: 8
- Joined: Wed Jan 29, 2003 11:05 am
- Contact:
You can't load data in the same script as SQLInit() is, but I'm sure someone will script a workaround soon:
* Call SQLInit() in module load event as usual
* Move all other initialization that needs SQL into a seperate script 'a'
* ExecuteScript(a) which checks if NWNX is ready (see aps_demo how to check that) and when it is, run the rest of the script. If it is not, call ExecuteScript(a) with a certain delay.
Would be nice if someone would post his solution here.
* Call SQLInit() in module load event as usual
* Move all other initialization that needs SQL into a seperate script 'a'
* ExecuteScript(a) which checks if NWNX is ready (see aps_demo how to check that) and when it is, run the rest of the script. If it is not, call ExecuteScript(a) with a certain delay.
Would be nice if someone would post his solution here.
Wow, so many non-english versionsOriginally posted by Mikel of Avalon
Same problem that Dream and Cryo describe.
When I load the test mod its allways saying "waiting for the module".
I have a german version of nwn.
Thnx in advance for reply.
Mikel

I'm going to release an updated version today that contains every language I got screenshots for.
- Mikel of Avalon
- Newbie
- Posts: 8
- Joined: Wed Jan 29, 2003 11:05 am
- Contact:
-
- Whiney Peasant
- Posts: 15
- Joined: Wed Jan 29, 2003 10:42 am
Thank you for you reply, if it's just to wait for initialisation to be completed, it's not a real problem.
Did you allready fix it for the french version ?
If not, here are the strings I suppose you're looking for.
When NWServer starts, before any module is loaded:
"Inactif, connexion hors service"
While loading the module:
"Chargement du jeu..."
Once it's running properly:
"En fonctionnement, connexion ? la demande"
Don't you think that scanning for some strings may be version dependant ? Maybe you should replace this by using something like WaitForInputIdle (Win32 API) ?
Did you allready fix it for the french version ?
If not, here are the strings I suppose you're looking for.
When NWServer starts, before any module is loaded:
"Inactif, connexion hors service"
While loading the module:
"Chargement du jeu..."
Once it's running properly:
"En fonctionnement, connexion ? la demande"
Don't you think that scanning for some strings may be version dependant ? Maybe you should replace this by using something like WaitForInputIdle (Win32 API) ?
- Mikel of Avalon
- Newbie
- Posts: 8
- Joined: Wed Jan 29, 2003 11:05 am
- Contact:
Here we go ... the Screenshots from the german version
<b>Before and after loading a module ...</b>
<a href="http://avalons-nordock.net/files/aps_before.jpg"><img src="http://avalons-nordock.net/files/aps_before.jpg" width="240" height="200"></a><a href="http://avalons-nordock.net/files/aps_after.jpg"><img src="http://avalons-nordock.net/files/aps_after.jpg" width="240" height="200"></a>
hope thats what you requestet ...
<b>Before and after loading a module ...</b>
<a href="http://avalons-nordock.net/files/aps_before.jpg"><img src="http://avalons-nordock.net/files/aps_before.jpg" width="240" height="200"></a><a href="http://avalons-nordock.net/files/aps_after.jpg"><img src="http://avalons-nordock.net/files/aps_after.jpg" width="240" height="200"></a>
hope thats what you requestet ...
- Mikel of Avalon
- Newbie
- Posts: 8
- Joined: Wed Jan 29, 2003 11:05 am
- Contact:
Attachment to previous Post ...
after i saw the french post ... here more details.
When NWServer starts, before any module is loaded:
"Unt?tig, Login deaktiviert."
While loading the module:
"Spiel wird geladen ..."
Once it's running properly:
"Server l?uft, Login jederzeit"
p.s. sorry for double post - i can't edit the previous ...
after i saw the french post ... here more details.
When NWServer starts, before any module is loaded:
"Unt?tig, Login deaktiviert."
While loading the module:
"Spiel wird geladen ..."
Once it's running properly:
"Server l?uft, Login jederzeit"
p.s. sorry for double post - i can't edit the previous ...
-
- Newbie
- Posts: 5
- Joined: Thu Jan 23, 2003 9:42 pm
- Location: Midwest, USA
- Contact:
That's what I am doing. Also it appears that doing something like:Originally posted by PapillonCould it be that your module issues requests for persistent data immediately after SQLInit() ? Make sure this function is the first thing you call in your module load event and also make sure no other APS function is called in the same event. This should have been in the documentation, we'll need add it.Originally posted by Timendainum
When I load the demo mod
it says
* Found 1024 bytes for requests, 4096 bytes for responses
What am I doing wrong?
if(!GetPersistentInt(oMod,"DayStart"))
SetPersistentInt(oMod,"DayStart", GetCalendarDay());
Does not work as the GetPersistentInt will return 0 if the variable does not exits. What if the value is supposed to be 0?
I'll have to do more playing around with this.
I compiled a version that supports french and german. Once you guys tell me it works, I'll upload that to nwvault.
Get it here.
Get it here.
- Mikel of Avalon
- Newbie
- Posts: 8
- Joined: Wed Jan 29, 2003 11:05 am
- Contact:
AVS ODBC Question
When I start my module up, I'm getting 0 bytes reserved for requests, but 4000+ bytes reserved for responses. This obviously keeps me from asking the Database to store and retrieve info... Any ideas?
Stackable Items
What a great and hopefully promising addition to NWN. This was very much needed as BioWare seemed to think that their product wouldn't be used for ongoing and ever changing world. Thanks a lot to all the people responsible for this....
Now for the question; you knew that was coming. We're trying to place stackable objects (ie - GP, bullets, etc.) into test persistant containers, but keep getting an error message saying no Stackables allowed. How do we change this? Or work around it?
Thanks again!
Now for the question; you knew that was coming. We're trying to place stackable objects (ie - GP, bullets, etc.) into test persistant containers, but keep getting an error message saying no Stackables allowed. How do we change this? Or work around it?
Thanks again!
Saving Characters.
I've got a heartbeat script to save character locations....
#include "aps_include"
void main()
{
object oClient = GetFirstPC();
while(GetIsObjectValid(oClient))
{
SetPersistentLocation(oClient, "Location", GetLocation(oClient), 0);
oClient = GetNextPC();
}
}
but it doesn't seem to be working at all. I'm not sending any requests to the database... I tried doing it when the character was exiting but it saves null values because characters that have left have no location to save.... Any suggestions? I'm looking to save character locations to improve persistence...
#include "aps_include"
void main()
{
object oClient = GetFirstPC();
while(GetIsObjectValid(oClient))
{
SetPersistentLocation(oClient, "Location", GetLocation(oClient), 0);
oClient = GetNextPC();
}
}
but it doesn't seem to be working at all. I'm not sending any requests to the database... I tried doing it when the character was exiting but it saves null values because characters that have left have no location to save.... Any suggestions? I'm looking to save character locations to improve persistence...
- Strangg
- Team Member; Retired with Honors
- Posts: 4174
- Joined: Wed Jul 17, 2002 11:25 am
- Location: Heaven
- Contact:
As of right now it is coded that way because stackable items don't work properly in persistant chests. It has somehtign to do with the way bioware made stackables. If i could find the post made by silk as to exactly why they don't work i'd post it.Originally posted by GorbGuy
What a great and hopefully promising addition to NWN. This was very much needed as BioWare seemed to think that their product wouldn't be used for ongoing and ever changing world. Thanks a lot to all the people responsible for this....
Now for the question; you knew that was coming. We're trying to place stackable objects (ie - GP, bullets, etc.) into test persistant containers, but keep getting an error message saying no Stackables allowed. How do we change this? Or work around it?
Thanks again!
~S
To do stackable items in some kind of persistent chest you will have to make a new table. You will want to store the resref of the object and the quantity. I haven't looked at how the persistent chest demo works, but assuming it requires a unique tag for each individuals chest (for example, zeruel_chest would be a chest for a character named zeruel or just increments like chest0001, chest0002, whatever).
tb_persistent_chests
chesttag varchar(64)
ownertag varchar(64)
ownername varchar(64)
tb_persistent_chest_contents
chesttag varchar(64)
resref varchar(64)
quantity int
So, when someone goes to use the chest, you will need some code to compare the person using it against the db stored tag \ name. If they are allowed access, then do:
SQLExecDirect("SELECT resref, quantity FROM tb_persistent_chest_contents WHERE chesttag='" + GetPersistentString(oUser, "chesttag") + "';");
Where oUser is the last user of the chest (retrieved with GetLastUsedBy()). From there you could use SQLFirstRow() and loop through the result set using SQLNextRow(), doing
CreateItemOnObject(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1) and plugging in the resref's you get in place of sItemTemplate and the quantity you get in place of nStackSize.
I haven't had a chance to really get into NWNX yet nor had a chance to test this, but this should work.
Another thing you can do once you are storing and retrieving quantities and resrefs is, instead of using the stacksize property for CreateItemOnObject, you could run a for loop that goes from 0 to quantity and creates one each time around, this way you can recreate multiple stacks of items or store quantities of items in 1 row in the DB of nonstackable items.
Hopefully this will be of help to you, or one of the creators of this project could provide some input.
If no one else ends up doing this, I'll sit down later and look at the out of the box persistent chest demo and make a modification to be able to handle stackable items a little better.
tb_persistent_chests
chesttag varchar(64)
ownertag varchar(64)
ownername varchar(64)
tb_persistent_chest_contents
chesttag varchar(64)
resref varchar(64)
quantity int
So, when someone goes to use the chest, you will need some code to compare the person using it against the db stored tag \ name. If they are allowed access, then do:
SQLExecDirect("SELECT resref, quantity FROM tb_persistent_chest_contents WHERE chesttag='" + GetPersistentString(oUser, "chesttag") + "';");
Where oUser is the last user of the chest (retrieved with GetLastUsedBy()). From there you could use SQLFirstRow() and loop through the result set using SQLNextRow(), doing
CreateItemOnObject(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1) and plugging in the resref's you get in place of sItemTemplate and the quantity you get in place of nStackSize.
I haven't had a chance to really get into NWNX yet nor had a chance to test this, but this should work.
Another thing you can do once you are storing and retrieving quantities and resrefs is, instead of using the stacksize property for CreateItemOnObject, you could run a for loop that goes from 0 to quantity and creates one each time around, this way you can recreate multiple stacks of items or store quantities of items in 1 row in the DB of nonstackable items.
Hopefully this will be of help to you, or one of the creators of this project could provide some input.
If no one else ends up doing this, I'll sit down later and look at the out of the box persistent chest demo and make a modification to be able to handle stackable items a little better.
-
- Whiney Peasant
- Posts: 15
- Joined: Wed Jan 29, 2003 10:42 am
Thank you for the quick update with German and French support. Unfortunately I couldn't have a try for now, hope I'll find some time today to do that.
Keep doing a great job, and please, post the source ASAP (cf my post on NWN Vault for the reason).
Thanks for all,
FastFrench
Le bouchon Lyonnais ATS, [FR] FastFrench - PW/Story
Keep doing a great job, and please, post the source ASAP (cf my post on NWN Vault for the reason).
Thanks for all,
FastFrench
Le bouchon Lyonnais ATS, [FR] FastFrench - PW/Story
-
- Newbie
- Posts: 8
- Joined: Tue Jan 28, 2003 7:53 pm
ere is a Banker using the NWNX system
ere is a Banker using the NWNX system
first create the Table and fields
Table: "Bank_Data"
Fields "player" varchar(64) Null
"tag" varchar(64) Null
"Name" varchar(64) Null
"val" text
"expire" int(11) Null
"last" Timestamp(14) Not Null
MySQL Query:
-----------------------------------------
-----------------------------------------
USE NWNX;
DROP TABLE IF EXISTS bank_data;
CREATE TABLE `bank_data` (
`player` varchar(64) default NULL,
`tag` varchar(64) default NULL,
`name` varchar(64) default NULL,
`val` text,
`expire` int(11) default NULL,
`last` timestamp(14) NOT NULL
) TYPE=MyISAM;
-----------------------------------------
-----------------------------------------
then Just put the convo in the Charactor your going to use as a Banker NPC
the go in game and use it
Warning Warning Warning Warning
-------------------------------
There are many Missing Scripts don't worry as those are not implemented yet
Conversation 'banker_conv.dlg' is missing resource bank_conv_017.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_019.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_020.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_016.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_018.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_022.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_014.nss
if you want to remove the errors part remove the item storage dialog tree in the conversation
Thanx goes to
_____________________________________
Daggerford team :
Have fun Guys
Papillon :
your totally 50th level geek
and all the people that helped me learn to script in the past
first create the Table and fields
Table: "Bank_Data"
Fields "player" varchar(64) Null
"tag" varchar(64) Null
"Name" varchar(64) Null
"val" text
"expire" int(11) Null
"last" Timestamp(14) Not Null
MySQL Query:
-----------------------------------------
-----------------------------------------
USE NWNX;
DROP TABLE IF EXISTS bank_data;
CREATE TABLE `bank_data` (
`player` varchar(64) default NULL,
`tag` varchar(64) default NULL,
`name` varchar(64) default NULL,
`val` text,
`expire` int(11) default NULL,
`last` timestamp(14) NOT NULL
) TYPE=MyISAM;
-----------------------------------------
-----------------------------------------
then Just put the convo in the Charactor your going to use as a Banker NPC
the go in game and use it
Warning Warning Warning Warning
-------------------------------
There are many Missing Scripts don't worry as those are not implemented yet
Conversation 'banker_conv.dlg' is missing resource bank_conv_017.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_019.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_020.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_016.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_018.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_022.nss
Conversation 'banker_conv.dlg' is missing resource bank_conv_014.nss
if you want to remove the errors part remove the item storage dialog tree in the conversation
Thanx goes to
_____________________________________
Daggerford team :
Have fun Guys
Papillon :
your totally 50th level geek
and all the people that helped me learn to script in the past