View Issue Details

IDProjectCategoryView StatusLast Update
00304222.x IDE BugsRoom EditorPublic2019-05-15 10:28
ReporterDanAssigned ToAlexander Borup 
PriorityLowSeverityC - GeneralReproducibility100%
Status ClosedResolutionFixed 
Platform-OSWindows 10OS VersionPro x64
Product Version2.2.1 
Target Version2.2.3Fixed in Version2.2.3 
Summary0030422: Room Editor: Changing the object tied to an instance does not persist overridden instance variables to the new object type
DescriptionWithin the Room Editor, if you override the instance variables for an instance and then change the object this instance is of, the instance variables window is reset to the default values for the new object type. As you have overridden variables, these values should be applied to the new object type also - if the two objects share variable names, then we just override that variable also, and if they have unique names then we "merge" the variable in as a new instance variable.

Expected: Given the attached sample, after performing step 3 we would have three instance variables showing: MyVar as the value you typed (marked as overridden), MyVar2 as the value you typed (marked as overridden), and myVar3 as the default 10 for an object1 (not overridden).
Steps To Reproduce1. Open GMS2 and import the attached project. Open the room editor and edit the instance already created.
2. Change MyVar to anything except 1 and MyVar2 to any value you like.
3. Now drag object1 onto the picker, as shown in the screenshot.
4. Observe the instance variables window resets to the default values for an object1, losing the changes you made in step 2.
Repro: 100%
Additional InformationOriginal reporter says that trying to revert back to the object0 shows the overridden values are completely lost in 2.2.1, but this does not reproduce in 2.2.2 and I can freely restore object0 and the overrridden values are re-applied correctly, so looks like that has been fixed by some other change.
TagsIDE
2.x IDE Found In2.2.1.375
2.x Runtime Found In2.2.1.287
2.x IDE Verified In9.2.1.1817
2.x Runtime Verified In9.9.1.1441

Activities

Dan

2019-01-21 14:33

Adminstrator  

InstanceChangeResetsVariables.yyz (23,629 bytes)

Alexander Borup

2019-01-21 14:43

Developer   ~0062474

Fixed. An instance will now retain its overridden values for any object it has described, if set to be an instance of that object again (these will not be visible in the window). It will not merge old variables with new and it will not append overridden variables when changing object.

This is because an instance is a specialization of an object, and a variable with the same name doesn't necessarily have the same impact between different objects - ergo it should not be assumed that the value of the variable is directly transferrable. However, if the new object B is a child of the old object A and the instance overrides a variable that has been inherited from object A then this override will be maintained after setting the new object B.