Fengist's Recent Forum Activity

  • So I've stated numerous times on these forums that I'm a JS noob. However, I got to looking at the code for a plugin I work with a lot and found a lot of things that could be 'improved' or removed in order to fix certain issues I was having.

    I decided that a complete rewrite of the code would likely be the best course of action, since it has an MIT license, and I'd look at releasing a 'simpler' version. So, in this plugin creation quest, I first looked for a boilerplate that would make getting started easier and found something that would work in the plugin SDK.

    The first task would be to change a number of variables from 'myCompany' to something less generic. That task accomplished, I decided to install my very basic plugin and see what happened.

    I was not happy. Because I didn't get all the variables changed, the plugin promptly crashed C3 when trying to load. I was greeted with this HUGE red screen with a HUGE list of errors. Ok, so I goofed that up, let's try again... or so I thought.

    I quickly discovered that the only way to remove my faulty plugin was to go into the developer console and clear out all of the local information for C3. This also meant that all of my preferences and all of my other installed plugins got wiped. Grrrr.

    Ok, so there must be an easier way to do this. Ah hah! Developer mode! Ummm wait a minute.

    https://www.scirra.com/doc/c3sdk/testing-developer-addons.html

    In order to develop a plugin I was going to have to set up my own web server?????

    Ok, so I've set up LAMP stacks in the past and getting them configured properly is a pain in the...*

    And then, I'd have to get the CORS correct and even then, Chrome may throw a fit if it's mixed content and then, I was going to have to tinker around with addon metadata... uhhh... hold on here.

    Now I realize that the whole purpose of this is to prevent re-zipping an addon every time you make a change and reinstalling it. And were I to take up serious plugin development, yea, I'd probably jump through these hoops. But right now, I'm just toying with the idea and having to completely clear the browser cache because I goofed one line of code seems a bit extreme. It occured to me that a checkbox on the error screen, "disable this plugin on next load" would keep me from having to wipe out all of my settings and still let me tinker with writing plugins without having to dive in head first.

    So I'm wondering, has anyone else considered creating a plugin, taken a look at the hoops you'd have to jump through, and came to the conclusion I did?... oh the hell with that.

  • I hope you know CSS.

    construct.net/en/make-games/addons/190/html-element

    That plugin should do it however you may need this plugin as well.

    construct.net/en/make-games/addons/166/inject-css

    in order to load a custom CSS into your project.

    The HTMLElement isn't exactly user friendly and it'll take some work with CSS to get it right but it should be achievable. You should also be able to set the HTML to call a function in C3 when an image is clicked.

    Inside your <img> tag you'd add something like this:

    el-on:onclick="myFunction(myParameter);"

    I haven't tested it specifically with images but it should work.

    As for transparency, and I haven't tried this, there is an 'attribute' field under HTML for the HTMLElement plugin. I'd try

    background-color: transparent;

    and see if that works. It SHOULD default to transparent.

  • I didn't plug this in to see if I got the syntax right but I believe this will work.

    	(Browser.ExecJS("Date.UTC("&Year&", "&Day&", "&Month&")"))
    

    I think you are right

    Actually I was thinking about the gamee jam competition. In it, only multi-player games can be submitted

    Ah, now that's a different story. Their plugins handle all of that. As a matter of fact, if you read their FAQ, you'll find out that you can't use Ajax, Websockets or Multiplayer Plugin for that. You can't make any external connections.

    And, it can be multiplayer, single player or fake multiplayer.

    So, you're back in the ballgame.

    And just as a piece of advice. Creating multiplayer apps is not for the faint of heart. Managing multiplayer communications is a science unto itself. If you're still relatively new to writing code and Construct in general, I'd recommend creating several single player projects and work on making them successful before even attempting multiplayer.

    I'm going to go out on a limb and say that C3 could do this but. You'll be writing a lot of custom JS code to achieve it.

    C3 projects have 3 major ways of connecting to other systems.

    • Ajax
    • Websockets
    • Multiplayer Plugin

    With Ajax you're sending requests to a server and getting responses back.

    With Websockets, you're connected to a server and sending data back and forth.

    With Multiplayer, you're communicating with a signalling server to find matches and then one player becomes the host/server for the other players to join.

    The Multiplayer Plugin would work well on a local network as you're looking to do as latency would be low. However, you'll still need the internet to contact a signalling server and match the players to each other. Once they're matched, the app that's hosting the game takes over.

    Trying to create a multiplayer system that would only function on a local network without the signalling server would require a LOT of work as you'd be writing code defining ports, communications protocols and handling the network traffic back and forth to manage players. Essentially, writing your own plugin.

    There may be another way to do this and someone may give you a better answer, but I'm not aware of it.

  • Make sure your CORS headers are correct so that people can't access your server side files from say, a browser.

  • If you want even more accuracy without a timer you can store Browser.ExecJS("Date.Now()") in a variable when the layout starts.

    Then, you can Browser.ExecJS("Date.Now()") - variable = milliseconds since the layout started.

  • Put the music on a 'global' event sheet that you include in all your others.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you launch C3 through the browser like you do, it runs the latest version. We've been talking about when it gets installed as an app on your desktop.

  • That will work but...

    I suggest a timer that starts when they press the up arrow. If they don't get the cheat code done in say 2 seconds, it resets the cheat code.

Fengist's avatar

Fengist

Member since 6 Nov, 2015

Twitter
Fengist has 5 followers

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x3
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies