Skip to content

Can't change populated values back to null #337

Open

Description

@XenonA7

Once a json field has a value, you cannot set it back to null in the map editor. For example, if you create a SHOW_CHOICE event step, all the fields are initially blank/null. Once you enter a value, save it, then close the event editor, it is no longer able to go back to null. You cannot delete this value because it map editor will re-populate it.
Image

In the screenshot above, if I want to set the forceWidth field to a null value again, I either need to make an entirely new SHOW_CHOICE event step or I need to remove it manually in json.

This also works for boolean checkbox properties. In the screenshot below, the top SET_CAMERA_POS is a freshly-created event step, thus all values are currently null. Once you touch the checkbox for the wait property, you can only set it to true or false. You can't get rid of it from the editor now.

Image

This is all just a minor annoyance, not anything critical. I can always still manually work around this.

Activity

  1. Vegita2 commented on Sep 28, 2025

    @Vegita2
    Member

    You cannot delete this value because it map editor will re-populate it.

    Should that be an empty string or is "null" strictly required?

    Once you touch the checkbox for the wait property, you can only set it to true or false

    What's the use case for having null there? Does it behave differently than false?

  2. XenonA7 commented on Sep 28, 2025

    @XenonA7
    Author

    Should that be an empty string or is "null" strictly required?

    When you first create a new SHOW_CHOICE, the fields are blank. If you leave it blank, the forceWidth property simply doesn't get added to the json output at all. This is different than just having "forceWidth": "". I would like a way to go back to this somehow once the field is populated.

    I had copied an EventTrigger containing this SHOW_CHOICE and I wanted to modify it to not use forceWidth or columns. But that wasn't possible, thus why I created this issue. I solved it by creating a brand new SHOW_CHOICE and copying the other field values without touching columns/forceWidth.

    What's the use case for having null there?

    It's not a use case that has unique behavior, but I always leave unused fields empty if I don't need them. Otherwise I will be wondering why there is a discrete value there and get confused wondering what purpose it is serving later. It would just be nice to be able to go back to a null value without having to do it in json or create a fresh event step and repopulate everything else each time.

    Does it behave differently than false?

    It behaves the same as the default value which is not necessarily boolean or false. For example, ig.EVENT_STEP.ADD_TIMER has the "gui" property set to true by default if you leave it as null.

  3. Vegita2 commented on Sep 28, 2025

    @Vegita2
    Member

    How would you add the ui for it? As I understand that would require having some kind of additional control on every attribute to unset it

  4. 2767mr commented on Sep 28, 2025

    @2767mr
    Member

    We could use the clear button for it

    Image

    (and similar controls for other elements)

  5. XenonA7 commented on Sep 28, 2025

    @XenonA7
    Author

    I'd like to be able to delete the "220" value from the forceWidth field in the original screenshot and have it register that as null. I'm not sure about true/false checkboxes or other scenarios.

  6. Vegita2 commented on Sep 30, 2025

    @Vegita2
    Member

    is there a difference between null, undefined and the field not existing? If not then I'd say the cleanest solution is to omit the field

  7. XenonA7 commented on Oct 1, 2025

    @XenonA7
    Author

    I don't know if there is a difference between a blank value like "forceWidth": "" and simply omitting the field. But I can't think of a reason why it would be desirable to have anything besides an omission. It is also cleaner in the json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions