[Request] Auto-complete in the function object

Discussion and feedback on Construct 2

Post » Wed Jun 11, 2014 9:12 pm

One of the things I love the most about Construct 2 is the function object. It allows me to define my own functions and call them from any sheet. I use the function object more than any other object in construct. On top of that it allows me to work more OO keeping responsibilities where they belong.

There is only 1 downside to the function object: if you make a spelling mistake, nothing will happen and the game doesn't give you an error.

Having Auto-complete in function would be perfect to solve this issue, as well as stimulate a more structured event sheet. Right now I use "object.functionName" on many event sheets and having auto-complete after I type an object with all the functions matching that name would really make my day.
B
18
S
4
G
3
Posts: 30
Reputation: 4,088

Post » Wed Jun 11, 2014 9:29 pm

+1
I would love this too. For now I'm stuck creating global variables with the same name so they show up in intellisense. Granted considering the number of functions my project has I would like to add that if this ever gets added to the IDE to nest it in a global param like fn.functionName so that way all my functions don't show up in the menu by default and clutter the list.
Last edited by troublesum on Wed Jun 11, 2014 9:33 pm, edited 1 time in total.
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Wed Jun 11, 2014 9:31 pm

troublesum wrote:+1
I would love this too. For now I'm stuck creating global variables with the same name so they show up in intellisense


That's not a bad workaround, thanks for the tip.
B
18
S
4
G
3
Posts: 30
Reputation: 4,088

Post » Wed Jun 11, 2014 11:45 pm

No,C2 = very very easy to coding
for me,i don't need this
but I hope to get CTRL+H Replace Function
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Wed Jun 11, 2014 11:48 pm

I've requested functions to be a primitve rather than a plugin. As a primitive then they would get the auto correction. however that's not the case. if you need a fix for now.... sigh. I've done this before.

--------
Object.YourFunctionVar = "foo"
--------

--------
Function.OnCall( "foo" )
--------

Function.Call( object.YourFunctionVar )

Under this model you only need to actually spell your function 2 times. Once for the OnFunctionCall and the other in the object variable that holds the string. For some reason you can't do

Function.OnCall( object.YourFunctionVar )
makes me a sad panda.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Thu Jun 12, 2014 12:50 am

Although I will say the one saving grace about functions is they are the only true dynamically referable object (Called by String) in C2.. with out that functionality I wouldn't be able to create a game engine (Processor that calls a threaded function stack) or call functions across device in multipliplayer. If they can make the function names show up in intellisense with out losing the dynamic reference I would be a very happy panda :)
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Thu Jun 12, 2014 9:56 am

@Jayderyu

I agree with you, but I fear this would kill the dynamic properties of function, such as project wide referencing without including an event sheet. There has to be some middle ground though.
B
18
S
4
G
3
Posts: 30
Reputation: 4,088

Post » Thu Jun 12, 2014 10:13 am

I honestly have no idea how @Ashley could make intelisense for function object but it would be golden improvement.
Thats literally biggest chokepoint to create games with less time than now. And to make bigger games.
B
22
S
7
Posts: 94
Reputation: 1,783

Post » Thu Jun 12, 2014 11:00 am

jayderyu wrote:I've requested functions to be a primitve rather than a plugin. As a primitive then they would get the auto correction. however that's not the case. if you need a fix for now.... sigh. I've done this before.

--------
Object.YourFunctionVar = "foo"
--------

--------
Function.OnCall( "foo" )
--------

Function.Call( object.YourFunctionVar )

Under this model you only need to actually spell your function 2 times. Once for the OnFunctionCall and the other in the object variable that holds the string. For some reason you can't do

Function.OnCall( object.YourFunctionVar )
makes me a sad panda.


What do you mean by "being a primitive"?How would that work?
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Jun 12, 2014 3:08 pm

FunctionséMethods in other languages are defined objects simlar to int/string/float etc.

So instead of Adding the object Function.
You would rightclick or add a new variable. But instead it would be adding a "group" with defined paramaters. normal programming languges don't have a Function plugin. It's a core element to programming.

So when you need to acess the Function it would be part of the system speficication. Similar to how variables are in the system root when you need to spell them.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests