Can't move several Groups at the same time if they have 1 local variable with the same name
Problem description
We can't move several Groups at the same time if those group have 1 local variable with the same name.
Attach a .c3p
Bug_CantMoveSeveralFoldersWithSameLocalVariable.zip
Steps to reproduce
- Select both CHILD1 and CHILD2 Groups
- Move them (drag them) anywhere, for example, under the "Parent_MoveChildrenHere" Group
- It doesn't work
Observed result

Expected result

More details
It happens any time you want to move several groups that share 1 local variable with the same name. No matter where you move them.
Affected browsers/platforms:
First affected release:
System details
View details
PASTE HERE
Note to self: also check variants in #6762 and #7985.
@OverboyDev - the code behind this is extremely complicated, and also very risky to change (if Construct assigns the wrong variable names, it can corrupt projects, and this has happened in the past). Would you say this is important, or just nice-to-have? I would rather not change it, not least to avoid the risk of more project corruption bugs.
I would say this is important as it happens to me almost each time I try to drag and drop folders in my projects. It's maybe not the top priority but this issue definitely needs to stay open until it's fixed. (even if it's in several weeks/months) Same for the other issues I filled today that you closed IMO.
I would also note this as important - it's a near-daily issue when refactoring events or following best practices using standardized variable names in general.
Looks like this issues https://github.com/Scirra/Construct-bugs/issues/5803
I have been trying to replicate this bug for months! Thank you for posting it.
@OverboyDev - the code behind this is extremely complicated, and also very risky to change (if Construct assigns the wrong variable names, it can corrupt projects, and this has happened in the past). Would you say this is important, or just nice-to-have? I would rather not change it, not least to avoid the risk of more project corruption bugs.
Until a final solution is found, maybe C3 can help the user solve it manually by offering a more useful tip? For example, when the user tries to drag the group and it fails, C3 would highlight the variable in question and tell the user to rename this variable to solve the issue.
ah yes this has been happening in recent months! I couldn't figure out what the issue actually was! yeah it seems like its a pasting scope issue. The code that evaluates variables and if there's a violation happens before the variables are put into scope context. but it's strange it tells you it "can't find it"

This might be a larger ask, but one of the things that would VERY much help and could potentially solve this issue. If there was a 3rd state to Events/Actions. Currently the states are "active" and "disabled". But I think a 3rd state of "invalid" would be really nice. Sort of how Else turns red if you do something wrong to the event before it.
It would be nice to paste a bunch of events from other projects where object names don't exist, variable names don't exist etc... Allow the user to paste it, turn it all red and "disabled"/"invalid" meaning it is ignored as Events. And allow the user to edit it and fix it.
That would be an extraordinarily complicated change given that there's already a large amount of highly complex code in this area that's been refined over a period of years. I'm afraid that may mean a change of that extent is infeasible for now.
could you perhaps paste events as "comments" and allow a user to edit them? Although I suppose there are dependencies with changing variable names and "replace object", but that is the crux of what I think would be extremely helpful like you do with line coding; cut&paste a bunch of "invalid" code then fix it up before compiling.
but I understand its much bigger issue to tackle.
I'm afraid when there is a large amount of highly complex code that has been refined over a period of years, there are no simple changes.
yes, I can imagine!
I suppose what I really want is an easy way to edit what is on the clipboard before pasting it. Which would probably be a feature request. this stuff: {"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"x","comparison":0,"second-value":"0"}}],"actions":[{"id":"set-boolean-eventvar","objectClass":"System","parameters":{"variable":"abilityReleased","value":"false"}},{"id":"set-boolean-eventvar","objectClass":"System","parameters":{"variable":"abilityPressed","value":"false"}}]}]}
current saimple solution is move group one by one then it works.