APS/NWNX released

Avlis Headlines - www.avlis.org

Moderator: Event DM

Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 8:55 am

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?
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.
FastFrench
Whiney Peasant
Posts: 15
Joined: Wed Jan 29, 2003 10:42 am

Post by FastFrench » Wed Jan 29, 2003 11:10 am

Even after a delay ?

Would be a bit restrictive not being able to have module-wide datas (which would reasonnably be read at load time).
User avatar
Mikel of Avalon
Newbie
Posts: 8
Joined: Wed Jan 29, 2003 11:05 am
Contact:

Post by Mikel of Avalon » Wed Jan 29, 2003 11:21 am

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
Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 11:23 am

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.
Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 11:26 am

Originally 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
Wow, so many non-english versions :-) Mikel, do me a favour please: Make a screenshot of the server before and after the module is loaded (DreaM did that very well) and post it here (or send it to papillon@blackdagger.com).

I'm going to release an updated version today that contains every language I got screenshots for.
User avatar
Mikel of Avalon
Newbie
Posts: 8
Joined: Wed Jan 29, 2003 11:05 am
Contact:

Post by Mikel of Avalon » Wed Jan 29, 2003 1:26 pm

Thanx for fast reply.

I will do so this evening because i'm now at work.

A little other question - how long it work to get a linux version ...
((my litte server runs on Mandrake 9 and i don't want to change back to windows))
FastFrench
Whiney Peasant
Posts: 15
Joined: Wed Jan 29, 2003 10:42 am

Post by FastFrench » Wed Jan 29, 2003 2:23 pm

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) ?
User avatar
Mikel of Avalon
Newbie
Posts: 8
Joined: Wed Jan 29, 2003 11:05 am
Contact:

Post by Mikel of Avalon » Wed Jan 29, 2003 4:32 pm

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 ...
User avatar
Mikel of Avalon
Newbie
Posts: 8
Joined: Wed Jan 29, 2003 11:05 am
Contact:

Post by Mikel of Avalon » Wed Jan 29, 2003 5:44 pm

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 ...
Timendainum
Newbie
Posts: 5
Joined: Thu Jan 23, 2003 9:42 pm
Location: Midwest, USA
Contact:

Post by Timendainum » Wed Jan 29, 2003 6:10 pm

Originally posted by Papillon
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?
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.
That's what I am doing. Also it appears that doing something like:

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.
Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 6:13 pm

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.
Cryo
Newbie
Posts: 2
Joined: Tue Jan 28, 2003 8:47 pm
Location: France

Post by Cryo » Wed Jan 29, 2003 6:26 pm

It works fine for me, thank you very much. Great job.
User avatar
DreaM
Newbie
Posts: 5
Joined: Tue Jan 28, 2003 5:37 pm
Contact:

Post by DreaM » Wed Jan 29, 2003 6:34 pm

It also works with the spanish one, you forgot to say it :))) .
Thank u very much.
by DreaM
Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 6:38 pm

Yes, spanish too. Sorry forgot to mention that hehe
User avatar
Silk
Co-Founder
Posts: 6662
Joined: Fri Sep 14, 2001 6:47 pm
Contact:

Post by Silk » Wed Jan 29, 2003 6:54 pm

Why do some Geman words have "-" between them?
Silk

Member of the MadK@t lover's group.
Papillon
Team Member; Retired with Honors
Posts: 3155
Joined: Thu Jul 18, 2002 11:17 pm
Contact:

Post by Papillon » Wed Jan 29, 2003 6:57 pm

Heh, totally OT, but ok: Bad translation. I mean you can connect these words with "-" but there's really no need. I translated some fairly large software packages from english to german and I think I never used dashes...
User avatar
Silk
Co-Founder
Posts: 6662
Joined: Fri Sep 14, 2001 6:47 pm
Contact:

Post by Silk » Wed Jan 29, 2003 7:22 pm

Bah, staying on topic is for the week and timid.
Silk

Member of the MadK@t lover's group.
User avatar
Mikel of Avalon
Newbie
Posts: 8
Joined: Wed Jan 29, 2003 11:05 am
Contact:

Post by Mikel of Avalon » Wed Jan 29, 2003 9:18 pm

So the Only thing i can say - great work. german seem to be ok :cool:
Rush
Newbie
Posts: 3
Joined: Wed Jan 29, 2003 11:29 pm
Contact:

AVS ODBC Question

Post by Rush » Thu Jan 30, 2003 12:15 am

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?
GorbGuy
Newbie
Posts: 1
Joined: Thu Jan 30, 2003 3:22 am
Location: West Mighigan
Contact:

Stackable Items

Post by GorbGuy » Thu Jan 30, 2003 3:52 am

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!
Rush
Newbie
Posts: 3
Joined: Wed Jan 29, 2003 11:29 pm
Contact:

Saving Characters.

Post by Rush » Thu Jan 30, 2003 4:54 am

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...
User avatar
Strangg
Team Member; Retired with Honors
Posts: 4174
Joined: Wed Jul 17, 2002 11:25 am
Location: Heaven
Contact:

Post by Strangg » Thu Jan 30, 2003 4:56 am

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!
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.

~S
Zeruel
Newbie
Posts: 1
Joined: Thu Jan 30, 2003 3:16 am
Location: NJ
Contact:

Post by Zeruel » Thu Jan 30, 2003 5:02 am

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.
FastFrench
Whiney Peasant
Posts: 15
Joined: Wed Jan 29, 2003 10:42 am

Post by FastFrench » Thu Jan 30, 2003 7:36 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
Dukar_Rizulin
Newbie
Posts: 8
Joined: Tue Jan 28, 2003 7:53 pm

ere is a Banker using the NWNX system

Post by Dukar_Rizulin » Thu Jan 30, 2003 8:08 am

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
Post Reply