Function parameter limit?

For questions about using Classic.

Post » Sat Mar 17, 2012 1:19 pm

I get a runtime crash when I go above a specific number of parameters when calling a function from an expression, without fault. Both in r2 and the version prior.

Is this anything known of? For the exact approach I'm making these functions I want them as expressions.

EDIT: Construct seems to crash in general if I try to write too much in the Expression window, or at least within the parnethesis of the Function call.konjak2012-03-17 13:42:52
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Mar 17, 2012 2:48 pm

what's the specific number of parameters, so others can see if happens for them as well?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat Mar 17, 2012 2:55 pm

More than 17 it seems.

Also, as I implied, I tried copying one parameter over and over in the expression editor and CC crashed very quickly. I mean, within not too many paramerers, since Construct will also crash just typing a ridiculously high number on its own.konjak2012-03-17 14:56:23
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Mar 17, 2012 4:03 pm

I tried this with 256 param, and it didnt crashed here.

Edit: I don't see any problems @4096 param either, its getting slow, but that's all.Pecek2012-03-17 16:09:30
B
10
S
6
G
3
Posts: 127
Reputation: 2,481

Post » Sat Mar 17, 2012 4:23 pm

And you tried this defining the parameters inside something like a variable, not in an action each?

I just tried compatibility mode in Windows and Construct went completely frozen just defining too many parameters in the event sheet.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Mar 17, 2012 4:30 pm

I tried it in python

for i in range(4096):
Function.AddParam(i)

I don't think it'll be different if I would use a pv for this, but later I'll try that way.
B
10
S
6
G
3
Posts: 127
Reputation: 2,481

Post » Sat Mar 17, 2012 4:32 pm

Well yeah, that's not the same way after all. All you should have to do is "set variable: Function.functionname(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)"
And that, if anything like me, should crash your runtime, or even possibly Construct.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Mar 17, 2012 4:37 pm

Perhaps it is not safe to use the ways I've tried just setting random variables or texts, and I should be using a less object-oriented action?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Mar 17, 2012 5:00 pm

I just did some testing and it seems to be a bug in the way the expression editor checks to see if the function expression is valid or not. For instance, I tried pasting konjak's expression (with the 17 params) into the editor and it wouldn't let me press finish and add the action. From that point on I wasn't able to write any other expressions, even valid calls. Closing the expression editor crased the IDE. Then, I tried making an expression by adding parameters one at a time. It was valid until I added number 20, then the input field became permanently red and wouldn't accept any other expressions, (even just a qouted string) until I closed it and it crashed construct.

Oh and konjak, do you actually need the return value of the function (like do you want to set the variable to the return value), or are you just calling it in a set variable action (you don't care about the variable) because you want to call it as an expression.Davioware2012-03-17 17:04:16
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Mar 17, 2012 5:22 pm

What I'm doing is basically replace all my events where I create an Effect and then write 5-10 actions below it, with a function that basically reads:

Function.create_effect(Layer,X,Y,VariableName,WhatToSetItTo,VariableName,WhatToSetItTo,VariableName,WhatToSetItTo...)

So I'm only trying to create unrelated actions. Since I'm having CC problems possibly relating to my project's size I want to truncate event sheets in any way I can.

EDIT: By the way, I created an alternative to it that basically parses strings that say it similar. I just don't know if so much string parsing is inefficient. It's also slightly more cumbersome to type out as an action.

EDIT 2: I tried calling the function as an expression in a plain "Evaluate" condition, but it didn't help.konjak2012-03-17 17:29:08
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests