skymen's Forum Posts

  • Well. Creating layers.

    In the end the method might also be used to reorder layers, delete them or duplicate them.

    If you mean "In what context is this useful to have because it would be the only way to achieve a given goal" I'm pretty sure you can find tons of possible uses of this on your own, but let me make myself clear. The whole point of me wanting to do this is to make it easy to do stuff, not to make it possible.

    There are many ways to avoid a problem by using alternative ways, but when these ways involve wasting my time doing stuff I don't like doing then I'm out. In fact this is exactly what I described at the beginning of my post, and this is also why I don't request for this to be a feature but rather for this to be a discussion about what can be done theoretically using the engine's hidden functions.

  • As reported here:

    github.com/Scirra/Construct-3-bugs/issues/1911

    The textbox bar doesn't work. I'm surprised I haven't heard anyone complain about this sooner. I don't seem to be the only one experiencing this though.

  • Eh. I kinda like the overall style of the new website. Everything is fine to me. The colors look really nice. Also I don't think a dark theme for a forum would work well. Just an opinion though.

  • Hi,

    I'll try to make this quick. Yesterday I was thinking about how I would manage a particular issue I have with my project which involve my will to make as many things as possible automated and my strong hate for boring work.

    Basically I was in the case where my project needed a LOT of layers to work for the UI. So that meant creating a layout filled with lots of global layers dedicated to UI and then having to add these layers manually to all of my layouts that need that UI.

    I know. I don't wanna do that either. So instead I figured I might try to automate the process of creating layers. So I took a deep dive into the construct 2 code, reading most of the runtime code, most of the cr code, and most of layout.js.

    My main inspiration was Toby's Unload and Preload plugins which allow a user to load layouts and basically make a real loading screen. I knew that to do this he kinda had to take deep dives into the engine as well.

    Anyway, here's what I gathered from this, and I'm not done looking around yet, but I figured I might as well make a topic that I'd keep updated.

    The code to create a new layer in a layout is pretty simple:

    var layout = this.runtime.running_layout;
    var layer = this.runtime.layouts_by_index[1].layers[0]; // whatever method you use to get other layers.
    //You can also create a new layer by calling the constructor in cr
    layer = new cr.layer(layout, layerData) // With layerData being an array containing all of the layer's base info. You can get a look at what it looks like by logging the variable m in the Layer's constructor in layout.js
    layer.number = layout.layers.length;
    cr.seal(layer);
    layout.layers.push(layer);
    

    This works for copying any layer from any layout or creating a brand new one.

    Now this comes with issues, including some I have yet to figure out.

    The first issue is that layers are assigned an sid value which I can only imagine is used to manage layers during runtime. I can't tell which issues having two layers on two different layouts share the same sid would create, but I can guess it could mess with the existance of that layer entirely, or even overwriting it entirely which would be bad. A fix would be to just make sure to deep copy the layer and change the sid instead of copying directly.

    Having 2 layers share the same sid on the same layout seems to erase one of them. Or it could also be due to both layers sharing the same name. Anyway, it's problematic in any case.

    The second issue is that objects aren't copied over from that piece of code only. I gathered that some other piece of code is in charge of actually creating the objects a layer is holding. I'll have to keep investigating to be sure.

    The third issue seems to be a bug that should be a problem in most use cases. When I tried creating a new layer entirely, I tried setting it to non transparent, and to change the background color to cyan, just for the sake of testing the thing. The new cyan layer did appear in front of my other layer containing random sprites, but when I tried moving one of these sprites to the new layer the sprite wouldn't appear. This is weird because the debugger says that the sprite did in fact change layers, and when the layer is transparent, it works totally fine and the sprite gets thrown in front of all of the other sprites.

    Another issue that I think will never be resolved is the case of global layers. Given my initial intent, my goal was to create new empty layers named after global layers so C2 would do the job of copying all of the objects for me, but unfortunately the only reference for "global layers" I was able to find in the code was about making sure two objects from global layers didn't share the same UID, which makes me think that global layers are entirely managed in the editor and when it comes to previewing and exporting, C2 copies all of the stuff on the global layers to all the overriden ones. So global layers don't exist during runtime. Which is kinda lame, because my original idea wont work, but kinda makes sense as well.

    My initial question was "Can I make it so I can add all of my UI stuff through events, including the layers?" and the answer is "Yes, in theory, but if I don't wrap my head around these issues, I'll have to make one global layer, shove all of my UI in it, and create all the new empty layers at runtime, and manually move all of the UI to the right layer after creating it. Which hopefully works and doesn't make C2 freak out for a frame"

    Also, I guess deleting layers, reordering them, and duplicating them should be possible if done right. It even seems that creating new layouts entirely could be a thing in theory. Which would be absolutely amazing for lots of things.

    Anyway, this is what I gathered, but I didn't write any of that code, just read it and I guess I'd need to know what Ashley has to say about this. If I'm mistaken about anything in here, please tell me. If you have any insight to give me, please do. The following is addressed to you.

    Please note that this is not a feature request even though this would be amazing to have in the new C3 runtime, even though it would be super dangerous in the hands of new users. I'm not making a feature request for this because I don't see the point of making one yet.

    Please also note that while I am speaking in the Javascript SDK and while I do plan on making a plugin to allow me to control these from the event sheet if it happens to be possible, I do not plan to share that plugin to anyone any time soon. I'm not willing to give support to this, and any user wanting this is either advanced enough to replicate what I did from the piece of code I shared or shouldn't be attempting this entirely.

    Finally, please note that this is all a discussion about what can or cannot be done using C2 by potentially rewriting parts of the runtime through a plugin, and while I do realise that this may not be a good choice to step out of what is documented in the SDK (because most undocumented stuff is undocumented for a reason), I wouldn't want to talk about that because it would make no sense to warn anyone about this. I just wanna have fun with the engine without breaking half of it, so I wanna know if there are things I need to know before trying to do so. By that I mean potential issues I didn't see coming, incompatibilities with what the editor might do, stuff breaking when exporting etc.

    Thanks for reading all of this. Anyone curious about this can discuss it in this topic.

  • I made a behavior that allows you to add more collision boxes to an object.

    C2 version: construct.net/construct-2/addons/156/collision-box

    C3 version: construct.net/make-games/addons/155/collision-box

    Demo: collisionbox.surge.sh

  • > I have no idea how to use this converter. Can somebody help me with this?

    That ^

    This was already written in the initial post but just in case

    WARNING: this is not meant for casual users. Really, only SDK writers should use this as there is no guarantee it is complete, and if you install a plugin that has any kind of syntax error, you have to wipe the Application cache and/or the Browser cache! This means you loose any projects you've saved in local storage!

    You're not supposed to use it if you don't know how you should use it. If you end up breaking your stuff you'll be the only one responsible.

    Now, you use it with CMD or Powershell just like written again, in that same initial post.

    Usage:

    -masterblaster inputDirectory outputDirectory

    This lets you point the tool to one top level directory and it will process all plugins in that directory. (ie: C2/../plugins) Outputs to the output-directory.

    -noScirra -masterblaster inputDirectory outputDirectory

    Same thing but it will skip Scirra plugins. Good to try third-party plugins in your plugin directory.

    inputDirectory outputDirectory

    Processed a single plugin and outputs it to output-directory

    inputDirectory outputDirectory "pluginCategory"

    Processed a single plugin and outputs it to output-directory. Sets the plugin category in plugin.js to the specified value. Must be one of the values specified in the SDK manual.

    No code is migrated, only the properties and ACE definitions. Language mappings are all uniquely identified. No extra (.js) files are added. I'm not sure how to support that yet.

    Use the Visual Studio editor to check all JSON files. It points out errors before you upload them.

    Example:

    C2C3AddonConverter.exe -noscirra -masterblaster "C:\Program Files\Construct 2\exporters\html5\plugins" "C:\C3pluginStagingArea\C3conversions"[/code:2zr321y6]
    [code:2zr321y6]
    C2C3AddonConverter.exe "C:\C3pluginStagingArea\C2originals\bht_smart_random" "C:\C3pluginStagingArea\AutoGen\C3_bht_smart_random" "data-and-storage"[/code:2zr321y6]
  • Hi! Do you still have the plugin's link?

    Hi, yeah

    C2:

    construct.net/construct-2/addons/79/stack

    C3:

    construct.net/make-games/addons/80/stack

    The transition to the new forum broke lots of messages apparently.

  • is this useable in Construct 3?

    KaixaZero Yes it is!

  • Smart Joystick — Now for sale in the Scirra Store!

    https://www.scirra.com/store/construct2-plugins/smart-joystick-4351

    <h3>Description</h3><div class="deshr"></div><p>The plugin allows you to easily add one or multiple joysticks on the screen. The joysticks have 3 touch events and 3 dragging modes:</p><h3>Touch events</h3><div class="deshr"></div>

    • None
    • Fade: The joystick fades in when touched, and out when untouched
    • Reset Position: To use with spawn or smart dragging mode, the joystick resets back to its position when untouched. Note that fade also resets the joystick's position, but only when fully faded out.

    <h3>Dragging modes</h3><div class="deshr"></div>

    • Regular: Like every joystick, nothing special
    • Spawn: The joystick jumps to the touch position if in range, allowing the user to immediately drag and avoiding dragging by mistake when just tapping the stick.
    • Smart: Has the spawn ability, but also if the user drags too far, the sticks moves with the user's finger, so when the users tries to go in a different direction, he doesn't have to go all the way back. This mode is most useful for action heavy games where the user's finger is always on the stick and he doesn't pay much attention to how much he's dragging.

    Use this topic to leave comments, ask questions and talk about Smart Joystick

  • Yes! It syncs the position, angle and mirrorring and flipping.

  • Skins Addon — Now for sale in the Scirra Store!

    https://www.scirra.com/store/construct2-plugins/skins-addon-4324

    <h3>Skin it</h3><div class="deshr"></div><p>Skin it is a pack containing a plugin and a behavior that will allow you to easily implement a skin system in your game.</p><h3>The plugin</h3><div class="deshr"></div><p>A skin group is a global plugin that will contain every information about a set of skin. Each skin contains a number of subskin that you set up yourself.</p><p>You can have multiple skin groups for categorisation purposes, and each group is referred to with a tag that you need to set up in the skin group's parameters.</p><p>Each skin group allows you to get a random skin and a random subskin from a given skin.</p><h3>The behavior</h3><div class="deshr"></div><p>The behavior will allow you to attach a skin to a sprite.</p><p>The default skin is whatever the sprite contains before the skin gets attached.</p>

    • The skin group tag needs to be set as it can't be changed at runtime. It links the behavior to the appropriate skin group.
    • The skin and subskin tag are the skin values that will be used on start of layout.
    • Use default skin shall be set to Yes if you don't want the object to start with a skin.
    • Hide default skin means that the sprite will get set to invisible if a skin used, and visible if no skin is used.

    <p>A sprite can hold multiple skin behaviors, each with its own properties. The skins, then get layered following the behavior order, from top to bottom.</p><p>A skin, as it is also a sprite, can hold a skin too.</p><h3>Use cases</h3><div class="deshr"></div><p>In the demo, you will find a wearable equipment system.</p><p>You can also make a regular skin system where the character gets entirely replaced by new skins.</p><p>You can also make an NPC system where every NPC is the same sprite, but the visuals get replaced by a skin.</p><p>Skin it basically separates a sprite from its texture, making anything with dynamic texture relatively easy to set up.</p><p>The skins never need to be loaded as well. They only need to be stored in an object bank layout to have a model for creating them. You can also decide to use different resolution skins by resizing them in the object bank.</p>

    Use this topic to leave comments, ask questions and talk about Skins Addon

  • Backported it to C2

    https://mega.nz/#F!Y11CEDxC!SvafIUuHZaQLICSIpn4n7w

    Don't mind the skymen at the beginning of the files. It's automated naming. I don't take credit for making the plugin. I only backported it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    Do you mean to defend people's right to be abusive to Scirra staff? How is that even up for debate? It is so completely unacceptable that I strongly encourage anyone who thinks that to leave. Go and use someone else's software if you really think that.

    With all due respect that was never the case and never will be. And not only to Scirra staff but to anyone. We have taken action for the personnal attack you received, and are always taking action as soon as anyone is attacked and/or harrassed. If you had read our rules, you'd know that we don't allow that.

    Please, I nicely ask that you calm down, and stop putting words in other people's mouth. He said that the discord server allowed for some discussions to continue outside the forums if they were closed. I don't know what you exactly mean by "people [who] cannot abide by basic rules of civilised conduct" but you know that in a forum discussion it's rarely only one or two members and some other people might wanna keep on discussing the topic without seeing the discussion closed because someone else couldn't keep things respectful.

  • dop2000 Basically the only advantage it has is if you only need a stack specifically. But yeah you can do everything with an array as well. It's really just for specific cases where you don't need more than the stack features.

    The same applies to my Queue plugin btw.

  • Hey,

    This tool is a life savior. It's extremely cool, so thank you!

    I have some suggestions though:

    The tool fails to add ACEs when the ACEs functions in editor.js aren't all ending with a ";".

    I know it's better to have them, but when I copy some code, especially from the default sdk provided, I sometimes forget to add these.

    The tool stops when it encounters an "AddFunctionNameParam" or an "AddAnimationParam" which are hidden param features that are no longer available in C3. So I'd recommend to change them with an "AddStringParam" as it doesn't change anything (else than the C2 specific editor features).

    It would be cool if these got fixed, even though they're pretty easily fixed by hand before the conversion.