Accessing database for certain info

So with 2.5 they added the ability to view how many building pieces your guild currently has. I am trying to find that number in the database with no luck. Hoping someone with SQL experience here could help me out!

Is there no where to view this in the admin panel or sever setting of your host. ??

No, I run a server with mild rules (10k building pieces, pretty much it) so im trying to figure that out in the database so I can keep an eye on how much people are using.

I have not played with the database for the game yet. I do know a bit about .sql but I’m not sure it’s enough to help out. Do you have access to anything called “phpmyadmin” ??

No, im just viewing it with a SQL veiwer. So I figured out what I think i need to do but I can’t remember to write the execute.
SELECT * FROM ‘building_instances’ LIMIT 420,30
There is a column called instance id, that shows the guild ID and each piece they put down. I need to some how have it add all of that column together for each individual instance id. if that makes sense

Does this help at all. Like I said I have not played with the game database at all and it has been a few months for playing around with php and .sql:

This may help as well:

I hopped into my singleplayer game and looked at the numbers, then opened game.db in SqliteBrowser. I’ll describe the queries I can use to produce the same numbers I see in-game, but bear in mind that this is my single-player game, so I haven’t been able to test it on a game.db with multiple players and clans.

First, get either the ID of the clan you want to check:

select guildId from guilds where name = "Subjects of Cant"

or the ID of the clanless player:

select id from characters where char_name = "Toa-Sytel"

Then, use that ID (744 in my example) to count the total number of building pieces:

select count(*)
from building_instances
where object_id in (
  select object_id
  from buildings
  where owner_id = 744
)

And to count the placeables:

select count(*)
from buildings
where
  owner_id = 744 and
  object_id not in (
    select object_id from building_instances
  )

I hope that gives you correct results.

1 Like

What CodeMage posted may help a lot more. :grinning:

You are a god. Thank you so much. Works perfectly.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.