[New/change of feature] Parametre renaming

Discussion and feedback on Construct 2

Post » Mon Feb 03, 2014 11:23 pm

Hi I really like and use functions a lot. But it would be really nice if you were able to rename parametres so instead of them being called Parametre(0,1,2,3..etc)you could name them yourself.

Since the function is added as a single object to the Whole project im not sure if thats possible.

But a way it could work was kinda like dictionaries in the way they are added to a project. So each time you needed a function you just added a new function object. And you could add parametres to it like you would add variables to a normal object. Then you could name them what you wanted.

Anyway if something like that is possible it would be great i think. Would most likely also solve the 25 limit parametre UI bug i think :Dnimos1002014-02-03 23:26:27
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Mon Feb 03, 2014 11:43 pm

+1
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Mon Feb 03, 2014 11:59 pm

Yes, this would be lovely. It's a pain having to alias all the parameters in functions if you want things more readable.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Tue Feb 04, 2014 12:09 am

Use global variables to setup like variable1 = 1 or "Easy" on parameters. It automatically applies all functions more than renaming each one.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Tue Feb 04, 2014 1:02 am

I get the feeling that this would be tremendously difficult for scirra to implement.

I once talked to someone about being able to use FunctionName(param0,param1) instead of Function.call("FunctionName",param0,param1) but apparently the engine architecture prevents this. I can only assume that your request may have similar problems.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Tue Feb 04, 2014 3:21 am

Hmmm, my entire games are put into functions and I haven't had trouble yet. Though, it would be nice to have the function names as a constant global variable rather than a hardcoded value, but I hear at least that's being worked on.


@nimos100, and others, how many parameters do you typically use in your functions?
B
20
S
4
G
1
Posts: 185
Reputation: 2,563

Post » Tue Feb 04, 2014 4:10 am

I want Functions to be based on the variables part of the engine along with allowed name spacing. I would love that sooo much.

As it is now it's a pain in the lower back region, but I can still work with Function. Also I so much prefer having Function than not. So thanks still for having Function.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Tue Feb 04, 2014 11:42 am

"@nimos100, and others, how many parameters do you typically use in your functions?"

It varies a bit but normally not more than around 5-9, but are working on a game that are quite complex. And the items in it can have quite a few settings and different ones depending on which item it is. And therefore i original decided to just add all settings into a single item object. However due to the functions not being able to handle them all, i had to redesign the way it worked. This is not a huge problem, but was just the way i found out about the bug. So even though its not that big a deal, i thought i would just make them aware, so they could fix it if they feel like it.

The renaming part of parameters i suggested because when you check parameters you might have several "Function.parametre(0,1,2,3,4,5,6) = 1 or 24 or whatever) But these doesnt tell exactly what ir is. And it would just be handy if it instead was "Function.Is_weapon(0) = 1" and so on. I do use globals in some cases especially if i use text for testing, as its easier to avoid mistypes that way. But having a lot of global variables can also be a bit annoying as the list when you need to use one can be quite long.   nimos1002014-02-04 11:44:39
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Tue Feb 04, 2014 12:11 pm

I believe you can name parameters with rexrainbow's function plugin.
B
22
S
6
G
10
Posts: 1,034
Reputation: 7,514

Post » Tue Feb 04, 2014 12:21 pm

@PixelRebirth

Using official function plugin please. The official one is more powerful then rex_function.
B
108
S
26
G
258
Posts: 4,430
Reputation: 145,179

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests