Functions, just a weird idea

Discussion and feedback on Construct 2

Post » Tue Jun 26, 2012 11:00 am

I'm afraid I'm not keen on the idea of showing them in the project bar or giving them properties - I think a single function is too small a thing for that. It would be like giving every single event properties and an icon in the project bar. It could get very confusing!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jun 26, 2012 8:08 pm

I think groups are pretty close to functions as is. Maybe add a way to change the group once its created (unless I missed it somehow once a groups created the only way to change start active or its name is to delete and remake it) and add maybe 6 optional text inputs to the group dialog to assign parameters. Then change the set group active event to allow you enter values for those parameters.

Then treat the parameters as local vars when workin inside the group
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Tue Jun 26, 2012 8:44 pm

@Ashley yeah I see your point and I agree (: I just think there should be something that can be used when for instance I start typing the name of a custom function and then I can see how many parameters it needs.
I thought that this way you could write "str2map(" and then see a tooltip of your parameters.

@aridale not really, functions not only isolate part of the code, but can be triggered many time on one event loop. Groups can't really. You could put a "repeat counter time" on your event with counter as a number variable that gets incremented each time you need to call the function, but then you'd have to keep the parameters in an array or a dictionary, and then store the return values, and then wait for the next loop to use them... pretty heavy...
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: gomez and 1 guest