Windforge

Windforge

View Stats:
Stickboybob 23 Jun, 2015 @ 8:03pm
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)
Last edited by Stickboybob; 26 Jun, 2015 @ 10:18am
< >
Showing 1-9 of 9 comments
Emily Mewens 23 Jun, 2015 @ 9:18pm 
:DD
asdfasdf 24 Jun, 2015 @ 1:43pm 
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 13 Mar, 2016 @ 10:33pm 
So do we have a place to share saved ships somewhere, google has nothing...
Stickboybob 14 Mar, 2016 @ 12:28am 
we dont yet, though i think we should
JakeR1299 7 Feb, 2017 @ 11:59am 
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 7 Feb, 2017 @ 5:58pm 
@JakeR1299, Look at how Old the comments where, development for this game is basically dead. as is its fan base... :(
JakeR1299 7 Feb, 2017 @ 10:30pm 
I was hoping that someone on this discussion would know, because you all seem to be very happy about the mod.
Stickboybob 11 Feb, 2017 @ 3:01pm 
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 22 Jul, 2017 @ 2:43pm 
So where was ever a resolution? This sounds awesome.
< >
Showing 1-9 of 9 comments
Per page: 1530 50