Stormworks: Build and Rescue

Stormworks: Build and Rescue

34 Bewertungen
Lua imaging
Von PenguinO und 1 Helfern
Lua imaging guide

Well, since we have some draw commands but no direct I/O access from in-game lua code, just go ahead and draw things.
With knowledge of bitmap anyone can draw images with in-game command.
To save time doing labor works, PenguinO (Me), Tajin and CrazyFluffyPony made some tools that work differently for similar goal.

Tajin's lua paint tool was later dropped
   
Preis verleihen
Favorisieren
Favorisiert
Entfernen
PenguinO's Tool
PenguinO's Tool

Intro:
I find that there is no I/O access from lua code/script which is good in terms of security.
I want some nice pictures on the screen so I first started with RGB332 but this did not end well.
Next, I realized that 8-bit bitmap has many advantages including transparency so I have to make a tool to turn pixel data and color data into readable number.
From the list/table of number, I put some lua code to draw.
And from the early goal, the tool was made to create logo screen so it's named like that.
It's also the reason that "Scale to Fullscreen" was made Mode1 (default).

First Version:


V 3.0:


Link to my tool is here:
http://project.gfcom.info/swlogogen/


Instructions
1. Choose your image file
2. Set desired parameters
3. Upload
4. Copy the output code

Tell your friends if this tool is useful

Some screenshot from code generated

Advantages
  • First to be available
  • Show analyzed image data
  • Generated codes and data are to be readable
  • Has customizable settings for code generation
  • Support transparency
  • Image conversion was added to V3 update to support other image types

Limitations
  • Has limited total colors per image
  • May require to process multiple passes to adjust some settings
  • Require manual selection to split code into multiple blocks

PS About the tool
My Lua code generator for Logo for Stormworks was initially made specifically for Uncompressed Windows BMP 8-bit indexed color only.
Then later I added ImageMagick to do conversion from other type but it comes with some limitations.
- image with less than 17 colors becomes 4-bit BMP =>>> Error
- GIF with multiple frames is unhandled =>>> Error

I'm not a great writer for documentation things
CrazyFluffyPony's Tool
CrazyFluffyPony's Tool

This tool can convert any image file your browser is supporting.

The tool creates a compressed string of the image data and some lua code.
The lua code uncrompresses the string back (once on vehicle spawn) into a two dimensional table, each entry containing the hex value of one pixel.
Every time onDraw() is called the code paints all the pixels onto the monitor.
That means you can adjust the image data on the fly.



Advantages
  • Supports many image file types
  • You can customize the lua code used to paint the image
  • Select the color depth
  • Splits code into multiple lua scripts if the code exceeds the maximum character length of lua scripts.
  • Can be used offline



Link
https://image-to-lua.flaffipony.rocks/

7 Kommentare
Neurosys 18. Feb. 2023 um 11:29 
@Dansky - y u no learn2code?
Dansky 24. Feb. 2021 um 16:49 
So do I need a degree in game development to have this? Looks complicated, and I don't know code.
sunblock50 22. Juli 2020 um 8:52 
Nice job.
Jesse1125XD 17. Okt. 2019 um 21:32 
Thanks
Catmandoe1 2. Juli 2019 um 10:25 
great!
powder12321 26. Juni 2019 um 7:39 
Thanks
Schoenwax 22. Juni 2019 um 2:48 
helpful