McKack's Forum Posts

  • I don't see any reason it shouldn't work. Did you try without succeeding?

  • Sorry! Links should work now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I had to place the plugins in:

    ...Steam\steamapps\common\Construct2\Construct2-Win64\exporters\html5\plugins

    If you're using the 32bit version:

    ...Steam\steamapps\common\Construct2\Construct2-Win32\exporters\html5\plugins
  • Import

    About

    Import, previously known as the CSS Import plugin (download still available at bottom of post), has been updated and renamed - it now supports JS as well as CSS (open to suggestions for other filetypes you'd normally add to the exported HTML, if any)

    The Import plugin allows you to import files you've added to your project into the DOM at runtime (even with NW.js!) instead of having to edit the index.html each time you export.

    Primarily it's just meant for testing things like CSS or JS modules without the need to export, but depending on your project you may be able to use it in your releases as well.

    A tiny drawback for instance with importing at runtime is that it's not immediately loaded, so you might see styled elements switch from original look to styled for a few ms. if you load directly into a layout. This can be hidden with a loading layer, layout or setting initial visibility of styled elements to hidden, then unhiding them at start with events.

    Usage

    If you only need to import one file you can use the Auto-import field under the plugin properties.

    There's no benefit of Auto-import vs events and you can combine both methods as well if you'd like. For example, import module.js via Auto-import and style.css at start with the Import file event. There's built-in protection from accidentally importing the same file several times but it may not be bullet proof so try to avoid it if possible :]

    Import v1.1 Download - June 9th 2017

    Plugin: mck_import.zip

    CSS Import v1.0 Download - January 18th 2013

    Plugin: css_import.zip

    Example: css_import.capx

    Screenshot: http://i.imgur.com/ZWVFy.png

    Credits/Disclaimer

    The plugin was basically Frankenstein'd from Pode's HTML Div plugin (because it contained CSS stuff) + code scavenged from the web. So credits to Pode and this site specifically for making this possible.

    I have no real coding skills, this was mainly just for personal use and don't think I'd be able to make a plugin from scratch. So this means I can't guarantee it working flawlessly. I've only tested it in Chrome on Windows 7 and 10, so if it breaks down and blows up your computer, I warned you!

    Enjoy!

  • Hm, weird, I didn't see any glitch on my side. Even though the text was just for informational purposes in the example, thanks for the tip.

  • Yann Yes, much more efficient than mine :) I had to mix up the system events slightly to get it to work properly though. I made an example out of it (holes.capx):

    Example

    R restarts the layout

  • I'm no expert at Construct but I would have done something along the line of this (it picks cards at random instead of assigning a random value and is flexible since you can place any equal number of cards in the layout, not only 20):

    #Global values, ho!

    Global number cardIDs = 1

    Global number cardCount = 0

    #Count the number of cards and store in global value

    On start of layout

    • set cardCount to number of cards in the layout (card.Count)

    #Assign the IDs to cards that don't have one (ID = 0) at random

    cardCount > 0

    card ID = 0

    Pick a random card instance

    • Set (card) ID to cardIDs
    • Subtract 1 from cardCount
    • Add 1 to cardIDs

    #This resets the ID enumerator halfway through assigning

    cardIDs = (card.Count/2)+1

    • Set cardIDs to 1
  • Awesome! Looking forward to it.

  • I'm currently looking into the same problem.

    Looks like for now you'll have to "hack" the plugin if that's even possible, to give you the user_id. It should already know it since hi-scores are supported but it seems it's all internal. Studying the code I guess you should be able to "simply" copy paste one of the expressions and alter them so you can retrieve the user_id.

  • Suggestion.

    I don't know how hard it would be, and I'm guessing Scirra will introduce this some time in the future themselves. But I'm currently killing myself setting up level(layout) changing by having to make an event list of every single level available in a game bound to a variable's specific value for example, instead of a changing the level by expression.

    Long story short: "Go to layout by expression".

    Now, I guess it's technically an action, but an expression-dependent action so it might be a good addition to the Extra Expressions plugin.

    For your consideration, thanks!

  • Wow, this is a godsend for a project I'm currently working on with random points popping up on the screen. I had created my own string to sprites font "engine" using events but it was somewhat bugged and laggy with lots of points at the same time, so thanks a ton for creating this!

  • Sounds promising.

    Secured myself a Pro copy and looking forward to the C2 integration!