Windforge
Stickboybob 2015년 6월 23일 오후 8시 03분
Saving and Loading Custom Ships
Hey guys, I noticed that the custom ship screenshot discussion was hands down the most popular thread in the steam forums. There were so many creative & thoughtfully crafted ship designs that I found myself wishing I could take a few for a spin around the planet. Alas, there was currently no way to share them so i resolved to find a way. After a bit of code crawling and several dead ends I was surprised to discover that there is actually a remarkably simple way to save and load ships as .lua text docs.

It makes it possible to share ships with freinds, tryout the unused/test ships located in the Big.FILE, spawn EnemyShips, take ships with you into new games, and create ships with crews (with a few alterations to the .lua file of your ship).

I present to you..

Saving and Loading Custom Ships

Before these will work you must

  • activate DevMode
  • rebind the screenshot key to something other than f12 (steam->settings->in-game)
  • IMPORTANT: Either alter the file path in the code or create the directory Objects/Airships/UserShips in the Data folder.
  • Paste one of the following into ConsoleCommands.lua (located in the /Data folder. If there isnt one you must create it. .lua files can be edited and created with notepad)

Saving
- Pressing f12 will save the ship you are currently captaining to file (Default is Data/Objects/AirShips/UserShips) Wherever you save to you you must make sure the directory exists or you will get an error message. A new file will be generated for each ship so you can save multiple ships on one load.

require "Utils" local saveBasePath = "../Data/Objects/Airships/UserShips/ShipSave_" local savePath = saveBasePath .. os.time() .. ".lua" SaveShipToLua(savePath) ShowInformationText("Ship saved to: "..savePath, 6.0)

Loading
- Pressing f12 will load a ship at the coordinates of your cursor (Default path is Data/Objects/AirShips/UserShips/MyShip.lua) Ships can then be piloted and registered like any other. You can also load multiples of a ship. Just dont load them over other ships or terrain or the physics get unhappy.

LoadShipFromLua("../Data/Objects/Airships/UserShips/MyShip.lua", "", true)



Ive only tested it locally so let me know if theres problems or more info/uses/limitations that i need to include. Have fun and if you found this useful send me a ship. :-)
~Vitic (aka Stickboybob)
Stickboybob 님이 마지막으로 수정; 2015년 6월 26일 오전 10시 18분
< >
전체 댓글 9개 중 1~9개 표시 중
Emily Mewens 2015년 6월 23일 오후 9시 18분 
:DD
asdfasdf 2015년 6월 24일 오후 1시 43분 
Cool, ship sharing sounds like a great idea. One thing to be careful about when loading ships is to make sure they aren't going to load on top of things. (like islands or other ships)

This causes the physics system to slow down quite a bit, and you may have to restart the game in some cases.
raz334 2016년 3월 13일 오후 10시 33분 
So do we have a place to share saved ships somewhere, google has nothing...
Stickboybob 2016년 3월 14일 오전 12시 28분 
we dont yet, though i think we should
JakeR1299 2017년 2월 7일 오전 11시 59분 
This didn't work for me but I think I've done something wrong. When I go to save my ship it saves empty space, even when I'm piloting the ship i want to save.

Also, you say that we should only copy and paste one of the codes, if that is so, then how do we save AND load ships without having to edit the code mid-game
raz334 2017년 2월 7일 오후 5시 58분 
@JakeR1299, Look at how Old the comments where, development for this game is basically dead. as is its fan base... :(
JakeR1299 2017년 2월 7일 오후 10시 30분 
I was hoping that someone on this discussion would know, because you all seem to be very happy about the mod.
Stickboybob 2017년 2월 11일 오후 3시 01분 
i never did find a way to save and load ships without editing code mid game. i just minimized and changed the doc. its certainly something i'll look into though.
Shade 2017년 7월 22일 오후 2시 43분 
So where was ever a resolution? This sounds awesome.
< >
전체 댓글 9개 중 1~9개 표시 중
페이지당 표시 개수: 1530 50