Magically import images and more into Gamecraft as blocks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.8KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Pixi
  2. A mod for importing images and more into Gamecraft.
  3. Developed by NGnius.
  4. ## Installation
  5. Before installing Pixi, please patch Gamecraft with [GCIPA](https://git.exmods.org/modtainers/GCIPA/releases) and install the latest version of [GamecraftModdingAPI](https://git.exmods.org/modtainers/GamecraftModdingAPI/releases).
  6. Once that's done, install Pixi by copying `Pixi.dll` (from the latest release) into the `Plugins` folder in Gamecraft's main folder.
  7. Alternately, follow the install guide: https://www.exmods.org/guides/install.html (ignore the part about a zip file -- move Pixi.dll into the Plugins folder instead).
  8. ## Usage
  9. Pixi adds new commands to Gamecraft's command line to import images, and other stuff, into a game.
  10. Since Pixi places vanilla Gamecraft blocks, imported files should be visible without Pixi installed.
  11. For the following section, anything between `[` and `]` characters is a command argument you must provide by replacing everything inside and including the square brackets.
  12. An argument like `[dog name]` is an argument named "dog name" and could be a value like `Clifford` or `doggo`,
  13. and `@"[dog name]"` could be a value like `@"Clifford"` or `@"doggo"`.
  14. ### Commands
  15. `PixiText @"[image]"` converts an image to text and places a text block with that text beside you.
  16. `PixiConsole @"[image]" "[text block id]"` converts an image to text and places a console block beside you which changes the specified text block.
  17. `Pixi2D @"[image]"` converts an image to blocks and places it beside you.
  18. For example, if you want to add an image called `pixel_art.png`, stored in Gamecraft's installation directory,
  19. execute the command `Pixi2D @"pixel_art.png"` to load the image as blocks.
  20. It's important to include the file extension, since Pixi isn't capable of black magic (yet).
  21. **EXPERIMENTAL**
  22. `PixiBot @"[bot]"` downloads a bot from Robocraft's community Factory and places it beside you.
  23. `PixiBotFile @"[bot]"` converts a `.bot` file from [rcbup](https://github.com/NGnius/rcbup) to blocks and places it beside you.
  24. `PixiThicc [depth]` sets the block thickness, a positive integer value, for `Pixi2D` image conversion.
  25. The default thickness is 1.
  26. Some commands also have hidden features, like image rotation.
  27. Talk to NGnius on the Exmods Discord server or read the Pixi's source code to figure that out.
  28. ### Behaviour
  29. PixiText and PixiConsole share the same image conversion system.
  30. The conversion system converts every pixel to a [color tag](http://digitalnativestudios.com/textmeshpro/docs/rich-text/#color) followed by a square text character.
  31. For PixiText, the resulting character string is set to the text field of the text block that the command places.
  32. For PixiConsole, the character string is automatically set to a console block in the form `ChangeTextBlockCommand [text block id] [character string]`.
  33. Due to limitations in Gamecraft, larger images will crash your game.
  34. Pixi2D takes an image file and converts every pixel to a coloured block.
  35. Pixi2D uses an algorithm to convert each pixel in an image into the closest paint colour, but colour accuracy will never be as good as a regular image.
  36. Pixi2D's colour-conversion algorithm also uses pixel transparency so you can cut out shapes.
  37. A pixel which has opacity of less than 50% will be ignored.
  38. A pixel which has an opacity between 75% and 50% will be converted into a glass cube.
  39. A pixel which has an opacity greater than 75% will be converted into the block you're holding (or aluminium if you've got your hand selected).
  40. This only works with `.PNG` image files since the `.JPG` format doesn't support image transparency.
  41. Pixi2D also optimises block placement, since images have a lot of pixels.
  42. The blocks grouping ratio is displayed in the command line output once image importing is completed.
  43. PixiBot and PixiBotFile convert a robot to equivalent Gamecraft blocks.
  44. If the conversion algorithm encounters a block it cannot convert, it will place a text block, with the block name, instead.
  45. ## Development
  46. Show your love by offering your help!
  47. ### Ways To Contribute
  48. - Build a Robocraft block that's not currently supported by Pixi (send it to NGnius on Discord).
  49. - Report any bugs that you encounter while using Pixi.
  50. - Report an idea for an improvement to Pixi or for a new file format.
  51. For questions, concerns or reports, please contact NGnius in the [Exmods Discord server](https://discord.exmods.org).
  52. ### Setup
  53. Pixi's development environment is similar to most Gamecraft mods, since it's based on HelloModdingWorld's configuration.
  54. This project requires most of Gamecraft's `.dll` files to function correctly.
  55. Most, but not all, of these files are stored in Gamecraft's `Gamecraft_Data\Managed` folder.
  56. The project is pre-configured to look in a folder called ref in the solution's main directory or one level up from that.
  57. You can make sure Pixi can find all `.dll` files it needs by copying your Gamecraft folder here and renaming it to `ref`, but you'll have to re-copy it after every Gamecraft update.
  58. To avoid that, create a symbolic link (look it up) to your Gamecraft install folder named `ref` in this folder instead.
  59. Like most mods, you will have to patch your game with [GCIPA](https://git.exmods.org/modtainers/GCIPA).
  60. Pixi also requires the [GamecraftModdingAPI](https://git.exmods.org/modtainers/GamecraftModdingAPI) library to be installed (in `ref/Plugins/GamecraftModdingAPI.dll`, the usual place).
  61. ### Building
  62. After you've completed the setup, open the solution file `Pixi.sln` in your prefered C# .NET/Mono development environment.
  63. I'd recommend Visual Studio Community Edition or JetBrains Rider for Windows and Monodevelop for Linux.
  64. If you've successfully completed setup, you should be able to build the Pixi project without errors.
  65. If it doesn't work and you can't figure out why, ask for help on the [Exmods Discord server](https://discord.gg/2CtWzZT).
  66. # Acknowledgements
  67. PixiBot uses the Factory to download robots, which involves a partial re-implementation of [rcbup](https://github.com/NGnius/rcbup).
  68. Robot parsing uses information from [RobocraftAssembler](https://github.com/dddontshoot/RoboCraftAssembler).
  69. Gamecraft interactions use the [GamecraftModdingAPI](https://git.exmods.org/modtainers/GamecraftModdingAPI).
  70. Thanks to **TheGreenGoblin** and their Python app for converting images to coloured square characters, which inspired the PixiConsole and PixiText commands.
  71. Thanks to **Mr. Rotor** for all of the Robocraft blocks used in the PixiBot and PixiBotFile commands.
  72. # Disclaimer
  73. Pixi, Exmods and NGnius are not endorsed or supported by Gamecraft or FreeJam.
  74. Modify Gamecraft at your own risk.
  75. Read the LICENSE file for licensing information.
  76. Please don't sue this project or its contributors (that's what all disclaimers boil down to, right?).
  77. Pixi is not magic and is actually just sufficiently advanced technology that's indistinguishable from magic.