PDA

View Full Version : $client->GetStartZone() or similar


joligario
06-22-2009, 08:32 PM
Currently, the creation of a character goes through code to select the starting zone. However, this variable does not seem to be stored in the pp (from what I can tell). This would be good code to reuse. Biggest would be the Return to Home City button on Character Select screen. Second would be good for the LDoN adventure stones so that we can write code if they are in their home town.

Davood
06-23-2009, 10:41 AM
Currently, the creation of a character goes through code to select the starting zone. However, this variable does not seem to be stored in the pp (from what I can tell). This would be good code to reuse. Biggest would be the Return to Home City button on Character Select screen. Second would be good for the LDoN adventure stones so that we can write code if they are in their home town.

and the origin aa ;o

trevius
06-23-2009, 06:31 PM
Yeah, there should be room for up to 5 bind points in the PP. Some of them might be needed to get the respawn window fully functional anyway. I started work on the respawn window, but there are other issues that need to be worked out before it can be finalized. As far as I know, the go home option from char select should be working, though I haven't tried it yet. It may just be using a case selection for the go home instead of storing it in the player profile on creation as it probably should be doing.

realityincarnate
06-25-2009, 09:25 AM
The Return Home button currently takes you to your bind point. As Trevius said, there is room in the player profile struct for five bind points, the first of which is the traditional "bind point", and at least one other looks like it's used to give options for the respawn window. Can anyone see anything wrong with using the fifth slot to store the starting city bind point (other than having to provide a method to update all the characters that don't have a stored home city)?

cavedude
06-25-2009, 12:09 PM
The Return Home button currently takes you to your bind point. As Trevius said, there is room in the player profile struct for five bind points, the first of which is the traditional "bind point", and at least one other looks like it's used to give options for the respawn window. Can anyone see anything wrong with using the fifth slot to store the starting city bind point (other than having to provide a method to update all the characters that don't have a stored home city)?

I think using the last slot to store starting city is just fine.

The trick is going to be backflagging all the old players. I think the best way is to have world fill in coords when the toon logs in (assuming it has no data) and use start_zones to determine it. This will be accurate for most, however some players have a choice of starting city. For those, perhaps some sort of in-game command? They can use it, it'll report the cities they can choose from to act as their starting city (based on start_zones) and they pick one.

ChaosSlayerZ
06-25-2009, 12:25 PM
I see a slight problem with return Home (and perhaps Origin?)
What if Db admin has changed where everyone is starting?
Including using complitly non legit zones?

also does Origins sends you back to home town or to Bind point?

joligario
06-26-2009, 09:15 PM
If the database has a custom home point, he/she can always force the same home point.
Pretty sure origin was home town.

Another good use for one of those bind points: OoW PoD returning you to the zone in which you traveled to Draniks.

realityincarnate
06-30-2009, 09:28 PM
Ok, I got sidetracked over the weekend, but I finished up and committed the home city code tonight. Here's an overview of the things I added:

The binds[4] slot in the player profile now tracks the home city bind point for all newly created characters. The bind point is set to where the character is initially bound, so it works for entries in the start_zones table as well as SoFStartZoneID rules and startzone variables.

For older characters, the char select screen will attempt to assign a home city. It does this by first checking for a starting zone variable, then checking the start_zones table. If there is only one possible home city, it assigns it. Otherwise, it leaves it unassigned.

For characters that have more than one possible city, or for later changes, I added a couple of commands. The client /setstartcity command gives the player a list of possible starting zones (pulled from the start_zones table) and allows them to select one. GMs have a #setstartzone command which takes either a zone number of shortname as an argument. Using #setstartzone 0 (or #setstartzone reset) will clear the player's home city and let them set it themselves.

Finally, $client->GetStartZone() and $client->SetStartZone() are new perl commands. GetStartZone() returns the zone number of the player's home city. The format to set a zone is SetStartZone(zoneid, x, y, z). The x, y, and z coordinates are optional, but if you specify one, you need to give them all. If they are left off, the coordinates are the zone's safe point.

That was a mouthful. Let me know if I missed anything or if there are any problems.

joligario
06-30-2009, 09:57 PM
Sweet! That rocks. I can't wait to try it out. That will help me finish off the LDoN Adventurer's Stone quest.

Sylaei
10-25-2009, 01:25 AM
This command $client->GetStartZone actually seems to do just that, get the start zone, not the home zone. I was wanting a way for someone to leave the tutorialb zone and go to their home zone. I could do this with a bunch of if statements but I thought maybe getting the start zone and porting them there would be better.

Anyway if you choose to get into the tutorial from character creation your startzone is listed as tutorialb. If you go to your home city first then the tutorial, it is listed as your home city.

So this is mostly an FYI.

realityincarnate
10-25-2009, 09:47 AM
You're using SoF, right? As best I can tell, if you select the tutorial, the SoF client doesn't actually send your home city info at all. At this point, I think Sony just assumed everyone was going to Crescent Reach and didn't really care if you picked somewhere else.

I'd been meaning to change it so that it at least worked properly for characters with only one option for start city, but I'm writing a thesis at the moment, so my hobby programing time is pretty limited.

Sylaei
10-25-2009, 02:00 PM
Yes I am using SOF. I just thought I'd through this out there, as it was confusing to start with. It would be nice if it worked with the characters with only one starting city. I have been toying with a task to automaticaly ask what they want the start city to be if the start city is set to tutorialb.