Magistross's Forum Posts

  • From manual, this might apply to your situation :

    [quote:gqqw1emt]Note that previewing with node-webkit runs node-webkit directly from the Construct 2 install directory. As a consequence, the AppFolder expression will return <install path>\exporters\html5\node-webkit\win32. If this poses a problem for you, use the following workaround: have a global string variable; if 'Is in preview' is true hard-code it to some development folder somewhere else, otherwise set it to NodeWebkit.AppFolder. Then use the global variable instead of the AppFolder expression.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The best solution will always be the condition "Pick by UID". It can pick instance that have just been created, even when not in a top level event. As good as this solution is, it's not always practicable.

  • Haha, yeah, I did that just to be safe, although there might have been a better way. But this method was quick and easy.

    We don't know for sure which instance is the collider nor which instance is the collided, it all depends on their UID (i.e. order of creation) I believe.

  • I took your game2.capx and modified it to make it work like I think you intended.

    I used two recursive functions, one for each "direction" of neighbour checking. As Aphrodite hinted, the magic come from the "For each (ordered)", which combined with an immediate "Stop loop", essentially turns it into a makeshift "Pick by ordering". Each time a color match is made, the functions are called again with new parameters, up until no match are found.

  • If your SOL contains more than one of your "enemy" object, only the first one will be affected. An explicit for each is thus needed to ensure the function is called multiple times (if needed).

  • A common "id" instance variable is one way to do it. But as you said, you could have created a AICarUID instance variable in your "coverSprite" object, then in a "For Each AICar", pick coverSprite object where coverSprite.AICarUID = AICar.UID

  • Your best bet is to use manual target acquisition. Here's your capx modified so your turret acquires the closest target in its line of sight.

  • If I remember correctly, "Else" resets the SOL altogether.

  • Using the 8 directions movement, it's quite easy to implement a basic "strafing". See below :

  • There is a function that returns true when a given string is NOT a number. It's not wrapped in any System expression so you'll have to use the Browser.ExecJS expression.

    Browser.ExecJS("!isNaN(""" & yourVar & """);")[/code:1zas59qt]
    
    This will return 1 if yourVar is a valid javascript number.
  • I think the XML plugin expect your root node to be in the null namespace.

  • I tried using an iframe to print the resulting canvas snapshot, and it seems to be working in Chrome.

    Use the "On canvas snapshot" trigger and add the following executeJS :

    "var iframe = document.getElementById(""iframe"");
    if(!iframe) iframe = document.createElement(""iframe"");
    iframe.frameBorder=0;
    iframe.width=""0px"";
    iframe.height=""0px"";
    iframe.id=""iframe"";
    iframe.setAttribute(""src"", ""about:blank"");
    document.body.appendChild(iframe);
    var image = new Image(); image.src = """ & CanvasSnapshot & """; $(""#iframe"")[0].contentWindow.document.open(); $(""#iframe"")[0].contentWindow.document.appendChild(image); $(""#iframe"")[0].contentWindow.document.close();
    window.frames[""iframe""].focus();
    window.frames[""iframe""].print();"[/code:1d3shdhx]
  • You could link them manually, using instance UID, and abandon containers. Although the manageability would suffer a bit, you wouldn't have to worry about that duplicate texture problem.

  • The SOL (selected objects list) doesn't transpose into function calls. You have to redo all pickings. You can either pass your newly created card UID to the function and add a pick by UID condition, or create the card inside your function, since an implicit picking is done on "create object" calls.

  • I guess you could that with a function.

    Both of these functions work, use the one that suits you most !

    You could even add another parameter to set a specific value to those keys, instead of the default 0.