Grid Sage Forums

Grid Sage Forums

  • April 27, 2024, 04:17:55 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Rex is godot  (Read 2897 times)

RisingThumb

  • Unaware
  • *
  • Posts: 1
    • View Profile
Rex is godot
« on: August 22, 2020, 04:39:06 AM »

Rex is godot
Hi. I like Rexpaint, but the lack of support for the .xp format in the Godot engine disappointed me. So I wrote a godot script that allows you to get all the data from the .xp file format as a dictionary, so I wouldn't have to use the .csv file format that Rexpaint can also export to.

I'm unaware of any Godot .xp file reader that were capable of reading from the compressed .xp file and required it to be decompressed beforehand. Reading this issue on the Godot issue tracker might explain why. This script handles a compressed .xp file normally as one would expect.

You can find this project on github here. You can read and use the raw script here. I have included a README which details the dictionary structure, keys, values and value types, as well as sample dictionary output, and sample usage in code. This script doesn't handle any rendering of the glyphs in Rexpaint, and I leave that as an exercise to any programmers using this.

Let me know if there's any other details I missed. I hope this script is of use to anyone else wanting to use Godot with Rexpaint.  :)
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4315
    • View Profile
    • Cogmind
Re: Rex is godot
« Reply #1 on: August 22, 2020, 06:37:45 AM »

Oh awesome, thanks for providing this, and I will gladly add it to the Resources page where it will get more exposure :)

Looks like technically we do have one Godot .xp reader listed already, but it's more limited and apparently they weren't able to figure out the unzipping at the time either :P

I'm sure this'll come in handy for some devs out there, especially with Godot getting used more and more often these days! I'll let the other roguelikedevs know about this in a few places, too.

Reading this issue on the Godot issue tracker might explain why.
Ha, interesting to see Skaruts pop up there last year with a reference to trying to get it to work with REXPaint in particular as well :P
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

medusacle

  • Unaware
  • *
  • Posts: 10
    • View Profile
Re: Rex is godot
« Reply #2 on: December 26, 2022, 03:55:24 AM »

I've updated it for Godot 4 here: https://gist.github.com/vmedea/fce1d6d7fb6a0a4d9f1f89c188cb6197

The mentioned issue with open_compressed still exists, but I've worked around it in a different way: by reading the xp file into memory, then using the new function decompress_dynamic, then decoding directly from that buffer, avoiding the need for a temporary file.
Logged