• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

Global String - Unable to convert to integer


I have set global strings using DnD many times but GML keeps throwing an error message when the game is running.

this is the line:
global.test_rear = "White_Rear";

Gives error:
Unable to convert string "White_Rear" to integer


It's probably because White_Rear is a resource ID (e.g. a sprite or object ID), and the only way that works is without quotes or with asset_get_index().

In my world, resource IDs are not strings, and nobody should treat them like one.