[Feature in Backlog] A more efficient way to declare variables (from event sheet)

In the image below, I want to assign a scene variable to an object variable but oops, I didn’t declare it. It would be extremely helpful if I could modify both the object variable and scene or global variables for conditions and actions. Basically anywhere, even within the expression builder.

I don’t know the best way to execute this. While a shortcut key would be nice, it wouldn’t work on a touch screen.

Maybe a little box next to the expression builder button or some other location.

I don’t want to have to keep switching back and forth interupting my flow. While the variable screen would be an interuption, at least after the variable was added, I could pickup where I left off without having to restart or find and reselect the condition or action.

What I would love is the ability to highlight a word and from the popup menu choose create a variable and that would open the variable screen and add a variable with the selected text. That could be another solution. I realize that might not be ideal.

I just want some way to make it less of a distraction and more automatic. I don’t want to do everything twice if it can be done once. There are benefits to declaring variables but the convience later shouldn’t be canceled out by the setup.

2 Likes

And i wonder how much our ideas are different

Cause even so i am proposing there to be selection for scene/global variable type selection inside that very window (i should also include object type but it was just a concept)

You propose something to automatically open to let us select

Our core idea is the same in my eyes
This window where we manage our variable should be our control panel
Where we make choice/change
I do not care if something open or if there is straight up button to select
I just think logically since that is window where we manage our var then in that window we should make whatever change we want

2 Likes

I don’t like the way that it locks you out of everything else. Another option would be having the variables screen as an always available tab or a panel.

Yes. We have similar concerns. We have different styles but we share the same concerns. I see the setup screen as a way to simplify things later but it needs to be easy to use otherwise the later gain is canceled out. A little setup can replace having to use Variable() and VariableString() not to mention if it’s global.

1 Like

Lets face it
I have idea you have different idea
Core purpose of our ideas are the same
I would not care much if your idea would pass or mine
Since both would solve same exact problem in a different way
And then someone else will come with another idea which can be better than yours and than mine combined

For now i see ppl are hyped for multiplayer or angry at variable system change
I say we should wait and when hype goes away then ppl start to come up with some ideas that will be worth considering

I do not care to be able to not declare vars i do not care to take away declaring i care for better system
I am biased on not declaring but not because it was better
But because we did not get anything better in return
If we would i would declare every single var i could and i would not cry
Yet with current system it is not pleasant experience

Yesterday i was trying to help someone on discord (dam you Kruger)
And instead of explaining how to set up vars in event i often just make that in whatever project i have open at the moment
Screenshot it and send that screenshot on discord so there are no more question to be made

YET i needed to declare var to be able to properly use it
Which later i did need to delete since it was made just show something and not to be used in my project
And now i gonna need to repeat declaring each time just to show someone something

Ease of use is prove of having better system
I cannot say we did not get better system
I can however say we did not get better system for every possible scenario

Declaring does not take hour yet declaring and deleting after temp vars i need just to show something which i did not need to do with previous system makes me feel i lost something instead of get something better

So bottom line what would fix most problems in my eyes is to have set up options inside window we manage our var
NOT take me to another window

And just to be perfectly clear
I see declarED variables to be better than not declared
I see declarING variables to be lesser system than not declaring them

1 Like

I agree with a lot that you said. I would appreciate though if this was kept to the existing threads because I feel we’re getting off topic and I’m honestly worried that my suggestion is going to fall into the void because it was too long, didn’t read.

1 Like

There are already few topics with ideas
Yet instead of giving ideas ppl tend to explain which is better over another and why

I read this (last line)

And i am not sure did our ideas just fall into oblivion or do we have chance for something better

I think there should be topic with ideas not arguments
But 1st we would need to know if our ideas will even be considered as a possible solution before we start providing any

And relax to my experience ppl tend to read only 1st post in topic and sometimes last while rarely anything else
So i say you are pretty much safe from it being lost in the void

1 Like

I agree. There are a lot of real complaints. There is also some knee-jerk reaction to change and feeling like they weren’t part of the change. They may wait for things to die down and see which ideas stick around. There’s also probably some built up hostility because the app has had more bugs recently. Maybe, they need more testers and more discussions. It’s tough to be both free and for profit. The worse thing a business can do is anger it’s user base when there are other options. Although, I feel GD is a better fit for me by a long shot. But that doesn’t mean it’s perfect.

Look you me and any1 else in most cases do not know what we really need
We do know what we like
Yet someone can and will have better idea than we do
And over time we gonna like it also
I did not believe i needed object folders before i started using them
Now i have NO project in which i am NOT using object folders

We do not really care to have this or that
We do care for if there was a change to get something better that is all that matters
IF we lost undeclared vars forever i am perfectly fine with that ASLONG as we get something better and easy to use in return

And now any1 that is against declaring every var would also change mind if they would get something better in return
So like i said let’s wait for anger and multiplayer hype goes away and then ppl start to come with some cool ideas
Only thing we should care about is for our concerns and ideas to be heard and taken under consideration
Only that and that much

And i saw your post about arrays
I am of a same opinion as you
BUT keep in mind we are in transition stage
Changes always comes with some pain
I am patient enough to wait for better system
Notify every possible bug i or issue i notice
But i would not expect to don’t find any

2 Likes

I̶’m̶ g̶o̶i̶n̶g̶ t̶o̶ a̶d̶d̶ a̶ p̶o̶s̶t̶ o̶n̶ m̶y̶ o̶p̶i̶n̶i̶o̶n̶ o̶n̶ o̶b̶j̶e̶c̶t̶ f̶o̶l̶d̶e̶r̶s̶ j̶u̶s̶t̶ a̶s̶ a̶ d̶i̶s̶c̶u̶s̶s̶i̶o̶n̶.

On second thought maybe not today. Be well.

1 Like

you were the one who said there weren’t any downside. :wink: ( just joking).
@zero…object folders was one of my request…as instances list delete buttons and z order edit…(and maybe fixed z order per object in object properties) …one day we gonna have it…i’ve faith . :pray:

…imo every update is a downside…when everything is focused on a multiplayer…
i wonder how many here statistically talking are doing multiplayer games…i’m not against it …but do it needs priority?..we have many things that works really bad…(…anyway thaz not my business)
beside that i can’t offer any solution for undeclared vars…simply because any screen that may popup for a variable means a declaration.

just writing a var in whatever condition should be enough to declare it.
This will never be possible in GD 5.4 because vars are now merged so ofc you must tell which kind of var you want… there is no fix
but if there is no choice i would opt for zero’s solution possibly with as few clicks as possible…there are really too many

2 Likes

How I would do the example given now is to write Counter in the value, click ok to approve and close the Action I just wrote. Then open the scene variable panel with the shortcut key, add Counter to my scene variables, then hit tab a few times and then hit Enter to apply/close panel. I’m not against your automated system suggestion but I want to vote on the side of it being optional or at least not more work than what I would do now. It’s a downer when someone makes improvements to something and now you have more work than before.

Points in favor of your idea: It will safeguard against someone making a typo in their variable if they highlight it and choose Create a Variable.
It will be convenient to people who don’t like to open their variable panels or are not sure where they are or how to open them.
It will ensure a smooth work flow free from distraction for people who do not like using shortcuts and find opening their variable panel distracting and cumbersome.

Points against your idea: Well I can’t think of any unless it ends up being some complex systems that causes me to do a lot of work for something that was once simple and quick.

I’m just putting suggestions out there. I noticed on the one thread that GD said something like they might add buttons to open the variable screen in more place. I’m going to assume that’s what we’ll get at least initially. That would be OK for now.

If I’m using scene variables it’s not too bad because there’s a button on that panel. The issue is when using the variable as a value or expression like the value for a scene variable. I think the local variables will help a little there. I can see using those in the setup with a repeat or for each. It doesn’t make much sense for me to use a local variable on every frame.

1 Like

Funny. I never said it was perfect and that was a preexisting issue.:wink:

1 Like

Hello!
Thank you for your topic and your conversation.
Indeed, it seems like there is another topic that requests a different UI solution to the same problem, so this one is tricky to address.
I think that keeping the discussion around “the friction” (rather than the solution) as you’ve been doing it will allow the core team to propose a solution according to the issues. I do appreciate that you explained:

  • It is important for you to keep your flow without switching screens
  • Whenever you help someone, you would have to declare variables on your own project which you later have to delete because you don’t really need them.

And so on. Truly, these kind of conversations do help! Please keep the conversation if you thing there are needs that you agree/disagree on. :pray:t3:

Following this explanation, I’ll do the following:

  • Merge ZeroX’s concept Better Variable System (Best out of old and new variable system) - #4 by ZeroX4 with this topic since this topic has a clearer “my needs are the following…” statements (however, I am still aware and had acknowledge Zerox’s concept).
  • I’ve renamed the feature request to talk about the friction :slight_smile:
  • I’ll keep an eye on this conversation (feel free to invite other users to express their needs). It is bringing clarity to the needs/workflows/scenarios that might be affected by recent technical changes.

Thank you again for your help!

3 Likes

Luni i have personal question
Sometimes i see this


After you edit my topic
I always just close it cause idk should i or should not click anything here
But well should i do something here or just close it

To answer your 1st question

  • It is important for you to keep your flow without switching screens

I would say for all of us it is important for not doing unecesary additional actions
Not switching screens if we could do everything in one window
Not doing additional clicks like using drop down menu instead of radio buttons (for example like we have with choosing Instant/Permanent force)

We all can accept some compromises that is never an issue as long as gain from them is much better than what we had before overall
In ideal world i would add object to my project and events sheet in same exact window
Even have scene editor in same exact window as events sheet
Yet that would be problematic and what we have now give us enough to not ask for such system

And 2nd

  • Whenever you help someone, you would have to declare variables on your own project which you later have to delete because you don’t really need them.

I made that screenshot above just by hitting print screen key on my keyboard
And i just reply to your comment and hit ctrl+v to paste this screenshot

Back like way back many years before that was not possible
I would need to

  • open paint
  • paste screenshot
  • save it as some image file
  • upload it to some site
  • copy url to that file
  • come here and use tag [img] [/ img]
  • paste that url between that tag

And that are steps i would need to take to just share screenshot
Where now it was just print screen then ctrl+v

I am not questioning if new variable system is better for performance
I do not question if it will help avoid spelling errors
I do not question does it help write less by 1st requiring to do some additional steps since if you take that few secs to declare later you can use that var much faster in all of your events
And no one can argue over it

Yet like i just explained with screenshot example
We should not need to declare everything
I do not need to save every screenshot nor do i need to give it proper name
I just need to use visual data it carry and send it to someone or paste it somewhere
Same with variables
I do not need every single variable declared
Especially when i am just making “presentation” for some user from discord or forums just to show how he should set up his events and that it will actually work

I won’t die by declaring vars i do not need to declare
I would wish there be a way to declare and delete them faster
And in my eyes only option i see is to make control panel for variables out of window in which you add var condition/action
If someone have better idea i am all open to it
That is just my idea same as Keith have slightly different take on it

No one needs old system we just need new system to become easier to manage
And no one will care if variable gets declared or not
If it will be easy and fast to declare them and delete them

If we get easier system
I could declare every single var and delete it later
It would not matter to me and i bet to many if not all users
But the fact we now need to take additional steps to do same thing we did before with less steps
Feels like it is breaking our workflow and feel like unecessary additional work we need to do

Or other example cause i know you like them

I just need to check if raycast works if ray i cast on some object hits it
I could create events to switch this object boolean variable to true when it hits it
I do not need that variable declared i just need it for a moment
Yet if i could declare it easily and then remove it easily
I would not care does it get declared or not

Hey Luni, thanks for listening to everyone’s feedback and concerns!

After trying out the new system, I can say that it works pretty well at this stage.

Since undeclared variables are a thing of the past, I thought I’d share some suggestions that I think can make declaring and editing variables more efficient and intuitive.

1. Variables panel consistency.

The variables panel should always have both the Scene and Global variables tabs. So if I open the variables panel from the Scene page, it should have both tabs available with the scene tab being selected. Same thing when accessing the global variables from the menu.

It should be consistent as with opening it from the events sheet page or through an action/condition.

2. Include a button to open the variables editor panel on all actions & conditions.

3. Quick way to add and edit variables when typing expressions.

Include the add or edit variables option in the context menu of objects, and show it whenever an undeclared variable is detected. Same thing applies when typing expressions in the events page.


4. Add/Edit variables for objects in a group.

If I want to use a variable for a group of objects, I can’t simply declare a variable right within the event because the edit variables button would be disabled for groups. I’d have to go to every object and declare this variable manually. And this would be big problem if there are many objects.

A workaround would be to only declare the variable for only 1 object and GDevelop will detect it. But I don’t think that’s a good idea (but I might be wrong here), because all the other objects would not have this variable declared.

Here’s my suggestion.

Keep the button enabled for groups which opens a group variables editor that includes all the mutual variables between the objects in this particular group. It is NOT a new type of variable, but this panel shows the mutual variables between objects in this group and gives the ability to add or edit them. Mutual variables with different values would appear as (Mixed Values), with the ability to change and overwrite the value on all objects by clicking on the edit icon on the right.

This would solve a big problem of having to declare or edit a variable for many objects in a group. But, the object variables would not be affected or removed if the group is deleted.


5. A clearer way to add children to structures and arrays.

The + icon at the right to add a child variable always confuses me if I have structures/arrays inside parent structures/arrays.

I think this design is more inline with the events system which is clearer to add children in the right places.


6. Not used variables.

Display an icon which indicates that the variable is not used anywhere, and a popup will appear if this icon is hovered over or clicked. This makes it easier to find and remove variables that are declared but never used.


7. Add a button to open the variables editor in the scene and event sheet pages (useful for mobile).

8. Fix a bug.

The new system does not allow having the same name for variables and objects. But I was able to cheat that by declaring a variable first then renaming an object to the same name.

I can edit and improve these suggestions if anyone have something worth adding or changing.

4 Likes