Jump to content

ARK Tools v0.6.4 - tools for reading and manipulating ark savegame files


Qowyn

Recommended Posts

@Qowyn mate you are a legend for doing this, has helped so many people ..

Although this is kind of an offshoot issue, i am trying to convert the JSON to MySQL (MariaDB) but the code is having issues cause sometimes some of the data is missing, for example; female, imprinter, imprintingQuality ... are missing from some of them

[ CODE REMOVED - too buggy ]

Link to comment
Share on other sites

  • Replies 369
  • Created
  • Last Reply
2 hours ago, DrunkMunki said:

Although this is kind of an offshoot issue, i am trying to convert the JSON to MySQL (MariaDB) but the code is having issues cause sometimes some of the data is missing, for example; female, imprinter, imprintingQuality ... are missing from some of them

My code is as lazy as i am, but i can add an option to always output all possible fields.

About your PHP code: You are missing fullLevel in the VALUES part. I do hope that code is just an example. If not you should take it down if it is currently active. Otherwise i will find your server, tame a dino and give it.... a very special name. You may want to read up on SQL injection Vulnerabilities.

The first examples are now up in the wiki: https://github.com/Qowyn/ark-tools/wiki/Modification-File

I'll create examples for each command too.

Link to comment
Share on other sites

@DrunkMunki 

Your Column count is 30, your Value Count is 37.

'$f_health', '$f_stamina', '$f_oxygen', '$f_food', '$f_weight', '$f_melee', '$f_speed',

are duplicated in values.

You may wish to try a format like ...

$query = "INSERT INTO dinos SET
          x	= '". mysql_real_escape_string($x) ."',
          y	= '". mysql_real_escape_string($y) ."',
          z	= '". mysql_real_escape_string($z) ."',
          lat	= '". mysql_real_escape_string($lat) ."',
          long	= '". mysql_real_escape_string($long) ."',
           .... etc, etc,

Although PHP and MYSQL question are better answered here http://stackoverflow.com/ (99.99% typing the question into google will direct you to the answer there )

 

Link to comment
Share on other sites

21 hours ago, DrunkMunki said:

 

any ideas?

 

Replace that:

$sql = "INSERT INTO dinos(x, y, z, lat, lon, id, female, color0, color1, color2, color3, color4, color5, tamedAtTime, tamedTime, tribe, tamer, name, imprinter, baseLevel, b_health, b_stamina, b_oxygen, b_food, b_weight, b_melee, b_speed, fullLevel, tamed, experience)
    VALUES('$x', '$y', '$z', '$lat', '$lon', '$id', '$female', '$color0', '$color1', '$color2', '$color3', '$color4', '$color5', '$tamedAtTime', '$tamedTime', '$tribe', '$tamer', '$name', '$imprinter', '$baseLevel', '$b_health', '$b_stamina', '$b_oxygen', '$b_food', '$b_weight', '$b_melee', '$b_speed', '$fullLevel', '$f_health', '$f_stamina', '$f_oxygen', '$f_food', '$f_weight', '$f_melee', '$f_speed', '$tamed', '$experience')";

 

with that:

$sql = "INSERT INTO dinos(x, y, z, lat, lon, id, female, color0, color1, color2, color3, color4, color5, tamedAtTime, tamedTime, tribe, tamer, name, imprinter, baseLevel, b_health, b_stamina, b_oxygen, b_food, b_weight, b_melee, b_speed, fullLevel, t_health, t_stamina, t_weight, t_melee, t_speed, tamed, experience)
    VALUES('$x', '$y', '$z', '$lat', '$lon', '$id', '$female', '$color0', '$color1', '$color2', '$color3', '$color4', '$color5', '$tamedAtTime', '$tamedTime', '$tribe', '$tamer', '$name', '$imprinter', '$baseLevel', '$b_health', '$b_stamina', '$b_oxygen', '$b_food', '$b_weight', '$b_melee', '$b_speed', '$fullLevel', '$f_health', '$f_stamina', '$f_oxygen', '$f_food', '$f_weight', '$f_melee', '$f_speed', '$tamed', '$experience')";

 

You forgot the t_health, t_stamina, t_weight, t_melee, t_speed.

 

Link to comment
Share on other sites

@DrunkMunki 

Error : Column count doesn't match value count at row 1

Means there is a mismatch in the number of columns declared 

INSERT INTO dinos( <COLUMNS DECLARED HERE> )

and the values listed 

VALUES ( <VALUES LISTED HERE> )

If the error was because of incorrect data in the json file then the error you would receive would probably be 

ERROR: Database Error: Datatype mismatch in criteria expression.

Once again though, this is not the place for MYSQL or PHP errors/tuition.

Try http://www.stackoverflow.com or simply type your question into google and find the answer their.

 

Link to comment
Share on other sites

glob('/path/to/files/*.json')

will give you an array containing all file names.

foreach (glob("*.json") as $filename) {
    $content = json_decode(file_get_contents($filename), true);
    doStuffWithContent($content);
}

The best place for these kind of questions would probably be Stackoverflow: https://stackoverflow.com/

Link to comment
Share on other sites

  • 2 weeks later...

Ok, first of all, thank you very much for the hard work put into this.
Now, excuse me, but I'm in a hurry to go bash my head against a wall.

Somehow downloads got disabled on my cluster servers and my character got eaten by the Void. Because of the imprinting thing, I'm trying to find and change my new survivor ID to my old one. I already worked myself up quite a headache trying to mess with things I have no knowledge of, and right now I don't even know enough to know what knowledge it is I am lacking in using this tool. All I am managing is to open the general help list of commands, but I can't get anything ARKey to happen.
Any tips in finding and changing that survivor ID for a desperate noobie?

Link to comment
Share on other sites

Currently that will involve converting your survivor profile to json, changing the ID there to your old ID, and converting it back to the ark format.

ark-tools p2j /path/to/steamid.arkprofile /path/to/steamid.json

Edit with favorite Editor

ark-tools j2p /path/to/steamid.json /path/to/steamid.arkprofile

Really need to make a GUI for this... Just finished a rather big update for a mod i made, so i can finally focus on ARK Tools again.

Link to comment
Share on other sites

On 9/2/2016 at 1:05 PM, Qowyn said:

ark-tools tamed C:\path\to\save.ark C:\path\to\output\

 

I am getting an AccessDenied message from ark-tools citing my save directory.  I have a folder C:\Users\Bob\Scripts and unpacked the zipfile with your latest (.030) version.  I open a command prompt window as Bob which opens in \Users\Bob.  I cd to Scripts, and type ark-tools -help and I get the help page.  So that part is working fine.  I then created Tmp and Saved folders under Scripts and copied the entire contents of my SavedArksLocal folder to Saved. And then ran ark-tools as: 

ark-tools tamed c:\Users\Bob\Scripts\Saved c:\Users\Bob\Scripts\Tmp

And I get the following error:

java.lang.RuntimeException: java.nio.file.AccessDeniedException: C:\Users\Bob\Scripts\Saved

I'm running Windows 10 with Java version 1.8.0_101.  Maybe not the latest version but still quite recent.

Any thoughts?

Link to comment
Share on other sites

1 minute ago, boblienhart said:

ark-tools tamed c:\Users\Bob\Scripts\Saved c:\Users\Bob\Scripts\Tmp

If you play The Island this should be:

ark-tools tamed c:\Users\Bob\Scripts\Saved\TheIsland.ark c:\Users\Bob\Scripts\Tmp 

Exact filename depends on the map you play. Access denied happens because trying to read a folder as a file does not work well. Adding to the "to-fix" list.

Link to comment
Share on other sites

That was quick!

Thanks,  I read, "C:\path\to\save.ark" as a folder and I now see that you really meant the path to the appropriate .ark file.

Output looks pretty neat, especially after adding the --pretty-printing option and opening one of the output files with notepad++.

I once lost a scorpion after trying to knock down a quetzal that I could not find again.  I spent more than a couple of hours looking for it and had to give up.  The good news is that I stumbled upon it 3 or 4 months later and it was still alive and well :-).

Thanks again!

Link to comment
Share on other sites

New Update is being worked on. Changelog preview:

  • Support for .sav files, these files can be created by mods to store settings and other things
  • Support for some new data which can appear in savegames (still needs investigation)
  • ID of Tribe and Player for tamed creatures
  • Reliable detection of tamed creatures, should work for babies too
  • New option to write fields even if they have default values
  • New option to exclude all untameable creatures from wild creatures list

Support for .sav files will make it possible to do external editing to things like the Ark Customizer Item Modification Database. Combined with support for ScriptCommand via RCON you could implement a webinterface to make changes to ingame items.

Another usecase: extracting data from the game and your active mods via another mod, this mod could write things like structure and item names to a .sav file. Then my tool can read this to output real names for your items.

Link to comment
Share on other sites

On 8.11.2016 at 1:54 PM, Qowyn said:
  • ID of Tribe and Player for tamed creatures
  • Reliable detection of tamed creatures, should work for babies too
  • New option to write fields even if they have default values
  • New option to exclude all untameable creatures from wild creatures list

Really interessted in this things. :) Waiting for it ^^ Keep up your nice work!

Some additional functions which would be really nice:

- Container name where items are stored (For example storage boxes)

- ID of Tribe and Player for items (Can be read with the personal owner of a storage box. If someone is the owner of a storage box, then he is the owner of the items too. )

- ID of Tribe and Player for structures (When personal owned)

- Real values for durabilities, rating, hypo, hyper, dinostats, imprinting and and things like that. The actual values doesn't help me anything. I do not know how to convert this values into the real values ingame.

- Bugfixing for cluster functions  (ignore 0 byte and faulty files. If 1 file was faulty, ignore that and take the next instead of exit with an Exception)

- Active/Inactive flag for Player profiles (When you travel between servers with the same char, then the char is active on only one server, inactive on all others)

- Option for commands "player" / "tribes" to ignore files which are older than XY  (This will increase the generating time of the .json files and decrease the amount of generated data).

- Real item / blueprint names for mod items (maybe possible with your new .sav extension?)

*Realistic Wishlist End* ^^

 

And some not so realistic (too much effort) wishlist ^^:

- .jar file which runs endless and can handle webservices (REST). 

- Webservice like readclusteritemsforplayer(playerid)

- Webservice like saveclusteritemsforplayer(playerid,jsonfile)

- Webservice like addclusteritemsforplayer(playerid,jsonfile)

In other words:  An ability to read/write/manipulate cluster data from a webserver which isn't in the same network as the ark servers.

--> Would give us the possibility to create some trading platforms for the players

 

Bugreport for the actual version:

- cluster function couldn't handle 0 byte or faulty files

- tool doesn't work correctly for procedural generated arks (tribe items for example). Will provide you the Exception and Savefiles at the weekend.

 

 

All this things are meant as suggestions. Your tool is already very very great now. I love it ^^

Keep up your nice work! Let us know when you need some test data, help or what ever :)

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...