Skip to content

Crystal interface for reading/writing Brickadia BRS save files

License

Notifications You must be signed in to change notification settings

voximity/brs-cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brs-cr

brs-cr is a port of the Brickadia brs save (de)serializer.

Only supports versions 4+.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      brs-cr:
        github: voximity/brs-cr
  2. Run shards install

Usage

This will create the file out.brs with a 16x16 grid of randomly colored 1x1f bricks.

require "brs-cr"

me = BRS::User.new(username: "x", uuid: UUID.new("3f5108a0-c929-4e77-a115-21f65096887b"))

save = BRS::Save.new(
  author: me,
  description: "generated save file"
)

16.times do |y|
  16.times do |x|
    save.bricks << BRS::Brick.new(
      size: BRS::UVector3.new(5, 5, 2),
      position: BRS::Vector3.new(5 + x * 10, 5 + y * 10, 2),
      color_index: Random.rand(0...save.colors.size)
    )
  end
end

save.write(File.new("input/out.brs", mode: "w"))

Contributing

  1. Fork it (https://github.com/voximity/brs-cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Credits

About

Crystal interface for reading/writing Brickadia BRS save files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published