ENIGMA Forums

Outsourcing saves money => Issues Help Desk => Topic started by: impo on February 13, 2019, 09:23:27 am

Title: found new(?) bug with object numbers in LGM that affects Enigma
Post by: impo on February 13, 2019, 09:23:27 am
in game maker there's project import function that allows you to import a part of another project.

imagine we have 10 objects in project A. we then add project B with 10 objects on it.

let's say after this we created a new object, it's 21st in our A+B project.
LateralGM has no import function, however, we can still open our A+B project merged in game maker.
now, if we try to create a new object in LateralGM, it'll be 11th (LGM doesn't count new objects that we imported in GM) , and when compiled, it will accordingly refer to it as 11th, although there is already such an object in the project, so we'll get an error like this



C:/Users/enigma/AppData/Local/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_resourcenames.h: In function 'std::__cxx11::string enigma_user::object_get_name(int)':
C:/Users/enigma/AppData/Local/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_resourcenames.h:113:7: error: duplicate case value
       case 11: return "obj11_project_b";
       ^~~~
C:/Users/enigma/AppData/Local/ENIGMA/Preprocessor_Environment_Editable/IDE_EDIT_resourcenames.h:112:7: note: previously used here
       case 11: return "obj21_enigma";


so basically you won't be able to add objects. the workaround is to make 10 new objects and just delete them, so that the index of new objects is shifted. unfortunately there's no 'duplicate folder' function in LGM, and even if you select multiple objects, and duplicate them, it will only duplicate 1 object, so your best bet is to hold alt and spam insert to copy the objects, which can be pretty frustrating when you merge huge projects
Title: Re: found new(?) bug with object numbers in LGM that affects Enigma
Post by: Goombert on February 13, 2019, 10:15:19 am
Yeah, it sounds like you did actually find a legit bug that should be fixed. This is kind of interesting because somebody was just talking to me the other day about ids. Anyway, as I've been making aware, I am trying to focus most of my energy and resources at laying the foundation for the new IDE and have stopped working on LateralGM. I will leave it up to you whether you want to file the issue on LGM's tracker along with your reproduction steps so it doesn't get forgotten about.
https://github.com/ismavatar/lateralgm/issues

Also, I want to recommend another workaround that may be a little easier for some people. First, make a backup copy of the project. Then select Resources->Check Ids which should ask you to defrag the ids, effectively resolving the issue. However, defragging ids can sometimes break certain projects if the user was hard coding resource/instance ids in their project. They might then have to do some refactoring.