Confused - Teleporting to Battlegrounds

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

Confused - Teleporting to Battlegrounds

Postby Axeblood » Sun Feb 08, 2009 1:26 am

I'm trying to understand how this is intended to work. My programming skills are still at baby level, but I'm learning which is actually fun. So far I can use teleporters for everything except battlegrounds and housing. My guess is if I understand how either one works I'll be able to make both work.

Here is what I understand so far:

I can place a teleporter where I want in the world with these commands
/mob create DOL.GS.AlbionTeleporter (or whichever realm it is)
/mob realm 1 (again, match whichever realm it is 1,2,3)
These seem to be the only absolutely necessary things

So next I look in the class file for the teleporter I am using. The NPC is able to interact with players. When clicked, a string is displayed with world place names which can be selected. I modify this to my liking and compare these names to the entries in my database teleport table. They are all present except for battlegrounds. Spelling is all correct except for case which is ok because on select, ToLower makes them all lower case.

Now I look at the case statements which match these destination names in lower case. They are all there including "battlegrounds". So, my first clue is that either I need to add "battlegrounds" to the teleport table or it has to be a special case handled in some other way. I've noticed that for every location I want to display and select, the corresponding entry in my teleport table has to be there with correct spelling. When I make changes to this the effected location stops working, as I expect. Now, how should battlegrounds work? Obviously something must happen to select the correct BG destination based on player level and realm rank. A single entry in the teleport table would not suffice, but I fool with this anyway before giving up and reading some more.

Next I see that once the destination is picked it gets passed to another method named Teleport along with the player and destination information. Somehow, that gets matched to the coordinates of places in the teleport table. I decide I need to see how that works in order to figure out why battlegrounds fails and other places succeed.

I look in GameTeleporters.cs and find a section that handles this special case. There are not a lot of comments, but clearly I'm in the right place. First, it checks to make sure BG zones are open and PrivLevel is correct. I make a note that either of these could be a problem, but since I'm not sure how to check for either, I will just assume these are OK right now.

The real work seems to be done by KeepMgr.GetBGPK but before I go see how it works, I notice that once it determines a portalKeep for the player, it will derive the realm, region, and XYZ coords from there, finally teleporting to that spot. This is making sense!

Now I look in KeepManager.cs to see how the seemingly magical GetBGPK works. Here is where I come to a dead end. It looks like GetBGPK iterates through the keep table finding all keeps that are not Cathal, not a PK, and have min and max level values matching the player level and checking realm rank level is right. This part is ok. I was confused by the entire if starting at 278 but now I get it. However, now what? I don't see the glue from this point.

We have the CK keep ID and the player realm and Region ID, so it should be possible to now find the PK for the player realm in that region, but I don't see anyplace where the XYZ coordinates for the PK are found. There are Border Keep coordinates near the end of this class file, but nowhere do I see how the PK locations can be found. I was following along, but somewhere I came off the tracks. Can anyone help?

One thought I have is maybe I need to add every BGPK to my keep table. I am just guessing that this may be how the locations are found. I just have not been able to follow the code to that point yet so its a guess.

As always, thanks for the great work here. No matter what I'm having the most fun possible while learning to write code.
Axeblood
DOL Initiate
 
Posts: 20
Joined: Thu Jan 29, 2009 2:10 pm

Re: Confused - Teleporting to Battlegrounds

Postby Dinberg » Sun Feb 08, 2009 9:06 am

You will need the pk's of the battleground for it to work. Also, take a look at the 'Battlegrounds' table - fill it in and the battleground teleport should work when you have the keep aswell :D

(The script selects the appropriate battleground for your level using that table, so I'm guessing if empty it wont work ^^)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Confused - Teleporting to Battlegrounds

Postby Axeblood » Sun Feb 08, 2009 12:39 pm

Thanks for the reply.

I have already inserted a record for each of the battlegrounds I plan to use. (I'm only using 4)
I think maybe my problem is the wrong keep type value set on the PKs and CKs in my keeps table.
These were all set to 0 for some reason. I tried to use values from keeps.cs where I found eKeepTypes stating at line 54
However, I'm not sure how significant these values are.

Suppose I want to create a battleground and call it Braemar, but I want its level range to be 5-25
It looks like I can do that in the battlegrounds table, but when I put the PKs and CKs in my keeps table which keep type do they get?
It seems like all of these might work:

CaerClaret = 11, assign keep type 11 to the CK in this BG
BG10_14 = 12, assign keep type 12 to all PKs in this BG
CKBG15_19 = 13, assign keep type 13 to the CK in this BG
BG15_19 = 14, assign keep type 14 to all PKs in this BG
CKBG20_24 = 15, assign keep type 15 to the CK in this BG
BG20_24 = 16, assign keep type 16 to all PKs in this BG

I guess what confuses me is I expected a value for all PK, another value for all CK, maybe another value for towers, another for RK...
I don't know which value to assign to keep type in my case because I want a BG that has different min and max level. So far none of the values I pick seem to work.

If I understand how it works, getBGPK only needs to know that it has found a BGCK in the level range that matches the player. Then it determines the right PK based on player realm and region. So why have all of these type values?
Axeblood
DOL Initiate
 
Posts: 20
Joined: Thu Jan 29, 2009 2:10 pm

Re: Confused - Teleporting to Battlegrounds

Postby Axeblood » Sun Feb 08, 2009 3:59 pm

So, after a little more trial and error I realized I was using incorrect region IDs. Once I found the right ones I just made them match between keep table and battleground table and it all works!

There is still some oddness with doors to figure out, and I still don't understand why each BG gets its own keep type values, so there is more to learn, but its fun. Thanks Dinberg for the earlier reply.
Axeblood
DOL Initiate
 
Posts: 20
Joined: Thu Jan 29, 2009 2:10 pm

Re: Confused - Teleporting to Battlegrounds

Postby Dinberg » Mon Feb 09, 2009 4:42 pm

Axeblood wrote:There is still some oddness with doors to figure out, and I still don't understand why each BG gets its own keep type values, so there is more to learn, but its fun. Thanks Dinberg for the earlier reply.


Yeah I still dont entirely understand this myself. I'm presuming the error where some of the doors work, all of them work for admins, but a few dont work for normal players?
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Confused - Teleporting to Battlegrounds

Postby shanegru63624 » Fri Oct 17, 2014 7:38 am

where can i find the settings to let players enter the battlegrounds?
the regular teleporter works for staff members but not plvl 1.. any help we would be nice.. thanks
shanegru63624
DOL Novice
 
Posts: 70
Joined: Tue Jan 28, 2014 10:31 am

Re: Confused - Teleporting to Battlegrounds

Postby HunabKu » Sat Oct 18, 2014 5:39 am

"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 1 guest