fisholith's Forum Posts

  • Thanks oosyrag for the suggestions.

    I agree, though, I think "trigger once" is also checked every tick, it's just that it makes a much simpler boolean check, to see if it can reset. If you code your own equivalent trigger-once-style functionality I think it should perform about as well.

    The "trigger once" condition is especially good for cases where you know the True/False frequency of the rest of that event's conditions will always be slower than 2 ticks. The event sheet's Nyquist frequency, so to speak.

    So the case of on-hover is a bit tricky in that respect. If your buttons are really far apart you're probably safe. However, if you have a row of buttons close to each other, you can roll off one button and onto another button, without an intermediate tick where no button was hovered. And that can confuse a "trigger once" based system. It wouldn't if "trigger once" really was a trigger-type condition, but I don't think it is.

    I might be mistaken, but I think adding "trigger once" to an event does not actually make it a triggered event. Relatedly, C2 has both True Triggers and Fake Triggers. In the C2 event sheet they appear identical, including both using the little green arrow icon. The "Fake Triggers" are literally tagged as Fake Triggers in the Javascript of the plugins that employ them. I think the purpose of them is to interact with other conditions in the same way true triggers do (e.g. no stacking) but under the hood, they are still per-tick events.

    As far as I know, true "Triggered events" are implemented as message-subscriber style function calls internally, or something similar. The "On function call" is an example of a true triggered event, as it really doesn't check every tick. In fact, I think "On function call" may be an even more specialized version as the function name may be hashed or something to make it even faster than a normal true "Triggered event".

  • Interesting. Thanks for the info

  • Thanks oosyrag,

    That's the workaround I've been using.

    I started looking into the possibility of a hover selector, because setting the colors back to the non-hover state with actions seems to be a little finicky sometimes. There's always the brute force method of every tick set to normal, followed by if hovering set to hover colors. I may try storing the UID of the hovered button and explicitly checking for the end of a hover on the current UID button.

  • Hey rafaelsorgato,

    One way to do this is to store the Antenna's UID (Unique ID) at the moment it is being pinned to the Ship.

    For the Ship, create a private variable called "antenna_uid".

    In the event sheet, just below the action that pins the Antenna to the Ship, add the action,

    Set the Ship's private variable "antenna_uid" to contain the Antenna's UID.

    Now each ship will store the UID of it's personal Antenna.

    To pick the Antenna, use the condition,

    Antenna: Pick by UID: And use the Ship's "antenna_uid" as the value.

  • Hi hychoi,

    This is just my impression, from having worked with C2 for a while.

    If you only use the standard plugins in C2, it would be quite hard to make a simple DAW.

    The built-in features of C2 work very well for games and even a lot of applications, but many of the core features of a DAW are not natively supported by C2, and might be pretty hard to implement.

    C2 is very flexible though. Using the SDK, you can build custom plugins to handle just about anything.

    So, it's theoretically possible to build a DAW in C2, but you would probably have to do a huge amount of the work in the JavaScript SDK.

    Just about everything involving audio, midi, and VST style modules would need to be implemented as custom plugins. The built-in Audio plugin, is pretty nice, and solves a lot of tricky web audio problems, but it's focus is fundamentally not tailored to DAW tasks. I think you'd only be able to use it for UI sounds in this case.

    So, I would probably not recommend building a DAW as your first major project in C2.

  • I think you may be right zenox98, though I've been hesitant to bump it again, as I know Ashley's probably got quite a bit going on with C3 and all. Maybe I should though.

  • For HTML objects like buttons, you can set their normal CSS properties with actions.

    Is there a way to set CSS hover properties with actions?

    e.g. Set a button to have a red boarder when hovering over it.

    It looks to me like it may not be doable with actions, but I wanted to ask. The runtime JavaScript for the button object uses a JQuery function that does not look like it's set up to be able to select the "hover" version of the button.

  • Hey there Syazanie Amirin,

    Below is a bit of overview, and my thoughts on the two methods, in case it helps.

    Local storage

    Local storage lets you save and load specific data, and importantly, when you load data, you can use it whenever an however you want.

    Save system

    The save system saves a complete snapshot of the entire game state. Loading a state is kind of like time-traveling back to exactly how things were when the state was saved.

    Save system exemption

    There are lots of situations where you may not want the entire game restored that way, because some information about progress you may want to keep. (e.g. Unlockable items.) To avoid losing that information, you can exempt certain objects from being captured by the save system using the "No Save" behavior.

    Hybrid

    But if this information is saved by the save system, then how do you avoid losing it when you close the game? Well, this is another situation where local storage can help. Anything data that should persist between play sessions, that isn't getting saved by the native save system can be manually saved to local storage.

    Save system quirks

    Finally, the native save system is quite good, but there's one quirk that can cause problems. It may not save absolutely everything exactly as it was, and this can cause some problems when restoring. The only example of this I've found is that you can selectively disable collisions between different Physics objects, but when restoring from a save state, that disabled-collision-state information is not restored.

    I wrote up a bug report for this issue at the link below.

    The game I'm working on uses Physics objects with some disabled collisions, as a result I don't use the save system at all, and rely exclusively on local storage.

    This is just my experience with the two methods though. Hope this helps.

  • Hey there WieBrei,

    I'm not sure, but if reinstalling C2 didn't fix it, then it seems like the problem may lie in some external resource that C2 tries to invoke when loading certain projects.

    Even so, it may still be triggered by some aspect or content of a project. For instance, if C2 is trying to load something specific to a certain object, and some part of that process prompts C2 to do something that results in a crash.

    Questions

    Are there any projects that will sometimes work and sometimes crash, or is it that specific projects consistently always work or always crash?

    Can you post a list of the projects that do open and the ones that don't?

    Multiplayer Chat - example capx

    You mentioned that the Multiplayer Chat example capx crashes.

    I made a list of all the plugins it uses:

    [Plugin: Name]

    Browser : Browser

    TextBox: ChatLog

    TextBox: ChatTextBox

    Function: Function

    Button: JoinButton

    Keyboard: Keyboard

    Text: Label

    Multiplayer: Multiplayer

    TextBox: NameTextBox

    List: PeerList

    Button: SendButton

    Text: Title

    Button: ViewTutorial

    The plugins:

    Browser

    Button (Form control)

    Function

    Keyboard

    List (Form control)

    Multiplayer

    Text

    TextBox (Form control)

    IT may be that "form controls" are somehow causing a problem. They are not HTML canvas elements, unlike most other graphical pluggins.

    Other aspects of this example:

    • It doesn't use families.
    • It does use groups, and nested groups, and nested events.
    • In properties, it's physics engine is set to "Box2D web" (the other project you said sucessfully openened used "Box2D asm.js" instead). Perhapse C2 does something involving the selected physics library, when it loads a project.

    Web GL - example capx

    [Plugin: Name]

    Sprite: BackgroundSprite

    Sprite: CogSprite

    Mouse: Mouse

    Text: Text

    The plugins:

    Mouse

    Sprite

    Text

  • I just discovered something pretty weird about C2's Particles object.

    In some strangely specific circumstances, the particle images actually will rotate.

    Expected behavior:

    The native C2 Particles object, for rendering optimization reasons, doesn't provide rotation options for the particle image.

    So, if you rotate a layer, say 45 degrees, (e.g. to simulate camera rotation), with a Particles object on it, the particle images will not rotate with the layer, and will instead stay oriented upright to the monitor.

    Weird behavior:

    However, there is a weird case where they will rotate with the layer.

    If the Particles image dimensions are 256 x 256, and the Particles Size property is 256, and the layout is scaled up by any factor greater than 4 (e.g. 4.001), then the particle images will rotate with the layer, as if they were inheriting their orientation from it.

    This is the only case I've ever seen that causes Particle images to rotate.

    I suspect it may have something to do with the particle sprites being large enough that they can't entirely fit in the renderable canvas area. e.g. Using 512 x 512 images and a layout scale of 2.01 will also cause the layer-inherited rotation.

    Example Capx:

    https://www.dropbox.com/s/72r6sibcytwem ... .capx?dl=1

    In case anyone is interested. :)

    Steps to reproduce:

    Objects:

    Create a native C2 Particle object.

    Set it's image dimensions to 256 x 256.

    Draw a vertical bar for the image.

    Set the Particles "Size" property to 256.

    Create a simple tiles grid backdrop. (So it will be easier to see the layer's rotated orientation.)

    Add Mouse object. (Just need to use the buttons for interaction.)

    Events:

    At start of layout, Set layer angle to 45 degrees.

    On Click Left, Set layout scale to 4.1

    On Click Right, Set layout scale to 3.9

    Now preview the game, and click the left and right mouse buttons to see the particles alternate between un-rotated, and rotated.

    Any idea what's going on here?

  • Hey Ashley, just curious if you got a chance to take a look at this.

    I know you have a ton going on, so no worries either way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're the best, Ashley!

    That fixed it!

    Somehow the registry data representing the dialog's layout got a bit messed.

    I must have done something weird. I don't recall anything, but it might have been something like stretching it to max height, getting sidetracked, and then hot-key moving the whole application to a monitor with a smaller vertical resolution while the dialog was still open.

    I assume the dialog's data is somewhere in,

    HKEY_CURRENT_USER\Software\Scirra\Construct2\Dialogs

    I checked the registry before doing the restore, and exported the Quick Bar data, so I could restore my customizations after the reset.

    HKEY_CURRENT_USER\Software\Scirra\Construct2\BCGWorkspace

    (Quick Bar and other workspace stuff as far as I know.)

    After resetting, everything was restored to defaults, including the Quick Bar, and I was able to set that back to my custom configuration just by running the exported .reg file.

    I updated the topic name to indicate that it's solved, and wrote up instructions for resetting the dialogs, and optionally backing up the Quick Bar first.

    Thanks again.

  • Hey Ashley, I don't want to take up your time with something that may only affect one person, but if you have any quick thoughts or suggestions, I'm all ears. If not, no worries, I'll keep looking into it. If I figure out a solution I'll post back here.

  • [SOLVED]

    Fixing glitched dialogs

    Note: The solution will reset your Quick Bar (toolbar just under the ribbon).

    If you haven't customized the Quick Bar then just do the 2 steps below.

    If you want to be able to restore your Quick Bar customizations, see the "Backing up your Quick Bar" section first (farther below).

    1. From the main menu bar, choose File, then click the "Preferences" button.

    2. On the "General" tab, at the bottom click the "Reset dialogs" button.

    Done.

    Backing up your Quick Bar

    There are two ways to do this,

    Screenshots: Take screenshots of the items, and later restore them by hand.

    RegEdit: Use the windows Registry editor to export the relevant data, and later restore by clicking the exported ".reg" file.

    Screenshots

    1. Right click the Ribbon or Quick Bar, and choose "Customize Quick Access Toolbar..."

    2. Use Alt + Printscreen to capture the items in the list. (You may need to scroll.)

    3. Paste or save the resulting image(s) somewhere handy.

    4. Do the steps in the "Fixing glitched dialogs" section above, and then restore your customizations by recreating them.

    Done.

    RegEdit

    Important! Do NOT use this method unless you're comfortable editing the windows registry.

    Messing up the registry by accident can prevent your computer from booting.

    1: Open RegEdit, and navigate to:

    HKEY_CURRENT_USER\Software\Scirra\Construct2\BCGWorkspace

    2: Right click the "BCGWorkspace" folder icon, choose "Export", and save the .reg file to your desktop.

    3: Do the steps in the "Fixing glitched dialogs" section above, and then restore your customizations by double-clicking the exported .reg file.

    Done.

    [Original issue]

    Both the Condition and Action object browser windows suddenly became glitched.

    Any help or suggestions would be appreciated.

    Image & Description

    The browser area extends to the window-top, under the Info and Search elements.

    The bottom buttons are displaced upwards off the bottom panel area, and don't respond to clicks.

    I can't think of anything I've changed or done that would cause this.

    I couldn't find anyone else with this issue though, so it seems like it's probably something weird on my end.

    I'm at a loss for what's going on, and C2 is currently not really usable in this state.

    Ruled out

    It doesn't seem to affect any other windows in C2, nor any other windows in any other program.

    Hadn't updated C2, or graphics drivers.

    Hadn't updated windows as far as I know.

    Tried

    I've tried installing an older version of C2 that worked, but the problem persisted.

    Tried re-installing the current version of C2, but no luck.

    Both installs applied the built-in uninstall step of the installer, but I don't know how extensive that uninstall job is or what it affects.

    Perhaps there are elements I could manually uninstall that would resolve this.

    OS and Service Pack

    Win7 x64 - Pro

    SP1

    Construct 2 Version ID

    Release 247 (64- bit) checked

    Built at 13:33:48 on Sep 21 2017

    Release Notes

  • Problem Description

    Overview

    The native C2 save/load system appears to forget the "disabled collisions" state of Physics objects.

    After loading, all Physics collisions are enabled regardless of prior state.

    Details

    The Physics behavior has an option to "Disable Collisions" between objects, on an object-by-object basis.

    I'll refer to the data structure that stores that inter-object collision info, as the "collision relationships list".

    e.g. Given SpriteA, SpriteB, and SpriteC, you could disable collisions between only SpriteA and SpriteC.

    All other collision combinations would still occur normally.

    When using the native C2 save/load system, if you save, and then load, the Physics behavior's "collision relationships list" state is not restored.

    After loading, all collision relationships are set to enabled.

    Attach a Capx

    https://www.dropbox.com/s/jpvaro62rvj8t81/fi_demo_Physics_DisabledCollisionsForgottenOnSaveLoad.capx?dl=1

    Description of Capx

    Image of the capx.

    The capx shows a real-time interactive demo of the problem.

    There's text in the capx to explain steps to execute and what to look for.

    The capx shows two physics enabled sprite objects, a static (Immovable) Orange box, and a moving Blue box.

    The moving blue box is attracted to the Red "X" which drags it back and forth in a horizontal sine motion.

    On layout start, collisions between the blue mover box and orange static box are disabled.

    This allows the blue mover box to pass through the static orange box without colliding.

    At the bottom of the canvas are 5 buttons.

    • Save: Save game state via native C2 save/load system.
    • Load: Load game state via native C2 save/load system.
    • Set no-hit: Disables collisions between Mover & Static.
    • Restart: Restarts layout.
    • Toggle text: Show/Hide text.

    Steps to Reproduce Bug

    Run the capx.

    • Observe the blue box passing through the orange box without colliding. This is due to the event: On start, disable collisions between those objects.
    • Click the "Save" button, to save the game via C2's native save/load system.
    • Click the "Load" button, to load the last save state.
    • Observe the blue box now collides with the orange box. The disabled collision state has not been restored.

    You can optionally experiment a little further:

    • Click the "Set no-hit" button to re-disable collisions.
    • Observe, the boxes no longer collide.
    • Retry clicking the "Save" and then "Load" buttons.
    • The boxes now collide again.

    Observed Result

    The Physics behavior's "collision relationships list" is not restored after loading the game state, and so the boxes begin colliding with each other.

    Expected Result

    The "collision relationships list" is restored after loading the game state, the disabled collision status between the boxes is likewise restored. and so the boxes pass through each other without colliding.

    Affected Browsers

    • NW.js: YES
    • Chrome: YES
    • FireFox: YES
    • Opera: YES
    • Iron: YES
    • Internet Explorer: YES

    Operating System and Service Pack

    Win7 x64 - Pro

    SP1

    Construct 2 Version ID

    Release 247 (64- bit) checked

    Built at 13:33:48 on Sep 21 2017

    Release Notes