YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
22 stars 8 forks source link

In-Game: [HTML5] Built-in variables default to "null" and not "undefined" as on other platforms #1873

Open tinkerer-red opened 12 months ago

tinkerer-red commented 12 months ago

Description

Built in variables which are not set in the ide, are nullish instead of undefined. This does make sense given the platform though this does produce yet another discrepancy from html and all other platforms.

Here is a list of the variables which are built into the object:

managed
phy_active
phy_angular_damping
phy_angular_velocity
phy_bullet
phy_com_x
phy_com_y
phy_dynamic
phy_fixed_rotation
phy_inertia
phy_kinematic
phy_linear_damping
phy_linear_velocity_x
phy_linear_velocity_y
phy_mass
phy_position_x
phy_position_xprevious
phy_rotation
phy_sleeping
phy_speed
phy_speed_x
phy_speed_y
sequence_instance

The method used to get these to return null was var _returned = object_ref[$ "variable_name"] Though appears other methods are capable of returning null as well

Expected Change

listed variables should default to gamemaker's undefined instead of null

Steps To Reproduce

  1. Start GameMaker
  2. include code in create event of an object :
    show_debug_message(["managed", managed])
    show_debug_message(["phy_active", phy_active])
    show_debug_message(["phy_angular_damping", phy_angular_damping])
    show_debug_message(["phy_angular_velocity", phy_angular_velocity])
    show_debug_message(["phy_bullet", phy_bullet])
    show_debug_message(["phy_com_x", phy_com_x])
    show_debug_message(["phy_com_y", phy_com_y])
    show_debug_message(["phy_dynamic", phy_dynamic])
    show_debug_message(["phy_fixed_rotation", phy_fixed_rotation])
    show_debug_message(["phy_inertia", phy_inertia])
    show_debug_message(["phy_kinematic", phy_kinematic])
    show_debug_message(["phy_linear_damping", phy_linear_damping])
    show_debug_message(["phy_linear_velocity_x", phy_linear_velocity_x])
    show_debug_message(["phy_linear_velocity_y", phy_linear_velocity_y])
    show_debug_message(["phy_mass", phy_mass])
    show_debug_message(["phy_position_x", phy_position_x])
    show_debug_message(["phy_position_xprevious", phy_position_xprevious])
    show_debug_message(["phy_rotation", phy_rotation])
    show_debug_message(["phy_sleeping", phy_sleeping])
    show_debug_message(["phy_speed", phy_speed])
    show_debug_message(["phy_speed_x", phy_speed_x])
    show_debug_message(["phy_speed_y", phy_speed_y])
    show_debug_message(["sequence_instance", sequence_instance])
  3. compile as html/js
  4. See the issue in console

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2023.8 (Monthly)

Which platform(s) are you seeing the problem on?

HTML5

Contact Us Package Attached?

Sample Project Added?

RowanFuture commented 7 months ago

I think this has changed in a recent version of GM's HTML, check and see! I get a value of "undefined" with those show_debug_message calls.

tinkerer-red commented 4 months ago

image

Was about to close this but sequence_instance is now the only one remaining which is a null value.