Aller au contenu

Photo

How to destroy an object type creature OnClientLeave?


  • Veuillez vous connecter pour répondre
31 réponses à ce sujet

#26
Shadooow

Shadooow
  • Members
  • 4 468 messages

I've found the discrepancy.  Exiting by the Death GUI Panel doesn't retain variables for either the Area or the Client exit, while exiting normally would preserve the locals for both events.

how are you testing that? I was doing some research on this in past and since I didnt remembered this issue I double checked and cannot reproduce your results. I was able to retrieve local var from oPC object in OnExit even when I was dead and pressed exit game from dead GUI.

 

Edit: I rewritten pages in lexicon per my research.


  • WhiteTiger aime ceci

#27
WhiZard

WhiZard
  • Members
  • 1 204 messages

Here are my scripts

 

 

On Client Enter

void main()
{
object oPC = GetEnteringObject();
int nLocal = GetCampaignInt("test", "test");
if(nLocal && GetIsPC(oPC))
  {
  DestroyCampaignDatabase("test");
  }
SetLocalInt(oPC, "test", 1);
}

 

On Client Leave

void main()
{
object oPC = GetExitingObject();
int nLocal = GetLocalInt(oPC, "test");
if(nLocal)
  SetCampaignInt("test", "test", 1);
DeleteLocalInt(oPC, "test");
}

 

Basically, I am checking my database folder of my dedicated server to see if the "test" database exists.  I can check this both in-game and out of game.  For checking Area Enter/Exit, I just move the scripts to those locations removing the check from on Client Enter/Leave.


  • WhiteTiger aime ceci

#28
Shadooow

Shadooow
  • Members
  • 4 468 messages

Well i used writelog and checked nwserverlog1.txt and I found the value of the string variable there in all cases. Using windows server without NWNX. Can a third person try it?


  • WhiteTiger aime ceci

#29
WhiZard

WhiZard
  • Members
  • 1 204 messages

Okay now I am seeing it create the database for the DeathPanel exit, so there must be some other common factor that is preventing locals to be shown, because I am sometimes seeing an inconsistency.



#30
WhiZard

WhiZard
  • Members
  • 1 204 messages

Found my problem.  I had four modules labeled for whether or not the Death GUI Panel was called by PopUpGUIPanel() or PopUpDeathGUIPanel() and whether the scripts were client or area.  One of the labels was incorrect, so I had two area ones with PopUpGUIPanel(), while the PopUpDeathGUIPanel() had one for client and one for area.  This mislabeling caused some of the area test data to be confused with client test data.  Since the area exit did not fire in the case of exiting by death, I was incorrectly finding issues with the client.  So I should now agree with Shadooow and Meaglyn.


  • WhiteTiger aime ceci

#31
WhiteTiger

WhiteTiger
  • Members
  • 479 messages

There is an easy workaround for this. This workaround even allows to set local ints from OnClientLeave.
 
Basically you are setting the variables not on a PC but on the module this way
 
GetLocalInt(OBJECT_SELF,ObjectToString(oPC)+"_ACCOUNT");
 
etc. you get the idea


//EDITED

 

yeah, I got. good idea ;)


Modifié par WhiteTiger, 02 août 2014 - 05:49 .


#32
meaglyn

meaglyn
  • Members
  • 807 messages

So I should now agree with Shadooow and Meaglyn.

Even better, now I don't have to retest the death panel paths :)