Coder Social home page Coder Social logo

sm_overview's Introduction

0.6.6 Update Broke JSON

Scrap Mechanic's Nov 0.6.6 update broke the JSON export to file method, for a workaround see the github issue with workaround. I have emailed the developers about the issue but with the holidays will probably be a while for a response.

Introduction

This quickly outputs the world data of your scrap mechanic save game to a json file for display via leafletJS from pre-screenshotted tiles. Not quite as beautiful as my older screenshot method, but SOOOOOoooooo much quicker. This method is somewhat future proof as well. New tiles will still be displayed just blank, but updates should only require a new download of the missing tiles images.

Example

https://the1killer.github.io/scrapmechanictilemap/

INSTRUCTIONS

!!!! BACKUP YOUR SAVE, not responsible for any issues !!!!

  1. Really backup your save!
  2. Download this repoistory, green "Code" button on the top right, or Download Link
  3. Open terrain_overworld.lua from the downloaded files.
  4. Copy lines 132-157, local cells ...to... cells = nil end
  5. Open terrain_overworld.lua in your game files, e.x. C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\terrain\terrain_overworld.lua
  6. Paste the lines into the game's terrain_overworld.lua, approx line 130, after CreateCellTileStorageKeys() within the Load() Function.
  7. Replace tile_database.lua in your game files with the one from the downloaded files. E.x. C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\Scripts\terrain\overworld\tile_database.lua
  8. Load your save game.
  9. Copy cells.json from your game files C:\Program Files (x86)\Steam\steamapps\common\Scrap Mechanic\Survival\ to the html\assets\json directory in the downloads.
  10. If hosting on a webserver
    1. Copy all the files under html/ to your webserver and open index.html and good to go.
  11. If viewing locally
    1. Open cells.json, select all text (ctrl-a), copy all text
    2. Paste text into https://codebeautify.org/jsonminifier and click "minify/compress" then copy the resulting text on the right
    3. Open html/index.html, on line 26 SMOverviewMap.init(); add two back ticks( ` ) inside the parentheses
    4. Paste the text from Part 2 inbetween the backticks. becomes SMOverviewMap.init(`[[{......`);
    5. Open html/index.html to view your map
  12. If you wish, remove or comment (--) the added lines in terrain_overworld.lua to improve game loading times

Some things to note

  • Terrain height not really shown.
  • Game updates will remove the lua changes, requiring you to re-add them
  • How to setup your own free GitHub website
  • I think there could be some missing road/cliff tiles as there are many possibilties on how they mesh with eachother. Create an issue with your map seed and I can try to capture them.

Changelog

  • v1.0.0
    • Initial Release

Donation

If you love this project and want to see more features give the developer a cup of coffee!

paypal

Tutorial Video

Thanks to LionHeartBlue Gaming to making a tutorial video. Most people will need Option 2 listed above and in the video.
Remember to enclose the JSON with back ticks `.

Tutorial Video))






Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Scrap Mechanic is property of Axolot Games AB, I have no affiliation with them.

sm_overview's People

Contributors

captnwalker1 avatar iiloni-umd avatar itai-iloni avatar the-killer avatar the1killer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sm_overview's Issues

No cells.json

Hey great looking tool! I am trying to get it to work for my game but there is no cells.json in the folder "\steamapps\common\Scrap Mechanic\Survival". I searched the entire Scrap Mechanic directory and there is no cells.json at all.

I created a world in Survival, assume it should have been generated? I'm new to the game though, so maybe I'm missing a step.

explorer_2021-01-10_16-19-03

Any idea what I need to do? Thanks!

No .json file :(

I think it stopped working after update 0.6.6, in the changelog it says:
Blocked sm.json.save from saving to invalid locations

And my game log files have these lines:
21:54:44 (415317/768) [Lua] UpgradeCellData - version: 2
21:54:44 (415317/768) [Lua] - No upgrade needed
21:54:44 (415317/768) [Lua] ERROR: ..._DATA/Scripts/terrain/terrain_overworld.lua:154: '$SURVIVAL_DATA/cells.json' is not located in the same content id as the caller
21:54:44 (415317/768) [Lua] ----- Lua Error Traceback -----
[C]: in function 'save'
..._DATA/Scripts/terrain/terrain_overworld.lua:154: in function 'Load' (Lua entered on line number: 112)

Here is my full log:
game-20231109-215434.log

I'm too dumb to try fix the problem myself, can somebody help me?

Error while loading cells.json

Successfully generated a cells.json but when I tried to load it in the web viewer, was presented with a console error (and blank map).

./assets/json/cells.json had a problem loading. Sorry!

cells.json.txt

Missing Tiles

Here are some missing tiles:
Missing tile at 14,7 for id 1085201 NONE
Missing tile at 13,14 for id 1085201 NONE
Missing tile at -10,12 for id 1004601 NONE

Map Seed: 46380146

Full Image

id love to have a full image of the map that i could save to print it and put on a pinboard for example my friends and i have already made tracks and routes around the map in snipping tool but id love a full image to put into a virtual sketchpad for example to share

Cells.json not being created

I follow the instructions in the video guide, and after I start the game, going into the world I want, and then checking the survival folder, it doesnt create the cells.json folder. I check indentation, and tried just replacing the vanilla terrain file with the one supplied and it didnt work either.
Could it have something to do with the new line between the UpdateLocationStorage() and return true lines?

Suggestions - Saveable markers and tile highlighting

  1. Saveable markers:
    • Add a 'pin' toggle to the window that pops up when you mark the map. This would simply make it so that this marker is not removed when you click away. Should also change color/icon to differentiate from regular click marker.
  2. Tile highlighting:
    • In the 'Map Statistics' window, add another column to the percentages table. Make it first column. Only containing a checkbox input. Enabling this checkbox would highlight all tiles of this type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.