Pages: 1
  Print  
Author Topic: found new(?) bug with object numbers in LGM that affects Enigma  (Read 8401 times)
Offline (Unknown gender) impo
Posted on: February 13, 2019, 09:23:27 am
Member
Joined: Feb 2019
Posts: 15

View Profile
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
« Last Edit: February 13, 2019, 09:45:30 am by impo » Logged
Offline (Male) Goombert
Reply #1 Posted on: February 13, 2019, 10:15:19 am

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
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.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print