View previous topic :: View next topic |
Author |
Message |
Makzimia De Graf
Joined: 31 Dec 2004 Posts: 55 Location: San Diego CA.
|
Posted: Mon Jan 31, 2005 23:10 Post subject: |
|
|
ok no go still, can someone look at this and tell me if I have anything wrong here please, also, this is called on start area enter script.. I found I also had to call the iOldHP part in client onenter to make sure players were in fact dead during normal running. Should I be calling all of this instead in the oncliententer script? thanks.
Makz.
Code: |
void main()
{
object oPC = OBJECT_SELF;
if ( GetIsPC(oPC) == FALSE || GetIsDM(oPC) )
{
return;
}
int iFirst = GetPersistentInt(oPC,"PLAY_START","PLAY_STATS");
if (GetIsPC(oPC) == TRUE && iFirst == 0)
{
location oLoc = GetPersistentLocation(oPC,"PLAY_LOC","PLAY_STATS");
AssignCommand (oPC,ActionJumpToLocation (oLoc));
//Check to see if player was dead when they left the module.
int iOldHP = GetPersistentInt(oPC,"PLAY_HP","PLAY_STATS");
if ( iOldHP < 0 )
{
effect eMod = EffectDeath(TRUE,TRUE);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eMod,oPC);
}
else if (iOldHP >0 )
{
//do nothing :)
}
else if (GetIsPC(oPC) == TRUE && iFirst == 1)
{
ExecuteScript("lac_onae_playloc",oPC);
}
}
SetPersistentString(oPC,"PLAY_CD",GetPCPublicCDKey(oPC),30,"PLAY_STATS");
SetPersistentInt(oPC,"PLAY_START",1,30,"PLAY_STATS");
}
|
_________________ Makzimia De Graf
DM/Creator Island of Fredian
fredian.game-host.org:5123
Forums at http://castille.us/fredian/Forums |
|
Back to top |
|
|
Lokey
Joined: 02 Jan 2005 Posts: 158
|
Posted: Tue Feb 01, 2005 0:13 Post subject: |
|
|
Probably want to DelayCommand() killing the pc, especially if you're on death code saves the pc's location (it might fire before the move takes place).
Also, good practice in general to clear the player's actions when assigning things like jump:
AssignCommand(oPC, ClearAllActions());
Also think about JumpToLocation() over ActionJumpToLocation()...move or attack actions clear the action queue, and unsavory types may know this. _________________ Neversummer PW NWNx powered mayhem |
|
Back to top |
|
|
Makzimia De Graf
Joined: 31 Dec 2004 Posts: 55 Location: San Diego CA.
|
Posted: Tue Feb 01, 2005 2:04 Post subject: |
|
|
Thanks Lokey, I added DelayCommands, and switched to JumptoLocation, still no luck, and I tried various DelayCommand times. The issues remain, I land back at start point, and, it has wiped out my DB entry for location as well.
Makz. _________________ Makzimia De Graf
DM/Creator Island of Fredian
fredian.game-host.org:5123
Forums at http://castille.us/fredian/Forums |
|
Back to top |
|
|
Makzimia De Graf
Joined: 31 Dec 2004 Posts: 55 Location: San Diego CA.
|
Posted: Tue Feb 01, 2005 3:21 Post subject: |
|
|
SUCCESS! Ok, I had to do a fair bit of fiddling around, but in the end it is handled in the start area enter script, and, also had to be handled by the target area called back from the DB. In addition, while the server is running, that didn't work, so, had to modify the respawn script as well... but she works for the first time in 18 mths
Thanks to all who provided time and comments/ideas on this.
Makz. _________________ Makzimia De Graf
DM/Creator Island of Fredian
fredian.game-host.org:5123
Forums at http://castille.us/fredian/Forums |
|
Back to top |
|
|
|
|
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
|