MerchantPug / apugli

An extension to Apoli for certain mods' use.
MIT License
5 stars 4 forks source link

`modify_scale` assumes default scales when updating? (no idea how to properly explain it) #72

Closed JustCyra closed 6 months ago

JustCyra commented 6 months ago

Power modify_scale appears to assume the default scales even if it is not modifying that scale.

For example this is the power for context:

{
    "type": "apoli:multiple",
    "hidden": false,

    "resource": {
        "type": "apoli:resource",
        "min": 0,
        "max": 5000,
        "start_value": 5000,
        "hud_render": {
            "should_render": true
        }
    },
    "tick_resource":{
        "type": "apoli:action_over_time",
        "interval": 1,
        "condition": {
            "type": "apoli:resource",
            "resource": "*:*_resource",
            "comparison": "<",
            "compare_to": 5000
        },
        "entity_action": {
            "type": "apoli:change_resource",
            "resource": "*:*_resource",
            "operation": "add",
            "change": 1
        }
    },

    "scale_height": {
          "type": "apugli:modify_scale",
          "delay": 0,
          "scale_type": "pehkui:height",
          "modifier": {
              "operation": "multiply_base_multiplicative",
              "value": 0.3
          }
    },
    "scale_width": {
          "type": "apugli:modify_scale",
          "delay": 0,
          "scale_type": "pehkui:width",
          "modifier": {
              "operation": "multiply_base_multiplicative",
              "value": -0.2
          }
    },
    "scale_resource": {
          "type": "apugli:modify_scale",
          "delay": 0.0,
          "scale_type": "pehkui:width",
          "modifier": {
              "operation": "multiply_base_multiplicative",
              "value": 0.0,
              "resource": "*:*_resource",
              "modifier": {
                  "operation": "multiply_total_multiplicative",
                  "value": -0.99995
              }
          }
    }
}

This power makes the power holder 20% thinner and 50% taller at base and wider from 0-20% based on the resource subpower.

While the resource is full, running into a 2 block tall gap stops you as your model is more then 2 blocks, as expected. However if the resource is not full and updating due to the tick_resource subpower`, whenever it updates you can fit in that 2 block tall gap and forced to crouch the next frame, same goes for 1.5 block tall gaps, instead you are forced to crawl? Even if it was assuming default scales the crawl part makes no sense.

There is a good chance this bug is pehkui related and is just clearly exposed by this power.

MerchantPug commented 6 months ago

Could you please try a longer delay and setting the entity's scale with a Pehkui command? I'd like to make sure this isn't something on my end.

JustCyra commented 6 months ago

Nope, this does not happen if done via the /scale command and trying to do the bug properly blocks the player

Used: /scale delay set pehkui:height 1000 /scale set pehkui:height 2 @s

JustCyra commented 6 months ago

Nevermind, i forgot that this is about width, not height. Yes this is a pehkui issue too my bad