View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031156 | 2.x IDE Bugs | Importing Projects | Public | 2019-07-09 16:22 | 2019-08-20 10:42 |
Reporter | Scott Dunbar | Assigned To | Steven Campbell | ||
Priority | Very High | Severity | B - Major | Reproducibility | 100% |
Status | Closed | Resolution | Fixed | ||
Product Version | 2.2.2 | ||||
Target Version | 2.2.4 | Fixed in Version | 2.2.4 | ||
Summary | 0031156: Importing Projects: 1.4 GMZ instance creation code gets erased upon viewing | ||||
Description | Issue: Projects imported from GMZ (1.4), instance creation code gets erased upon viewing. This is because the "creationCodeType" value is not being set properly during the import process, and is being left blank when it should be ".gml" or (presumably) ".dnd". | ||||
Steps To Reproduce | 1. Import the creation-code-test.gmz project into GMS 2. 2. In Explorer, navigate to the folder you created for the GMS 2 version of the creation-code-test project. Navigate to the rooms/room0 folder and verify that the instance creation code has been correctly imported and stored in a file in that folder. 3. Open the instance creation code of "object0" in "room0" and notice that immediately GMS2 saves the project. The instance creation code will be blank. 4. If variable reference warnings are enabled, a warning that the variable "str" is only used once will be displayed, despite the code window being blank. 5. Return to Explorer and observe that the contents of the instance creation code file have now been erased. 6. Close the instance creation code window and observe the file watcher tells you the file has changed on disk. 7. Check Explorer again and observe GMS2 silently deleted the file because it was empty (which is what 1.x used to do, but is not the same as what GMS2 now does for scripts) . Repro: 100% | ||||
Tags | No tags attached. | ||||
2.x IDE Found In | 2.2.3.433 | ||||
2.x Runtime Found In | 2.2.3.341 | ||||
2.x IDE Verified In | 9.2.1.1948 | ||||
2.x Runtime Verified In | 9.9.1.1533 | ||||
|
creation-code-test.gmz (8,596 bytes) |
|
This is because the "creationCodeType" value is not being set properly during the import process. After import: "instances": [ {"name": "inst_B23E69C5","id": "51dc924c-0b35-4c23-a0aa-aed05cbfb6e5","colour": { "Value": 4294967295 },"creationCodeFile": "InstanceCreationCode_inst_B23E69C5.gml","creationCodeType": "","ignore": false,"imageIndex": 0,"imageSpeed": 1,"inheritCode": false,"inheritItemSettings": false,"IsDnD": false,"m_originalParentID": "00000000-0000-0000-0000-000000000000","m_serialiseFrozen": false,"modelName": "GMRInstance","name_with_no_file_rename": "inst_B23E69C5","objId": "0ba93a63-19a4-42e9-bbbb-4d2f98bca177","properties": null,"rotation": 0,"scaleX": 1,"scaleY": 1,"mvc": "1.1","x": 32,"y": 32} ], If I create some new creation code for that instance after reproducing the issue above: "instances": [ {"name": "inst_B23E69C5","id": "51dc924c-0b35-4c23-a0aa-aed05cbfb6e5","colour": { "Value": 4294967295 },"creationCodeFile": "InstanceCreationCode_inst_B23E69C5.gml","creationCodeType": ".gml","ignore": false,"imageIndex": 0,"imageSpeed": 1,"inheritCode": false,"inheritItemSettings": false,"IsDnD": false,"m_originalParentID": "00000000-0000-0000-0000-000000000000","m_serialiseFrozen": false,"modelName": "GMRInstance","name_with_no_file_rename": "inst_B23E69C5","objId": "0ba93a63-19a4-42e9-bbbb-4d2f98bca177","properties": null,"rotation": 0,"scaleX": 1,"scaleY": 1,"mvc": "1.1","x": 32,"y": 32} ], I have now confirmed that if you do the import and then in between steps 2 and 3 above, you open the room0.yy file and set the "creationCodeType" value to be ".gml" and save this, then give focus back to GMS2 and click Reload when the file watcher tells you it has detected changes, all is fixed and your instance code appears as expected when you then open it in step 3. This has been broken since 2.2.2 - presumably, at the time of the change to the instance properties window to now store the animation values also. |
|
|
|
Fixed in Red IDE/GitHub Pull Request 4821 Git Id: 36d4e82d8cff15790f2df3fbb2a1dda8f930d6e2 |