Magistross's Forum Posts

  • Time to dust off an old cp3 of mine. This should help you do what you want :

    drive.google.com/file/d/1t_6EDnghFIEhLgSiSj1WmAmU5YAwiAhJ/view

  • You can compare the AdvancedRandom.Weighted expression directly in a condition using "System > Compare two values".

  • Using the permutation table is quite easy. You initialize it with a length and a starting value, and it'll automatically randomize itself.

    Problem is, you need to create a visual pseudo-shuffling animation. To that end you can still use a normal random call, but when it's time to pick a final number, you do so using the permutation table at the correct index.

    Here's your modified example implementing what I explained :

    drive.google.com/file/d/1HkqVTyFrRjg0AvcsHcTZXT25oTs_D_89/view

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Good job putting my examples to good use. I must have been in some sort of coding trance when I made those because now they all feel so alien to me !

    Keep up the good work !

  • With the "Advanced Random" plugin, using the permutation tables functionalities.

    See the documentation on its usage :

    construct.net/en/make-games/manuals/construct-3/plugin-reference/advanced-random

    You basically need to "Create the permutation table" with an action, and then fetch values using expressions.

  • You can also bundle a sprite and an array together in a container, so each sprite instance will get its own personnal array.

    However, it'd much simpler and intuitive to be able to reference said array the way you pointed it.

  • You can use another tilemap with a single tile and set it as solid and invisible. No tile = passable, tile = obstacle.

    You can either pre-tile the obstacle tilemap or tile it at runtime based on the other tilemap.

  • I delved a bit in the source code of the tilemap, and I don't think it's reasonable to have a plugin to do that. The collision engine is deeply rooted in the C3 core and most of its code is external to plugins.

    I think it would be better to have Scirra officially support this. Maybe by adding a new tile state to its mask (i.e. collision disabled flag) ? A tile state already flips the collision polygon accordingly, maybe a new state to entirely remove the polygon for said tile is easily feasable ?

  • Another workaround would be to use 2 tilemaps, one for visual representation, another invisible one for obstacles (with a single obstacle tile in the tileset).

    You could then rebuild the collision map on layout start or tilemap creation by iterating through each tile and testing for collision (slow) or defining obstacle according to tile IDs (fast). And then, remove obstacle tiles by iterating through bridges and what not.

    Here's a crude exemple : drive.google.com/file/d/18kc2dI-WpgbQXATVs-NWX4H_GTBHdnyV/view

  • Saving the project as a "project folder" is the only way to allow cooperation through something like git.

  • A good way to organize events so only one branch trigger would be like this :

  • To put something in the global scope, you can use "globalThis.somethingGlobal = someObject", so in your case, in the "OnBeforeProjectStart" event, add this :

    	globalThis.f_tcalUpdate = f_tcalUpdate;
    

    Now because JS module are in strict mode, another correction need to be done in your tcal.js file. A variable can't be used before declaration so line 148 is invalid. Just add "const" in front the line and it should work.

  • The file from the CDN doesn't look like a javascript module. There is no export of the PptxGenJS variable.

    You probably should add the js file to your project and do an export of said variable.

  • Might not be the best if you need to rebuild this object frequently, but simply iterating through your x-axis should be quite easy to get the data needed by your library.

    const arrayInstance = runtime.objects.Array.getFirstInstance();
    let arrayData = [];
    
    for(let i=0; i < arrayInstance.width; i++){
    	arrayData.push({x: arrayInstance.getAt(i, 0),
    					y: arrayInstance.getAt(i, 1)});
    }

    As a side note, the debug text box should have its BBCode functionality deactivated, otherwise it will create weird anomalies trying to display your JSON.

  • Then you should probably simply use the .then() function.

    postData(...).then(callbacks)

    See documentation here : developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then