View previous topic :: View next topic |
Author |
Message |
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Apr 07, 2007 11:23 Post subject: |
|
|
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 _________________ Papillon |
|
Back to top |
|
|
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Sat Apr 07, 2007 23:07 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Apr 09, 2007 22:27 Post subject: |
|
|
Can you be more specific ? What GET command ? _________________ Papillon |
|
Back to top |
|
|
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Tue Apr 10, 2007 18:02 Post subject: |
|
|
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 |
|
|
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Tue Apr 10, 2007 20:34 Post subject: |
|
|
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 |
|
|
TroveLord
Joined: 22 Nov 2006 Posts: 136 Location: Italy
|
Posted: Tue Apr 10, 2007 20:41 Post subject: |
|
|
Actually you should use the event On PC Loaded Script |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Tue Apr 10, 2007 21:24 Post subject: |
|
|
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 |
|
|
Senalaya
Joined: 29 Dec 2004 Posts: 82 Location: Germany
|
Posted: Tue Apr 10, 2007 21:29 Post subject: |
|
|
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 |
|
|
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Tue Apr 10, 2007 22:50 Post subject: |
|
|
I now have a problem geting stored locations. any idea any1? |
|
Back to top |
|
|
|