• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Database change by flagging

Status
Not open for further replies.

bizzlesnaff

Emulation Addict
Hey guys
I try to create something like an open bg. For that I need to change some database values. My question is, is it possible (if yes, how) to change any value in the database by use a flag?
So, like in Arathi Basin I tap a flag and, just for example, in the database appear the playerguid or something.

I appreciate every little hint :)
 

Tommy

Founder
Hey guys
I try to create something like an open bg. For that I need to change some database values. My question is, is it possible (if yes, how) to change any value in the database by use a flag?
So, like in Arathi Basin I tap a flag and, just for example, in the database appear the playerguid or something.

I appreciate every little hint :)

I don't get the point of this. Open BG? Do you mean OurdoorPvP? Why would you want to save the player's guid in the database when they hit a flag? Waste of querying. Just save the guid in a variable, no need for database usage at all. Be more specific and elaborate what you want.
 

bizzlesnaff

Emulation Addict
Yes, like 1k Winter. But not just for 30 minutes..more than a few days.

Well, player A hit flag Alpha and when the casting bar disappear, a world message say something like "player A captured flag Alpha". Player A get some points for his stunt and can use them later for..well, that's not important I guess :)


I like to use the database, because this is an environment I know. I'm not good enough to play around with variables or something like that. And (I don't know, but I think) everything in the Database is "safe". So if the server is shutting down the points stay, didn't they?
 

Tommy

Founder
Yes, like 1k Winter. But not just for 30 minutes..more than a few days.

Well, player A hit flag Alpha and when the casting bar disappear, a world message say something like "player A captured flag Alpha". Player A get some points for his stunt and can use them later for..well, that's not important I guess :)


I like to use the database, because this is an environment I know. I'm not good enough to play around with variables or something like that. And (I don't know, but I think) everything in the Database is "safe". So if the server is shutting down the points stay, didn't they?

Yes, data will save if it is saved within a table, but you had literally no information about what you want so what I said was pretty valid at the time. However, to do something like this would require:

1. A new table, columns: guid, points.
2. Create a player specific variable called "points" or w/e.
3. Load points (select points by "player->GetGUID().GetCounter()" specifically selecting the player's data) when player is logging in (perhaps before that if possible?).
4. Increase points on flag capture and save points on spot OR have the points save whenever the PlayerSaveInterval ticks (recommended).
 

bizzlesnaff

Emulation Addict
Thank you so far ;)
But how do I know that the player interact with the flag? I mean, I take a Gameobject and this Object get a Script. But what is in the script? Is there any function like "if player interact with object then..."?
I've already searched in old threads but I use the wrong tags, or I'm just stupid as hell :/
 

Tommy

Founder
Thank you so far ;)
But how do I know that the player interact with the flag? I mean, I take a Gameobject and this Object get a Script. But what is in the script? Is there any function like "if player interact with object then..."?
I've already searched in old threads but I use the wrong tags, or I'm just stupid as hell :/

Well if you are wanting this to be an OutdoorPvP project I'd suggest using OutdoorPvP base for your script (examples). There's also a function to handle opening gameobjects "virtual int32 HandleOpenGo(Player* player, GameObject* go);" within the base class.

I'm not sure if my OutdoorPvP template is outdated or not, but you can learn from it: http://emudevs.com/showthread.php/58-Basic-Intermediate-Scripting-Templates

We don't do requests on EmuDevs so I can only help as much as I can. If you create the script and whatever needed, basically get it started I can help further.
 

bizzlesnaff

Emulation Addict
First, thanks for all this great Links :D
Second, yes your OutdoorPvP Template ist outdatet ;) Wasted 4 hours trying to fix it up for me :p

The whole OutdoorPvP-Thing seems to be more complicated then i thought..maybe it's not the right time for me to try this now :D
 
Status
Not open for further replies.
Top