change property values?

Get help using Construct 2

Post » Wed Jul 24, 2013 11:28 am

the RandomArray plugin defines 2 properties which appear in the editor on the left under properties. I.e. Width and StartValue. These can be set by hand.

However, I need to set the startvalue property dynamically at runtime.

I cant find any way to do this (unless I try to extend the plugin I guess).

Does C2 expose a way to edit a plugins properties in the event sheet? I tried the "set value" under instance variables of the object, but this doesnt work. Basically, I need to somehow evaluate the expression: "RandomArray.StartValue = loopindex" or similar.


B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Wed Jul 24, 2013 11:44 am

Maybe instead of the RandomArray plugin you could use the standard array?

Fill an array with random numbers

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 24, 2013 11:50 am

[QUOTE=LittleStain] Maybe instead of the RandomArray plugin you could use the standard array?

Fill an array with random numbers

[/QUOTE]

Thanks for the suggestion LittleStain. I need to fill an array with unique random values. One way to do this is to fill the array with consecutive values, then mix them up (which is what I think the RandomArray does). To do this in C2 would be pretty hard. To do it in JS is very easy. The problem for me, is that its impossible to pass back arrays or multiple numbers from a plugin, only string or single numbers.
B
17
S
6
G
3
Posts: 370
Reputation: 3,942

Post » Wed Jul 24, 2013 12:10 pm

Maybe this example will help:

This is for a deck of cards

Comparing Construct2 to JS is a bit unfair.
It's like comparing playing guitar to playing piano.
Yep it's both making music, and they are both string-instruments, but the techniques are quite different.
Construct2 is actually quite powerfull.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Davlin, robinw326, Unconnected and 2 guests