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 
 
[NWN2/NWNX4] Location-Question

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



Joined: 13 Jan 2007
Posts: 2

PostPosted: Sat Jan 13, 2007 11:45    Post subject: [NWN2/NWNX4] Location-Question Reply with quote

Hey folks!

I'm working for a German PW (so you can expect some very poor constructed English sentences;D) and that is why I wanted to try NWNX.

While I had only little problems with the installation, I can't figure out how to use the SetPersistentLocation-function. Or better: Why it doesn't work.
It is no problem to save integers like player's HP, but the location...I tried to save it in the heartbeat-process, with local locations on client exits, when using a placeable...nothing worked. There were DB-entries like "Location" (varname) with a blank value-field and "Location" as a value (= varname).

I got only a little hint while trying to validate the area: it seems that GetIsObjectValid(GetArea(oPlayer)) brings only False. First I thought it was a missing areatag (didn't know that they aren't created by NWN2), but entering one didn't solve my problem.

I read through a lot of forums, English and German, but couldn't find only a tiny bit of help, so I hope you know something about this strange GetLocation-behaviour.

Thank you,
Ar-Zimrathon

P.S. I don't post my script, it just consists of GetLocation and SetPersistentLocation.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Jan 14, 2007 22:55    Post subject: Reply with quote

I have to admit that I did not try the location functions - I assumed they work. That's what you get for concentrating on NWNX alone, and not working for a PW this time (well, until now Smile).

Can anybody comment on those functions ? Do they work ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Mon Jan 15, 2007 1:50    Post subject: Reply with quote

This is most likely the issue of buffer overrun....
the returned value is truncated - and therefore invalid.

The current NWNX4 doesn't allow enough space for #AREA#....#END# encoding of the location. My quick fix was to use #A#, #X#, #Y#, #Z#, #O# #E# instead of the full text - saves 40+ characters.

Alternately extend the buffer from 128 to 256...

Cheers
Gryphyn
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Jan 15, 2007 11:05    Post subject: Reply with quote

Oh ok... I'll need to make this change in the official include file. Makes no sense to store that many unecessary characters anyway.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Ar-Zimrathon



Joined: 13 Jan 2007
Posts: 2

PostPosted: Mon Jan 15, 2007 18:37    Post subject: Reply with quote

Puh, never thought of THAT! Many thanks, its working fine now!Smile
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