OpenGMK icon indicating copy to clipboard operation
OpenGMK copied to clipboard

Game Maker 8: duplicate object behavior?

Open lab313ru opened this issue 2 years ago • 12 comments

Hi,

I've decompiled a game project, and I have two objects with the same name in the Objects tree but with different actions. Is that an incorrect decompilation, or a valid thing for GM8?

lab313ru avatar Sep 22 '23 09:09 lab313ru

That can happen. GM8 doesn't stop you from creating multiple assets with the same name. Whichever one was created first (higher in the list when decompiling) will be used when the object is named in code, but both can be placed in rooms, as parents, etc.

skyfloogle avatar Sep 22 '23 09:09 skyfloogle

Is that correct, that the higher object in the project's list will be used when its name is used?

I'm asking because looking at its code tells me that isn't used.

lab313ru avatar Sep 22 '23 09:09 lab313ru

Almost correct. It's whichever one was created first. Changing the order in the gmk won't affect anything.

The decompiler lists objects in the order they were created, so if you need to know which one would be used by GML code, you can look at which one got placed higher in the list.

Adamcake avatar Sep 22 '23 10:09 Adamcake

Does that require some verbosity option? I don't see any objects listing during decompilation.

lab313ru avatar Sep 22 '23 10:09 lab313ru

I meant the list in the GMK, under "Objects". Like this: image

Adamcake avatar Sep 22 '23 11:09 Adamcake

I see. Then it's strange, but the upper object's code isn't used at all, and instead the second one is used.

lab313ru avatar Sep 22 '23 11:09 lab313ru

Can you show us specifically what you mean when you say "its code is used"?

Adamcake avatar Sep 24 '23 11:09 Adamcake

I mean I see which font it loads and there is no such font. Also it prints a specific text, which never appears in the game.

lab313ru avatar Sep 24 '23 12:09 lab313ru

Sorry for the delay, are you talking about how text doesn't appear after the game is decompiled? That happens because fonts can't be decompiled to GMK. You need to open each font asset and select a new font.

Adamcake avatar Sep 28 '23 22:09 Adamcake

No, I mean choosing a font which doesn't exist in the game's list of fonts.

lab313ru avatar Sep 29 '23 06:09 lab313ru

I don't think that's possible, but if you're able to share the game you're talking about, we can take a look and try to see which behaviour you're talking about.

Adamcake avatar Oct 05 '23 15:10 Adamcake

It's the same as in my previous issue.

lab313ru avatar Oct 05 '23 16:10 lab313ru