Changing a Global variable dropdown, should it be this difficult?

From the Asset Store
Project File of my C3 Tutorial Customized DropDown List
  • Here I am trying to change the variable "Level_DHSize" to "Level_DHShape" (which is right above it)

    I can see the variable I want, but when I move my mouse down, it scrolls. So if I very carefully move my mouse around and approach from the side, then its okay.

    What am I doing wrong? I wish there was a way to just type in this field. I know I have lots of globals but I have a large game and this gets REALLY annoying.

  • there are a couple things I do (besides trying to limit global variables by making invisible objects with instance variables to group related things)

    - you can type the first letter, but only the first letter. keep pressing a letter to cycle through all the options in a list that start with that letter.

    - use the scroll wheel of your mouse to scroll the list to the area you want

  • A standard feature of dropdown list controls is that you actually can type in them. I think it works in most software, not just Construct. It's kind of an invisible feature so is not very discoverable, but providing the dropdown is focused, you can just start typing and it will select the first item that starts with what you typed. You can start again by just waiting a short period of time which resets it, and start typing something new again.

    Also if you have loads of global variables, maybe you could use some other techniques to better organise them, like local static variables, use global Sprite instances with instance variables, use a Dictionary, etc.

  • AllanR is there a way to make a variable's scope only 1 event sheet? it seems like if I have the variable at the top level of the sheet (available to the whole sheet or layout) then it becomes a global.

    That would probably help a lot. For instance I have a ton of variables where I put the Sheet name at the front to tell me its only used on that sheet(layout).

  • If you put all the events in an event sheet in an event group, you can then put static local variables at the top inside that group. Then these act like global variables scoped to one event sheet.

  • yeah I know about the first letter thing, I just have organized var names that often repeat the whole beginning, so it doesn't help me that much.

    I just think the drop down is an outdated way of doing it and it feels like a hand-cuffing. I much prefer the "System Compare Two Values" where you can type out your variable name. Ashley is there anyway (besides script) to assign a value by typing it out?

    I use DDicts, CSVs, Arrays, local and all that.

    just for controls alone I need all these:

  • If you put all the events in an event sheet in an event group, you can then put static local variables at the top inside that group. Then these act like global variables scoped to one event sheet.

    Ashley wow, this seems awesome. Does this have any performance hit? I remember hearing subevents was no as efficient or something.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I should clarify about typing it out. The nice thing about System Two Values is I can type any part of the variable name and it helps me auto complete it.

  • Also if you have loads of global variables, maybe you could use some other techniques to better organise them, like local static variables, use global Sprite instances with instance variables, use a Dictionary, etc.

    This is what you should really be focusing on... I think traditional programming wisdom also discourages using any sort of global variable that doesn't have to be a global variable.

    This kind of keyboard mapping probably belongs in a dictionary. Yes you lose autocomplete, but setting up controls should be a one time thing, and there's a certain point where dealing with a mess of global variables is even more frustrating as you continue working in the project and need to use globals for other things.

    Alternatively, you might want to reconsider your naming system, that could make things go a lot smoother in the future. Two approaches is to change from Detailed-General instead of General-Detailed, or to use much shorter or abbreviated "General" prefixes

    Don't worry about performance penalties for using subevents/groups. If you can't measure it, it doesn't exist. Also I don't know how you get away without using groups for a big project in the first place...

  • oosyrag oh I'm definitely of that mind of old school programming practices. If I end up using "too many" globals in construct its not because I don't understand that, but rather having to adapt to using that scope with things like event sheets. So that's why I use these forums to help figure out the best practices.

    However that dropdown you have to admit, even in a small project I really don't like it... just speaking ergonomically.

    I do use Dicts for showing the frame, but you still need a variable name to know what you are changing, I'd rather not use 2 Dicts that are very undescriptive.

  • I've put my entire event sheet in a group and put my vars in there - unless I have includes that need access to those vars (which unfortunately I need to do since editor performance is an issue) and still making variable assignments is quite cumbersome.

    For instance, I no longer use System Compare Variable but instead always opt for System Compare Two Variables since I can just type part of the name of my variable.

    I think any more than 5-6 variables in a dropdown is just ergonomically wrong (from a human factors engineering perspective).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)