Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HSV properties for blocks #35

Open
whamer100 opened this issue Dec 30, 2023 · 3 comments
Open

HSV properties for blocks #35

whamer100 opened this issue Dec 30, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@whamer100
Copy link

I want to be able to set the hsv attribute of blocks when creating them for levels. I've tried implementing it myself but I can't get it quite right.

What I have identified so far is that GameProperty 43 is the hsv value, 41 means to use hsv on base (I think 42 is to use hsv on detail, havent checked). For whatever reason when I tried implementing this myself, every block's scale (even ones that arent being created by the program) just completely breaks and gets set to 0.20.

@whamer100 whamer100 added the enhancement New feature or request label Dec 30, 2023
Folleach added a commit that referenced this issue Dec 30, 2023
@Folleach
Copy link
Owner

Folleach commented Dec 30, 2023

Thank you for request and research!

I've add this feature to Block and basic interface IBlock
Wanted to add to classes with color, but this, unfortunately, will not work until there is a complete mapping id -> class

Released in v0.2.25

Usage

level.Blocks.Add(new Block(216)
{
    PositionX = 30,
    PositionY = 30,
    Hsv = new Hsv()
    {
        Brightness = 0.5f,
        DeltaBrightness = true
    },
    AdditionalHsv = new Hsv()
    {
        Hue = 120,
        Saturation = 0.5f
    }
});

// Pay attention: block with id 1887 has only detail color, but hsv isn't additional
// AdditionalHsv used for detail color only when both color (base and detail) are present in the block
level.Blocks.Add(new Block(1887)
{
    PositionX = 60,
    PositionY = 30,
    Hsv = new Hsv()
    {
        Hue = 60
    }
});

As for your problem, when all the blocks change the scale to 0.20, there is probably an incorrect character written to the level string somewhere.
Geometry Dash is very sensitive to the character in a level.
So one erroneous character in one block can break the entire level completely ¯\_(ツ)_/¯

@whamer100
Copy link
Author

From testing, for whatever reason setting the scale to 5 for the smallest pixel blocks equals a scale of 1 in the editor. I wonder if Rob is cheating here by using the same block code but with different scaling.

@whamer100
Copy link
Author

Got around to testing this and this works! It definitely looks like Rob has specific handling of the scale value for these pixel blocks, as it appears to divide the scale value by 5 no matter what the input is. I also still really wonder what GameProperty 155 is. If I was more knowledgeable on reverse engineering gd I would look into it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants