Idea: Expression creator!

New releases and general discussions.

Post » Thu Apr 24, 2008 11:38 am

There's no point beating around the bush, so I added Set Visible to edit for 0.95. I think I'll put together a quick wiki article on the Function object - it's got some funky features, like Condition Aliasing too.
Scirra Founder
B
358
S
214
G
72
Posts: 22,946
Reputation: 178,333

Post » Thu Apr 24, 2008 9:43 pm

[quote="Ashley":36tbi34u]That's right, example usage could be:

+ On function "SumParameters"
: Set return value: Function.Param(1) + Function.Param(2) + Function.Param(3) (ie. the sum of the first 3 parameters)

+ Start of layout
: Set edit text to Function.SumParameters(100, 5, 2)

Function.SumParameters(100, 5, 2) would return 107 - the sum of the parameters.[/quote:36tbi34u]


It's indeed very usefull, but it doesn't really help me in my problem. you se.. when you get events like these, and plan to add like 20 more events like this one, it would be nice to have some short-version of, in this case;
Find(Detector.Value('Overlapping') , "(variable.1)")
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Thu Apr 24, 2008 9:44 pm

Ouch, thats a nasty way of going about things. Have a subevent that loops through a list maybe, rather than hard coding it :P

And out of curiosity, what the hell do those numbers mean?! :P
Scirra Founder
B
358
S
214
G
72
Posts: 22,946
Reputation: 178,333

Post » Thu Apr 24, 2008 9:48 pm

Don't really know much about sub-events, but wouldn't it look just as bad, only i'd be able to hide it with a little [-]/[+]?
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Thu Apr 24, 2008 9:57 pm

No no no, put all those numbers/strings in an array or whatever, then loop through the list! (you dont actually need subevents for this) For example - from memory, so dont try pasting:

+ On function "MyExpression"
+ For each element in Array
+ Find(Detector.Value('Overlapping'), Array.CurrentXValue) equal to 0
> Do stuff...

or something along those lines. Basically store all those strings in an object somewhere, and iterate them, instead of laboriously listing the conditions one by one...

But as I type this I think what kind of ugly obfuscated system requires string searches with weird numbers like that??? You're crazy!! :twisted:
Scirra Founder
B
358
S
214
G
72
Posts: 22,946
Reputation: 178,333

Post » Thu Apr 24, 2008 10:11 pm

But with an array, i would instead get to hardcore all the Array.set index at (a,b) to (c)... or is there a way to set the values? It would be nice to have an array that you could actually see! that looked kind of like an excel document, and you could just klick a cell and write a value. Maybe even use the excel commands like =1,5+1,6

[quote:320ctzj8]what kind of ugly obfuscated system requires string searches with weird numbers like that??? You're crazy!! :twisted:[/quote:320ctzj8]

Wait and see...
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Fri Jun 06, 2008 4:30 pm

Hello, i'm Attans mean friend who steals his account to bump this thread. The bump is not his idea in any way.

Edit: Oh no! Damn you mean friend! Well well, now when it's bumped allready i can ask if anyone know a good object to store the values in? You can't edit arrays eccept with events.

[quote:2lb83imi]But as I type this I think what kind of ugly obfuscated system requires string searches with weird numbers like that??? You're crazy!! :twisted:[/quote:2lb83imi]

It's for the AI system i'm working on. Each number is a square around the player, and if the computer can "see" that it is in a good position for a jump, it will jump!
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests