Colludium's Forum Posts

  • I have a question that I hope someone might be able to answer... If a device connects, the trigger event is as I would expect. However, if a device disconnects, the trigger event asks you for the id of the device you are checking for. This seems a little recursive... Am I correct to load the trigger expression as below?

    <condition name="On device left" type="AirConsole">
                                <param name="DeviceID">AirConsole.DeviceIDLeft</param>[/code:rfxmw416]
    
    Thus the trigger will check against the device id that triggered the trigger...? 
    
    Thanks.
    
    Edit - very early stages of looking into this and I have nothing to test yet.
  • notnsane - brackets looks good as well.

    X3M - I might have to bow to your superior coding experience - I was attracted by some of the TypeScript functionality that VSC supports (namely the auto-complete and error highlighting functionality in the video at the bottom of the TypeScript.org front page, from 7 min 30 sec).

    Happy days for coders, especially beginners like me .

  • Welp, is this a help forum or... ? I'm starting to think it was useless to wait.

    Patience is a virtue and you should remember that many people here will help you when they have time.

    You need to study the multiplayer full-game example that comes with c2. Many of the events contained in that demo are necessary for the multiplayer plugin to work properly; I am not sure if you have followed any tutorial or example because many events are missing.

    Edit:

    For example, where do you create the peer player? Where do you assign the peerid to each player object variable - where do you send multiplayer message "PeerID" (the event line 5 is incorrect in basic c2 concepts)? These events are missing and are part of the problem you have encountered.

  • For those who have not tried it, may I suggest you give the open source VS Code a try? It's my new favourite text editor, not only because it is easy on the eye but it can present (via autocomplete) all variables that have been declared for the object you are dealing with....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    I am going to have a guess that the c3 engine will be written in TypeScript so it can export/compile the latest acceptable version of JavaScript...

    Just an educated guess because it would keep c3 at the bleeding edge. Also, the Visual Studio Code editor is fantastic, so writing plugins in TypeScript would be a pleasure...

  • It has been this way for > 1 year now (maybe even for nearly 2). Some of the page links don't work correctly as well (like this one: here from the bottom of this page). For some reason the 'old' website is still being delivered via certain links. Not sure if it's directly connected to the login problem, but it all appears a little untidy around the edges. If I can stay logged in to FB for weeks at a time on multiple devices, I don't know why it cannot be the same here...

  • Hi. A few psuedo-random number generator plugins are already available, but none of them achieve what this plugin can do (AFAIK...). My current project needed this, so I rolled my sleeves up, learned a bit of JavaScript and created my first ever c2 plugin!! Please feel free to use it in your projects; if you make it big as a result then shout out to me and I'll be satisfied.

    What does it do? This plugin creates random numbers that conform to non-linear distribution curves. The random(range) expression offers no bias to producing numbers that are near the middle of the range. For example, with a range of 100, 1 is as likely to be returned as is 50. That might fit your needs, but if you want to scatter or spread your random numbers with some bias then this plugin should provide a useful method.

    For example - here's a scatter of returned values from a Math.random() expression (x axis = 0 to 1, y axis = frequency, from 50k runs):

    And here are a few examples of what can be produced by this plugin:

    Demo

    Plugin

    The plugin is on Github, so feel free to modify / improve etc as you desire. The .js library was obtained from here and a good demo of its speed and versatility can be found here - although not all methods have been implemented because I didn't see the need for some of the distribution patterns.

    Distribution options available (% figures are speed of execution compared to Math.random):

      1 Precision Normal Distribution - Gaussian distribution (20%) 2 Precision Custom Loaded - High Quality (20%) 3 Range Float - Uniformly distributed numbers in range (like random()) (90%) 4 Range Integer - Uniformly distributed integers (inclusive) (70%) 5 Range Loaded - Middle/End loaded numbers in range (30%) 6 Game Normal - Normal shaped game distribution (30%) 7 Game Spire - Spire shaped game distribution (50%) 8 Game Thorn - Thorn shaped game distribution (30%) 9 Game Trapezoid - Trapezoid game distribution (50%) 10 Game Bowl - Bowl shaped game distribution (50%) 11 Game Wedge - Wedge shaped game distribution (30%) 12 Game Teat - Teat shaped game distribution (30%)

    Thanks.

  • - thanks for your help. It got me thinking and I did a bit more investigation - I was surprised that the attached library wasn't minified by the export process (is this correct?). When I saw that I realised that the problem was caused by my using dot operators in the runtime.js on functions that required their names to be maintained to access the library. It's all looking good now and as soon as I have a good demo going I'll post the plugin in the other forum. Cheers .

  • Hi. I am creating a plugin for c2 but I'm stumbling over how to make it minify-proof. The library that I am using has one line that breaks the dot syntax rule as described here (I think) and I am a little over my amateur-coding head. The function looks like this:

    if (typeof exports !== 'undefined') 
    { if (typeof module !== 'undefined' && module.exports)
      { exports = module.exports = newObjFn({}) }
      else { exports.LibraryName= newObjFn({}) }
    } else {
      if (typeof define === 'function' && define.amd) 
      { define( 'LibraryName',[],function(){return newObjFn({})} ) }
      else //
      { (1,eval)('this').LibraryName= newObjFn({}) }[/code:5hl3oit4]
    
    The last 2 lines need to be fixed (dot syntax is used throughout the rest of the plugin AFAIK).  Can anyone help please?  How can I re-write those last 2 lines so that functionality is retained whilst dot syntax is used instead?
    
    Thanks.
  • mudmask - thank you! Data-sync is the way to go, for sure. I created a method where each player 'owned' their own bullets, which were then copied to the other peers, so the player always felt that their game was tight. Seemed to work ok, but this project has sadly been shelved for the time being - I don't have time with work and so I've decided to learn JavaScript whenever I get the chance (either for c2 / c3 plugin fun, or perhaps Unity)!! I hope to pick this up at some time next year, although the big headache I was getting to was syncing all game objects between all players - a large world where each player could interact with many game objects was creating a bit of a headache (and required planning and commitment that I sadly don't have time for)...

  • The layer is locked in the editor and it's set to not be visible - both are controlled in the editor's layers tab.

  • digitalsoapbox - I'm using W10 Pro and my controller works in Chrome using the website test in the first post... and if they can get it to work without my uninstalling any drivers then it's probably not a W10 problem (unless they have a super-hackey way around the problem). It's a bit ironic that Microsoft broke their own controller with a version of their flagship software .

  • Problem Description

    The gamepad is broken - no control inputs are registering in Chrome and NWjs (my primary export options).

    Attach a Capx

    capx

    Description of Capx

    A text object displays the gamepad inputs.

    Steps to Reproduce Bug

    • Run the layout and press Xbox360 buttons

    Observed Result

    In Chrome Version 53.0.2785.143 m, IE and Edge, nothing is observed. This also does not work in NWjs v17.0. However, this test does work in Firefox and my Xbox360 controller works in Chrome when testing via http://html5gamepad.com/.

    Expected Result

    Inputs should be detected in all browsers.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (NO)
    • Internet Explorer: (YES)
    • Edge: (YES)
    • NWjs: (YES)

    Operating System and Service Pack

    W10 x64

    Construct 2 Version ID

    r237 64 bit

  • If you are brave then you can edit the .caproj and copy over the appropriate event.xml and layout.xml sheets. Not for faint-hearted non-coders at first and you would be wise to make a backup.... It's not difficult as long as your project contains all of the objects (with the same names) as those on the layouts / event sheets you wish to import.

  • One thing to consider: regarding the conditions you use to filter before a collision check, make sure that they do not filter any of the objects that you subsequently check for collision.

    For example, if you have an object you may wish to check for collision and you give it a boolean canBeChecked, then checking the boolean is true before checking collision will prevent collision cells from working, which may have a performance hit for the collision check. See Caveat 2 in Ashley's blog.