0 Favourites

Select Plugin Instance at Edit Time.

  • I am trying to create a Plugin [A] that lets you select an Instance of another Plugin .

    I want to load all the instances of Plugin into an ept_combo property of Plugin [A].

    This ept_combo list would have to change dynamically inside the Edit Time when new Instances of are created.

    I have taken a look at this example http://c2plugins.blogspot.tw/2014/02/reuse-ace.html.

    But it does not seem to work inside the Edit Time when I modified it for testing:

    var plugins = this.runtime.types; 
    var name, inst;
    var PLUGIN_LENGTH = 0;
    for (name in plugins)
    {
        inst = plugins[name].instances[0]; 
        PLUGIN_LENGTH ++;
    }
    alert(PLUGIN_LENGTH);
    [/code:1by9qioc]
    ^^^ Just Gives me Errors
    
    To get a better understanding of the [u]ept_combo[/u] I wrote this:
    [code:1by9qioc]
    var randomLength = Math.floor(Math.random() * (10 - 1) + 1);
    var combo_array = "";
    var combo_array_backup;
    for(var i = 0; i < randomLength; i++ ) {
    	combo_array_backup = combo_array + i + " |"
    	combo_array = combo_array_backup;
    }
    combo_array = combo_array.substring(0, combo_array.length - 1);
    
    var property_list = [
    	new cr.Property(ept_combo,      "Canvas",       "0",    "Select the Canvas", combo_array)
    	];
    [/code:1by9qioc]
    
    Instead of a random number I need to have the amount of instances of [b][B][/b] inside the [u]ept_combo[/u]. And when new Instances of [b][B][/b] are added then all instances of [b][A][/b] need to update their [u]ept_combo[/u] property accordingly.
    
    Help!
  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)