Game Object Instance URLS list instance and object as "<unknown>" in Windows Release Bundle (Solved)

Solution: My approach to collisions used ToString conversions of hash values, this isn’t something that can happen in Release Versions of the game. The workaround is to check for the hash values instead of looking for partial string matches.


my game uses units that are Game Object instances, created by a factory.
When I load my game’s level, it initializes the game objects and the collision objects correctly, and detects collisions in general, but the URLs of these units, usually listed as GameWorld: <Instance#>: <Name of the Game Object> are instead being overwritten to not know the instance number or the Game Object name, but only in Release mode Bundles.

When I make a unit in the game, in a local build version, I get this value as the msg.url() (I used a msg.post to change a gui node to this value to debug in release mode):
image
when I build the unit in a Debug bundle, I get this value (the same one):
image

However, when I build the unit in a Release Mode bundle, I get this value:
image

I’ve tried manually setting the path to the URL, thinking it just didn’t automatically set in release mode, and it still lists itself as “GameWorld: <unknown>#<unknown>”, is there some kind of special nuance with Release bundles that would make the instance and Game Object values not assign to URLs properly?

Also in case it’s important, the normal lifecycle of the code is:
press a gui button > send a message to the Gameworld Script > Gameworld Script receives a message to make a Create a factory instance > factory creates a Game object Instance> game object instance initializes all its values.
I cut the life cycle down in places, even getting to the point where the units would just spawn once the level loaded in. but I still got the unknown instance and game object issue.

That’s how it’s supposed to work. Converting a hash (which URLs use) to a string only works in debug builds.

I see, so when I get a contact point response from a unit, I normally use this conditional:

if(string.match(tostring(sender), "Control") == "Control" and string.match(tostring(message.other_id), "Castle") ~= "Castle")then

which is checking that the unit is in contact with a collision object that was either part of a group known as “Team1Control” or “Team2Control”, and that the thing it’s coming in contact with is not the base of the enemy or player.

If I’m understanding you correctly, I can’t do this in a release build, as It’s not possible to convert the hashes (which the sender and message.other_id are, if I’m not mistaken?)

is there a kind of workaround that might be possible, or is this just an impossible thing to accomplish?

I don’t know how your game is set up, but something like this would work

if message.other_id ~= hash("/Castle") and (message.group == hash("Team1Control") or message.group == hash("Team2Control")) then
1 Like

Awesome, Thanks! I think I know how I can approach this to keep the interactions about the same.