View previous topic :: View next topic |
Author |
Message |
Ar-Zimrathon
Joined: 13 Jan 2007 Posts: 2
|
Posted: Sat Jan 13, 2007 11:45 Post subject: [NWN2/NWNX4] Location-Question |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Jan 14, 2007 22:55 Post subject: |
|
|
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 ).
Can anybody comment on those functions ? Do they work ? _________________ Papillon |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Mon Jan 15, 2007 1:50 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Jan 15, 2007 11:05 Post subject: |
|
|
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 |
|
|
Ar-Zimrathon
Joined: 13 Jan 2007 Posts: 2
|
Posted: Mon Jan 15, 2007 18:37 Post subject: |
|
|
Puh, never thought of THAT! Many thanks, its working fine now! |
|
Back to top |
|
|
|