playMaker

Author Topic: Automatically Add Value when Control Clicking = on an action  (Read 3526 times)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Automatically Add Value when Control Clicking = on an action
« on: September 03, 2019, 09:04:09 AM »
Hi.
At the moment on actions, you can Ctrl-Click the = next to a variable and it will automatically Create a variable.

It would be very nice that if there was a value set, that this would be stored in the variable as well when creating, now it will set the default value.

Below are some image to clarify what i mean :

1st i place an object (My Cat)
Then I press CTRL + Mouse Click :



Then This will Create a Variable With the name on the Left as variable name :



BUT the value is set to none.
So now i need to go into the variables Tab, look up the Object (or remember the value i placed (for string/int/float/etc)
And place it back.

Much easier would be if a value was placed, that it would automatically use that value :

« Last Edit: September 04, 2019, 08:10:55 AM by djaydino »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Automatically Add Value when Control Clicking = on an action
« Reply #1 on: September 04, 2019, 06:25:39 AM »
It's very specific. It would need to be defined as part of preferences I think. Or taken from a prefab or proxy only meant to store those default values for each type of variable. Essentially the creation of a varValue would do a get default value behind the curtain. Normally this would return a 0 or null, unless the user set a default value manually.
Perhaps a button in the Graph View would open a popup? Lead to the Game Object? Create one if there's none in the scene? Etc.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Automatically Add Value when Control Clicking = on an action
« Reply #2 on: September 04, 2019, 08:11:51 AM »
Hi.
I think you misunderstood what i mean.

So i updated my 1st post with some images included :)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Automatically Add Value when Control Clicking = on an action
« Reply #3 on: September 04, 2019, 09:48:30 AM »
Ok I see what you mean.

So say you have a float and manually entered 2.33.
Then you do the shortcut thing on the [=] button.
it creates a floatValue FsmFloat.
But for now it will have a value of 0 and you have to go to the Variables tab to set the value to 2.33.
You want Playmaker to actually read the value field and use that value during the var creation process, to put said value into the newly created var.

Is that right?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Automatically Add Value when Control Clicking = on an action
« Reply #4 on: September 04, 2019, 04:53:21 PM »
Hi.
Yes indeed :)

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Automatically Add Value when Control Clicking = on an action
« Reply #5 on: September 07, 2019, 01:07:18 PM »
+1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Automatically Add Value when Control Clicking = on an action
« Reply #6 on: September 07, 2019, 01:29:32 PM »
Hi.
Maybe event better if it would show the same way as when you click on the variable line (showing new variable with the name preset)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Automatically Add Value when Control Clicking = on an action
« Reply #7 on: September 11, 2019, 08:02:07 AM »
I follow a nomenclature of not starting my variables with a capital letter, keeping this only for Globals.
But the autovar system literally copies the name of the field's variable if the dev put one, and usually it starts with a capital letter.

Q: Could we have an option to force the autovar creator not to use any capital letter at the beginning of the var's name ? (basically doing a parse on the 1st letter and forcing a small character on it)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Automatically Add Value when Control Clicking = on an action
« Reply #8 on: February 11, 2021, 02:36:30 PM »
Bumping this because I see it as very useful in terms of workflow; I also reiterate the asking for an option to avoid capital letters in the autonaming of the variable's creation.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Automatically Add Value when Control Clicking = on an action
« Reply #9 on: February 11, 2021, 02:52:49 PM »
This makes a lot of sense. But it is a fairly broad change - do you think there are situations where users expect the value to be reset? Especially since it behaved that way for so long. Or do you think keeping the value is always preferable?

I'll add a preference for the auto-naming. Probably with these options: Default, Camel Case, Pascal Case. We can add more if there's demand.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Automatically Add Value when Control Clicking = on an action
« Reply #10 on: February 11, 2021, 03:36:03 PM »
Hi.
Well in most cases i prefer to Create a custom name.

But keeping values that where set before creating a variable would be very useful and time saving.

Many cases i create actions and set several values (gameobject/ints/floats/etc) manually and after testing i create a variable for it and have to go to the variable to place the value again.

Maybe even a popup after creating a variable to keep the value would still increase workflow speed (and maybe optional don't show popup and automatically set the value on the variable)

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 772
Re: Automatically Add Value when Control Clicking = on an action
« Reply #11 on: February 15, 2021, 06:28:59 AM »
We could have an alternative shortcut there.

Basic 'Command + Click' creates the var. That's how it is now.

Then, 'Alt + Command + Click' opens a popup to edit the variable's name; 'Enter' validates the newly named var and its auto assigned value, 'Escape' cancels the operation.