# Conversion of Item Database to YAML

## Recommended Posts

Well I'll be damned... that was EXACTLY it.

Go to modules\item and look for a file called index.php

You're going to look for something like this in that file (I used notepad):

try {

if($server->isRenewal) {$fromTables = array("{$server->charMapDatabase}.item_db_re", "{$server->charMapDatabase}.item_db2_re");
} else {
$fromTables = array("{$server->charMapDatabase}.item_db", "{$server->charMapDatabase}.item_db2"); } I changed it to this and it worked:  if($server->isRenewal) {
$fromTables = array("{$server->charMapDatabase}.item_db_re_compat", "{$server->charMapDatabase}.item_db2_re_compat"); } else {$fromTables = array("{$server->charMapDatabase}.item_db_compat", "{$server->charMapDatabase}.item_db2_compat");
}

*** EDIT 2 ***

You also gotta do the same for a file called view.php inside of: modules\character

Go to the following line:

if($server->isRenewal) {$fromTables = array("{$server->charMapDatabase}.item_db_re", "{$server->charMapDatabase}.item_db2_re");
$mobdb = array("mob_db_re","mob_db2_re"); } else {$fromTables = array("{$server->charMapDatabase}.item_db", "{$server->charMapDatabase}.item_db2");

Then change it to:

if($server->isRenewal) {$fromTables = array("{$server->charMapDatabase}.item_db_re_compat", "{$server->charMapDatabase}.item_db2_re_compat");
$mobdb = array("mob_db_re","mob_db2_re"); } else {$fromTables = array("{$server->charMapDatabase}.item_db_compat", "{$server->charMapDatabase}.item_db2_compat");

*** EDIT 3 ***

LoL... found another... view.php inside of: modules\item

Went to the following line:

if($server->isRenewal) {$fromTables = array("{$server->charMapDatabase}.item_db_re", "{$server->charMapDatabase}.item_db2_re");
$mobdb = array("mob_db_re","mob_db2_re"); } else {$fromTables = array("{$server->charMapDatabase}.item_db", "{$server->charMapDatabase}.item_db2");
$mobdb = array("mob_db","mob_db2"); And then changed it: if($server->isRenewal) {
$fromTables = array("{$server->charMapDatabase}.item_db_re_compat", "{$server->charMapDatabase}.item_db2_re_compat");$mobdb = array("mob_db_re","mob_db2_re");
} else {
$fromTables = array("{$server->charMapDatabase}.item_db_compat", "{$server->charMapDatabase}.item_db2_compat");$mobdb = array("mob_db","mob_db2");

There's an obvious pattern here... so if you find a broken item link, just keep following the path...

Edited by Ninjininja
Change #1: index.php - Change #2: view.php - Change #3: another view.php - Change #4: Code box
##### Share on other sites

can someone help me to show how this work? how to compile this item.

##### Share on other sites

10 hours ago, Takuyakii said:

can someone help me to show how this work? how to compile this item.

Not sure if this is the correct way, but through trial and error I got the .txt to .yml results! Community, please correct me if needed so that I'm not misinforming anyone.

1. In Visual Studio, open your rAthena project
2. Expand the Tools folder and select csv2yaml.bat (this file is already in the latest pull in the \rathena\ root folder)
3. Clean and Build csv2yaml.bat. This creates csv2yaml.exe in \rathena\.
4. Run this .exe to convert .txt files in your \db\import\ folder to .yml

_____

HUGE thanks to the rAthena dev team. This is such a fantastic improvement -- I'm brand new and don't know code for jack, but find this .yml layout SUCH a huge QoL improvement

Edited by Reinheiten
##### Share on other sites

On 1/25/2021 at 11:41 AM, Ninjininja said:

Seems that by default the program looks at (in my case) item_db_re and item_db2_re. However it now needs to look at (in my case) item_db_re_compat and item_db2_re_compat.

Exactly, i've already modified Flux source to read those views instead the tables, but it throws another error (idk if it's something about php that can't query/handle views).

I also started to edit all the item module to match rA's db tables as they are, even trying to reproduce the view's logic, but i don't have much php knowledge, no success there either.

On 1/25/2021 at 11:55 AM, Ninjininja said:

Well I'll be damned... that was EXACTLY it.

Hi.

I tryied exactly that a while ago, but it still doesn't works, it throws the following error:

Error: Flux_Error

Message: MySQL error (SQLSTATE: 42000, ERROR: 1055): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database.items.origin_table' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

File: /homepages/27/d852944277/htdocs/cpanel/modules/item/index.php:283

##### Share on other sites

Hmm... you might be overengineering the problem. Your error seems to state the solution to the problem you're having:

SQLSTATE: 42000, ERROR: 1055
this is incompatible with sql_mode=only_full_group_by

Isn't "SQLSTATE: 42000, ERROR: 1055" an access/permission error? Why do you have "sql_mode=only_full_group_by" enabled? Says it doesn't like that.

##### Share on other sites

OMG!!! XD You're absolutely right!, I was still blaming the views and/or the module, due that all other modules and querys works just fine with full group by. Disabled full group by and now it work's as it should.

The simplest sollutions sometimes are the hardest to see when you're stuck XD.

Thank you so much my friend!.

##### Share on other sites

Does the skill DB work like the item and monster DBs? I tried to update certain sections (duration) of skills but I get errors making me believe that skills are imported differently and it wants the entire skill.

##### Share on other sites

why i cant wear the custom headgears im making but i can wear custom weapons ?
they got like all job restriction and equiplevelmin 1. i even copied appel o archers itemscript and still cant wear the custom headgear.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
• Forums