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 
 
Double JumpTo???
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
Makzimia De Graf



Joined: 31 Dec 2004
Posts: 55
Location: San Diego CA.

PostPosted: Mon Jan 31, 2005 23:10    Post subject: Reply with quote

Sad 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
View user's profile Send private message
Lokey



Joined: 02 Jan 2005
Posts: 158

PostPosted: Tue Feb 01, 2005 0:13    Post subject: Reply with quote

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 Wink
Back to top
View user's profile Send private message
Makzimia De Graf



Joined: 31 Dec 2004
Posts: 55
Location: San Diego CA.

PostPosted: Tue Feb 01, 2005 2:04    Post subject: Reply with quote

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
View user's profile Send private message
Makzimia De Graf



Joined: 31 Dec 2004
Posts: 55
Location: San Diego CA.

PostPosted: Tue Feb 01, 2005 3:21    Post subject: Reply with quote

Very Happy 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 Very Happy Very Happy

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
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