Vuldrick Garrison's Persistent Start Location and Racial Type Start Point System. Last Build: 12/01/04 This very flexible system will allow a module designer to incorporate the use of Bioware Databases in order to maintain persistent start locations for their PCs. This way, the PC always starts off where they left off in the game. This is particularly useful for Persistent Worlds. As an extra, I have included a simple system that allows PCs to spawn to waypoints . . . designated by racial type. This allows the module designer to make multiple spawn in zones for the various player races (homelands). There are more elegant ways to do this, but I went for ease of function here.
I am using this now in my module, is there anywa I can get this to work with the stone of recall? And is there anyway that I can make it so if the player just happens to walk over the trigger that rests over the start that they don't get teleported. I love this script, awesome work, easy to interpret and apply, and just what I needed in my PW. If there is a way to have recall as well could you either make a post here or send me an email with the right script so I can get this to function in my module without removing a bunch of stuff for my recall stone.
Posted by Avatar at on06/18/05
Sorry, I actually read the rest of the commentts posted here. So I gave you a higher rating hehe... realized the true versatility of this download, still would like to know about recall stone.
Posted by Vuldrick at on08/06/06
I had to revise this system a bit for my PW, Kingdom of Paramon, because I did not want my PCs to save in the start area. If they save in the start area then they dont ever have to go back to where they left off. What I did is I made a trigger in the start area, that was as big as the start area. I made a script in the onenter event that set a local int on the PC. Then I modified the saving event in the on rest that checked if the int was on the PC. If the int is there, there is not save taking place. Finally, in the onexit of the trigger, I set the int on the PC back to zero so they can save after they get in the game. I could supply you with the trigger and the altered save function if you need it. But it works nicely.Vuldrick Garrison _________________________ Vuldrick Garrison
Posted by Anonymous at 2005-02-2508:08:00
I have this setup in my module and it is working but I have one problem.I am using the on rest save location and the trigger over the start location.It works fine unless I try to save in the start area in which case it warps me to an area I haven't been to thats no where near the start of the module.Do I have to use the trigger that came with the download?The area's are not linked and have seperate names.I changed the start area to a small inhospitable zone thinking no one would rest there.Then I tried to save in the old start area and it still warps me to the other area again.Yet the new start location can be saved at.Im extremely new to this if anyone could help it would be great.
Posted by Vuldrick at on08/06/06
Glad you are finding the scripts useful. They are very dynamic in terms of easy modification for things you need . . . In fact I do the same thing for mulitple subraces at my PW. You could also, as I do in my PW, call for deity, class, alignment, etc and spawn PCs in at the appropriate church or whatever for their first time joining the world. Very simple little additions all in all. And the good thing is that it still keeps their persistent location for their next login. I have found though that I like to do the more complex routine like this via a conversation since it makes the checks very simple. Thanks for showing everyone how to modify the code . . . should help some newer users. Regards, VuldrickVuldrick Garrison _________________________ Vuldrick Garrison
Posted by Darkness_FallsDM at 2005-01-0408:24:00
I love those scribts. We modiefied them a little as we want not only racial starting points we needed subrace starting ones. So i will submit the portal scribt with one subrace put in. // Persistent start location portal . . . make a portal with this script onused in your area containing your start location void main() { // This script pulls data for location and jumps PC to last save point object oPC = GetLastUsedBy(); if(GetIsPC(oPC)||(GetIsDM(oPC) !GetIsDMPossessed(oPC))) // Script will fire for PCs and DMs { string sPCName = GetName(oPC); // Gets the name of the PC string CDKey = GetPCPublicCDKey(oPC); // Gets the public CD Key of the player . . . adds to quality of check string sID = GetStringLeft(sPCName,10); // Indivudual Character Used string sHID = sID+CDKey; // HCR Style user check // Read Persistent Location Data int nPlayerBeenHere = GetCampaignInt("PlayerStartLoc", "StartLocSet_" + sHID, oPC); // The check to see if PC has a saved location int nAreaX = GetCampaignInt("PlayerStartLoc", "AreaX_" + sHID, oPC); int nAreaY = GetCampaignInt("PlayerStartLoc", "AreaY_" + sHID, oPC); int nAreaZ = GetCampaignInt("PlayerStartLoc", "AreaZ_" + sHID, oPC); string sAreaName = GetCampaignString("PlayerStartLoc", "AreaName_" + sHID, oPC); string sAreaTag = GetCampaignString("PlayerStartLoc", "AreaTag_"+ sHID, oPC); // Set up the location from Database info float y = IntToFloat(nAreaY); float x = IntToFloat(nAreaX); float z = IntToFloat(nAreaZ); vector vTargetLoc = Vector(x, y, z); location lTargetLoc = Location(GetArea(GetObjectByTag(sAreaTag)), vTargetLoc, 0.0); if(nPlayerBeenHere == 1) // if the player has a saved location lets run this scripts { SendMessageToPC(oPC,"Portaling to your Saved Location in 3 Seconds..."); DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTargetLoc))); } else // Run this if there is no saved location . . . // Create Waypoints in areas that you want certain races to jump to // using the tags I indicated below. { if (GetRacialType(oPC)==RACIAL_TYPE_DWARF) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Dwar f"),FALSE))); } string Drow = "Drow"; string drow = "drow"; if (GetRacialType(oPC)==RACIAL_TYPE_ELF) { string sSubrace = GetStringLowerCase(GetSubRace(oPC)); if ((sSubrace == Drow) || (sSubrace == drow)) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Drow "),FALSE))); } else { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Elf" ),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_GNOME) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Gnom e"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFELF) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half elf"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFLING) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half ling"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFORC) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half orc"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HUMAN) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Huma n"),FALSE))); } } } } WHat we did is we call a subrace. As we dont want the drow to go to the elven start location... that would be bad :D So you can just replace the race and copy paste
Posted by Darkness_FallsDM at 2005-01-0408:24:00
I love those scribts. We modiefied them a little as we want not only racial starting points we needed subrace starting ones. So i will submit the portal scribt with one subrace put in. // Persistent start location portal . . . make a portal with this script onused in your area containing your start location void main() { // This script pulls data for location and jumps PC to last save point object oPC = GetLastUsedBy(); if(GetIsPC(oPC)||(GetIsDM(oPC) !GetIsDMPossessed(oPC))) // Script will fire for PCs and DMs { string sPCName = GetName(oPC); // Gets the name of the PC string CDKey = GetPCPublicCDKey(oPC); // Gets the public CD Key of the player . . . adds to quality of check string sID = GetStringLeft(sPCName,10); // Indivudual Character Used string sHID = sID+CDKey; // HCR Style user check // Read Persistent Location Data int nPlayerBeenHere = GetCampaignInt("PlayerStartLoc", "StartLocSet_" + sHID, oPC); // The check to see if PC has a saved location int nAreaX = GetCampaignInt("PlayerStartLoc", "AreaX_" + sHID, oPC); int nAreaY = GetCampaignInt("PlayerStartLoc", "AreaY_" + sHID, oPC); int nAreaZ = GetCampaignInt("PlayerStartLoc", "AreaZ_" + sHID, oPC); string sAreaName = GetCampaignString("PlayerStartLoc", "AreaName_" + sHID, oPC); string sAreaTag = GetCampaignString("PlayerStartLoc", "AreaTag_"+ sHID, oPC); // Set up the location from Database info float y = IntToFloat(nAreaY); float x = IntToFloat(nAreaX); float z = IntToFloat(nAreaZ); vector vTargetLoc = Vector(x, y, z); location lTargetLoc = Location(GetArea(GetObjectByTag(sAreaTag)), vTargetLoc, 0.0); if(nPlayerBeenHere == 1) // if the player has a saved location lets run this scripts { SendMessageToPC(oPC,"Portaling to your Saved Location in 3 Seconds..."); DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTargetLoc))); } else // Run this if there is no saved location . . . // Create Waypoints in areas that you want certain races to jump to // using the tags I indicated below. { if (GetRacialType(oPC)==RACIAL_TYPE_DWARF) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Dwar f"),FALSE))); } string Drow = "Drow"; string drow = "drow"; if (GetRacialType(oPC)==RACIAL_TYPE_ELF) { string sSubrace = GetStringLowerCase(GetSubRace(oPC)); if ((sSubrace == Drow) || (sSubrace == drow)) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Drow "),FALSE))); } else { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Elf" ),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_GNOME) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Gnom e"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFELF) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half elf"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFLING) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half ling"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HALFORC) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Half orc"),FALSE))); } if (GetRacialType(oPC)==RACIAL_TYPE_HUMAN) { SendMessageToPC(oPC,"Portaling to your homeland in 3 Seconds..."); DelayCommand(3.0,AssignCommand(oPC,ActionJumpToObject(GetObjectByTag("Start_Huma n"),FALSE))); } } } } WHat we did is we call a subrace. As we dont want the drow to go to the elven start location... that would be bad :D So you can just replace the race and copy paste
Posted by Vuldrick at on08/06/06
The scripts are not just drag and drop so to speak. You must make sure you define the PC using the object declarations at the top of the scripts correctly. I have an erf in the package with the trigger and portal etc premade so you dont have to worry about it . . . if you use them. Sounds like you are trying to save the PC location via triggers for each area which should work. But saving the location does not put them back where they were. You must also read the location when they come back and place them where they were. Also, the loc_jump script will not work in the onclient enter script. The PC object is not useable as it is not fully loaded into the area onclient enter. You must use the script in a portal or trigger or an area onenter script. I have this setup working in my module perfectly well . . . so I am certain that the reason you are having difficulty is due to improper use of the scripts. Check out the demo module for proper useVuldrick Garrison _________________________ Vuldrick Garrison
Posted by puket at 2004-12-0716:31:00
There is a big problem with this location saving.I placed some triggers with area_loc_saving in my Cities (online mod) If a player is leaving a city and goes further in the mod some areas and he logs out and log back in the still running module he will be allways transported back to this city area location saving.I'm not using a portal on client_enter.The loc_jump script is in the module on_client_enter.So I must say it is not very flexible for me.
Posted by Vuldrick at on08/06/06
Okay, just to be on the safe side, and to take concerns about database issues after resave . . . I went ahead and modified the scripts to save the area tag and vector for the PC into the database. Should not be an issue now for sure. Thanks for the thoughts . . . let me know if this seems better.Vuldrick Garrison _________________________ Vuldrick Garrison