Triggering condition - not working, no "this.running_layout"

  • I am working on my plugin and I'd like to trigger condition. I did everything as it was described and as I saw in examples, however it won't trigger my condition.

    I decided to dig a bit deeper and to put a couple of console.logs into "preview.js -> Runtime.prototype.trigger" and discovered something: the "trigger" stops on

    if (!this.running_layout)[/code:107rxjrk]
    When my condition is triggered - this.running_layout equals to null! 
    
    OK, I trigger my trigger a second later. Now this.running_layout is not empty, but my trigger wasn't called anyway...
    
    Here is the condition for edit:
    [code:107rxjrk]AddStringParam('Lazy section', 'The section you want to spot');
    AddCondition(7, cf_trigger, 'Is lazy section loaded', 'HUD', 'Is lazy section <b>"{0}"</b> loaded', 'Check if this lazy section is loaded', 'IsLazySectionLoaded');[/code:107rxjrk]
    Then in Conditions I have this:
    [code:107rxjrk]Cnds.prototype.IsLazySectionLoaded = function(t){
      console.log('IsLazySectionLoaded('+t+')');
      return true;
    };[/code:107rxjrk]
    [ul]
    	[li]it never gets to this console.log. (notice that I have other conditions, regular, not triggering, and they all work)[/li]
    [/ul]Finally I do this somewhere:
    [code:107rxjrk]console.log('  => about to trigger...' );
    var done = runtime.trigger(cr.plugins_.genericHUD.prototype.cnds.IsLazySectionLoaded, instance, sectionName);
    console.log('triggering result: '+done);[/code:107rxjrk]
    Needless to say that runtime.trigger returns false...
    
    What am I doing wrong? I also see no error messages, everything is resolved correctly, function "cr.plugins_.genericHUD.prototype.cnds.IsLazySectionLoaded" exists...
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It means nothing is running and you tried to run a trigger. I think this is possible if you try to run a trigger while the game is still loading, because the first layout hasn't started yet.

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