View Issue Details

IDProjectCategoryView StatusLast Update
00311562.x IDE BugsImporting ProjectsPublic2019-08-16 10:15
ReporterScott DunbarAssigned ToSteven Campbell 
PriorityVery HighSeverityB - MajorReproducibility100%
Status AssignedResolutionOpen 
Product Version2.2.2 
Target Version2.2.4Fixed in Version 
Summary0031156: Importing Projects: 1.4 GMZ instance creation code gets erased upon viewing
DescriptionIssue:
 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 Reproduce1. 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%
TagsNo tags attached.
2.x IDE Found In2.2.3.433
2.x Runtime Found In2.2.3.341
2.x IDE Verified In
2.x Runtime Verified In

Activities

Scott Dunbar

2019-07-09 16:22

Adminstrator  

creation-code-test.gmz (8,596 bytes)

Dan

2019-07-10 10:30

Adminstrator   ~0064387

Last edited: 2019-07-10 11:00

View 4 revisions

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.

Dan

2019-07-10 10:36

Adminstrator  

Screenshot_2.png (7,800 bytes)
Screenshot_2.png (7,800 bytes)