Colludium's Recent Forum Activity

  • Yes, but if I have 8 players (ambitious!) max, then with this setup I will need 8 trigger condition events. I would rather have just one and then action according to id afterwards. Unless my code above works then it'll be impossible to do any other way than with multiple triggers (because AC site says that id numbers are assigned on connection and may not be predicted).

  • Thanks - that what I suspected too, although I haven't tested it - I was hoping that the trigger would simply return an expression for the leaving device's id, rather than you have to check for a specific id in the trigger itself. Given that these ids cannot be known beforehand, I feel like it'll make for some clumsy events (however, my caveat is I haven't actually tested it yet).

    I was looking through the plugin and noticed that DeviceIDLeft in the edittime is a number, but the returned value from the runtime is a string. Possibly an error? Or am I just misunderstanding it?

    I'm still reading through the controller setup info, but returning c2 json messages is definitely the way to go.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • question can this plugin deal with dynamic Ai situation based. As in if the Ai is almost dead intead of being a blood thristy attacker it should start to think about defend or using a heal from an ally or an item. as oppose to when it has 100% hp it should relie on attacking.

    And what about making it a bit smarter as in if you are weak against a particular spell it should be thinking to use that but if you fully resist it as in if it use an attack and it didnt work on you the first time drop it ? and use a different number placement?

    Because often times ive seen random number to alway choose one number and its irrating as hell like choose 1 2 3. so that 30% effective choice......1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 oh hi 3 back to 1111111. you can understand this fusteration.

    This plugin will only generate a random number; the AI is for you to manage in events. Depending on the distribution profile you select, it will produce a 'loaded' random number to fit that profile. Have a look at the demo if you're not sure / I'll try to answer if you have more questions.

  • 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....

    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.
Colludium's avatar

Colludium

Member since 26 Aug, 2013

Twitter
Colludium has 11 followers

Connect with Colludium

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies