fisholith's Recent Forum Activity

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

  • 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

  • Hey evillair, <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Just an interesting note...

    It might be worth looking at the "Delaunay Triangulation".

    It's probably overkill for what you're building, and it specifically produces a mesh of triangles which is a bit stricter than what you require, but it has some nice properties.

    The Delaunay Triangulation does a good job of connecting nearby points without creating sliver triangles.

    It's the dual graph of the voronoi graph.

    If you're familiar with voronoi patterns, for the Delaunay Triangulation, you get the center points of the voronoi cells, and create links between points in bordering cells.

    Boris Delaunay, who came up with this Triangulation solution, worked on this back in the 30s. He also climbed mountains, and somewhere there's one named after him. I don't know much else about him, so I can only assume he lived as hard as he mathed.

    Here's a visual animation of a Delaunay Triangulation algorithm working on a set of random points.

    Subscribe to Construct videos now
  • Q1: When I save data via the Local Storage plugin, is it stored in a human readable format?

    For example, if I save the current level the player is on via Local Storage,

    say key "level" = value "3",

    is there now a file somewhere that, you can open in a text editor, and see a line like "level = 3"?

    Q2: Regarding human readability, Is there a difference between using Local Storage from a browser, vs a desktop (NW.js) platform.

    I've found what I think is the location Local Storage data would go (for NW.js at least),

    "%AppData%\Local\<GameName>\Cache",

    but what I see is a bunch of hashilly-named files most of which are 1KB.

    None of it looks human readable, but I don't know if I'm looking in the right place.

    I'm just going by a comment Ashley made in another post.

    Any help is appreciated. :)

  • That is super helpful rexrainbow, thanks!

    Looking at the pin behavior is a great suggestion.

    I'm happy to hear there's an "afterLoad()" function, because I was wondering how to set up connections to things that might not be loaded yet.

  • What's the best way to serialize an array of references to C2 object instances?

    Overview

    I have a third-party behavior, that holds an array of references to C2 object instances. (These references are gotten from the SOL.)

    This array is part of the behavior's internal state, with "this.references" being declared in the onCreate() function.

    To get this behavior to cooperate with C2's native Save/Load state feature, I need to be able to save and load the behavior's internal state, using the saveToJSON() and loadFromJSON() functions.

    The saveToJSON() returns an object to be serialized via JSON.stringify(), I think.

    I think that JSON.stringify(), if given an array of C2 object refs, will try to serialize the entirety of each C2 object referenced. This causes a "Circular structure error", and isn't what I need to do anyway.

    I don't want to serialize C2 objects, as all I need to save are the references to those objects.

    Maybe I can get the UIDs of the referenced objects, and save those.

    Then I can rebuild the correct references upon loading by looking up object instances by the saved UIDs.

    Does anyone have advice on serializing an array of C2 object instances?

    Any thoughts or sugestions are welcome.

    Specific case

    Finally, the specific behavior I'm trying to extend is Azis's "Store Reference" behavior:

    I've already found and fixed some other problems with this behavior, but I just recently noticed it has no Save/Load support built in.

    It's a nice idea for a behavior, but I'm just about at the point of replacing it with native UID-based events, since I know I won't have to fix anything else in the future if I just stick to event sheets.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for letting me know ,

    I fixed the links.

    This is the updated bundle.

    Themes Bundle - Fisholith Themes v2.zip

    It also includes some notes on choosing and setting C2 "Styles", which are different from "Themes".

    Example of choosing a Style

    Styles - what are they?

    Styles vs Themes

    "Styles" are different from "Themes".

    Themes mainly set colors for event sheets. (You can edit them with my Theme Editor, or in C2's properties.)

    Styles set the colors for the overall user interface, like scrollbars, and panels. (Style colors aren't editable.)

    Choosing a Style

    1. On the ribbon, choose the "View" tab.

    2. Click the "Style" button (with the brush icon), and from the drop menu, choose a style.

    (Note: The default style is found under "Office styles" > "Office 2010 Silver".)

    The 3 notable Styles

    • Office 2010 Silver - This is the default theme for C2.
    • Visual studio 2012 Dark - Good for dark themes.
    • Carbon - Not as dark as 2012 Dark, but it's the only other Style with a dark background.

    Tip: If you use a dark Theme, then also change the Style to "Visual studio 2012 Dark",

    so you don't have bright white panels right beside the dark event sheet.

    Style Limitations

    C2 comes with some pre-built Styles to choose from, but you can't edit their colors.

    This is because Styles are developed by Microsoft, and embedded across a mixture of DLLs and system files.

    The 3 important styles

    Dark Styles are important because they can be paired with dark Themes.

    All styles for comparison

  • After exporting via NW.js, what is the propper way to rename the executable files in the Linux & OSX folders, so they show the name of my game instead of just "nw"?

    For example, I know that in the exported Windows folders (win32 & win64), I can rename the "nw.exe" to "My Game.exe".

    What would I do in the Linux & OSX folders to equivalently replace the default export name with the actual name of my game?

    For example, in the Linux64 folder, if I change the name of the "nw" file to "My Game", would that work, or would it break something that's expecting the file to be named "nw"?

    Any insight or suggestions are welcome.

  • Thanks for letting me know redfoc,

    I just updated the link, so it should work now.

fisholith's avatar

fisholith

Member since 8 Aug, 2009

Twitter
fisholith has 1 followers

Connect with fisholith

Trophy Case

  • 15-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies