change property values?

0 favourites
  • 4 posts
  • 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.

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

    Fill an array with random numbers

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

    Fill an array with random numbers

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)