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 
 
help! setpersistent and getpersistent
Goto page Previous  1, 2
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Apr 07, 2007 11:23    Post subject: Reply with quote

Try to rule out the DB as a possible source for the problem first:

Code:
if (true)
{
      SendMessageToPC(oPC, "Hey u'r dead");
      object oGoal = GetWaypointByTag("WP_FUGUE");
      AssignCommand(oPC, ClearAllActions());
      AssignCommand(oPC, ActionJumpToObject(oGoal));
}


If this works every time a PC enters, then the problem is on the DB side (which I do not think based on the logs you posted). If it does not work, there is something else that's wrong, maybe the WP_FUGUE waypoint does not exist or something.

Try to reduce the problem space first Smile
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Sat Apr 07, 2007 23:07    Post subject: Reply with quote

The problem is redusced to the get command. i dont get the message or anythign. and i see that the data is stored in the database. so plz some proxxor come help
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Apr 09, 2007 22:27    Post subject: Reply with quote

Can you be more specific ? What GET command ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Tue Apr 10, 2007 18:02    Post subject: Reply with quote

Code:

#include "nwnx_sql"
#include "my_status"


void SetStatus(object oPC, int iStatus)
{
SetPersistentInt(oPC, "STATUS", iStatus);
}

int GetStatus(object oPC)
{
int nValue = GetPersistentInt(oPC, "STATUS");
return nValue;
}
 

Code:

#include "script_above"

void main()
{
object oPC = GetEnteringObject();
int oHP = GetCurrentHitPoints(oPC);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(oHP -1, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_NORMAL, TRUE), oPC);
if (GetStatus(oPC) == STATUS_DEAD)
{
SendMessageToPC(oPC, "Hey u'r dead");
object oGoal = GetWaypointByTag("WP_FUGUE");
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToObject(oGoal));
}


The GetStatus(oPC). I believe the fault lies there
Back to top
View user's profile Send private message
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Tue Apr 10, 2007 20:34    Post subject: Reply with quote

Okey. i found out what was wrong. don't use client enter. make a trigger. client enter doesn't work with nwnx
Back to top
View user's profile Send private message
TroveLord



Joined: 22 Nov 2006
Posts: 136
Location: Italy

PostPosted: Tue Apr 10, 2007 20:41    Post subject: Reply with quote

Actually you should use the event On PC Loaded Script
Back to top
View user's profile Send private message
FunkySwerve



Joined: 02 Jun 2005
Posts: 377

PostPosted: Tue Apr 10, 2007 21:24    Post subject: Reply with quote

NWNX works fine with client enter scripts, so it's something else. We use oodles of mysql calls in our client enter, have for a long time.
Funky
Back to top
View user's profile Send private message
Senalaya



Joined: 29 Dec 2004
Posts: 82
Location: Germany

PostPosted: Tue Apr 10, 2007 21:29    Post subject: Reply with quote

OnClientEnter is fine, EXECPT that you can't yet assign actions to the PC. So, the ClearAllActions() and the Jump won't work.

For assigning actions, the OnPCLoaded is the correct choise.
Back to top
View user's profile Send private message
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Tue Apr 10, 2007 22:50    Post subject: Reply with quote

I now have a problem geting stored locations. any idea any1?
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
Goto page Previous  1, 2
Page 2 of 2

 
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