fisholith's Recent Forum Activity

  • Thanks jayderyu,

    I'm actually familiar with the built-in iterator for the Dictionary. I'm not having a problem with the functionality. I just think I might have spotted a typo in the text describing the functionality.

    I've included some images below.

    You can also check for yourself by opening a new project, adding a Dictionary, and then adding the Dictionary's "Compare current value" condition to any event. The typo seems to be in the event block text for that condition.

    Walk-through:

    Another example where the confusing nature of the typo might be a little clearer.

  • Hi all,

    Is there a simple way to copy a family from one project to another?

    In the Project panel it doesn't look like you can drag families between projects, and since families don't have a physical presence on the layout there's nothing physical to copy.

    If I save the source and destination projects as project folders (instead of single files), would it be possible to move some kind of family file between projects without causing corruption?

  • I just noticed a possible problem with the Dictionary object's block text.

    When I add the condition "Compare current value", the resulting condition in the event block reads "Current key = ..." instead of "Current value = ..."

    That is, it says it's comparing a key, when it's really comparing a value.

    Does this happen for anyone else?

  • No problem, hope it works out.

  • How would I launch Node-Webkit, with a command line switch enabled, on OSX and or Linux?

    (I hope it's okay to ask this here.)

    My situation

    I have a game exported with Node-Webkit.

    If I launch Node-Webkit with the switch "--disable-threaded-compositing", the game runs perfectly.

    If I launch Node-Webkit without it, the game is essentially unplayable, with huge lag, and intermittent 1 to 10 second freezing.

    The .bat solution for Windows

    In Windows, I can make a "launchThyStuff.bat" file containing the line "gameName.exe --disable-threaded-compositing"

    How would I do the equivalent for OSX and Linux?

    Do I edit the exported files, by adding "--disable-threaded-compositing" somewhere?

    Do I create a special .bat-like file for OSX/Linux?

    I'm just not familiar enough with this kind of stuff when it comes to those operating systems, so any advice is very much appreciated.

  • Hey, trueicecold

    I did find one way that works but it's a little derpy.

    I tried a few things, so I can also tell you what doesn't work.

    Local variable - (does work, but kind of inelegant)

    Take the set of events you want to break out of, and put them under a blank event, just to carve out a local scope for your set of events.

    At the top of the event set, create a local variable like "b_break" = 0, and add the condition " b_break == 0" to each of the events in your event set. Now, if you set b_break to 1 anywhere in your event set, all the following events will be skipped.

    Stop loop - (doesn't work)

    Take the set of events you want to break out of, and put them under a For Loop that runs for 1 loop. Then use System > Stop loop. Unfortunately, all the remaining events will complete regardless of where you try to stop the loop. So, "stop loop" just prevents the next loop from running.

    Deactivate group - (doesn't work)

    Deactivating a group from inside the group has a very similar effect as stop loop. The rest of the events in the group will continue to execute as normal after the group has been deactivated. However, after deactivating the group, the "Group is active?" condition will test as false even if you're doing the test from within the now deactivated group.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No problem. Glad I could help.

  • Hey mariogamer,

    The layout size and window size are two separate things. (You may know this already so sorry if I'm misinterpreting the question.)

    The window size might have to change to fit different devices, but the layout size probably doesn't.

    If I recall, The layout size is only really relevant for behaviors like "destroy if outside layout", and for convenience while placing objects to make up your game world. As long as the layout is big enough for you to work comfortably, then you should be okay.

    For instance, I tend to set the layout size to be pretty large, and most of the time I don't use all of it. The only thing an end user will see is the part of the layout that shows up in the game's window.

    One of the other features of layout size that might be important, is that if you scroll your view around in your game, the game window will stop at the edge of the layout by default. You can free up the window to scroll off the edge of the layout by clicking the layout in the project panel, and in the layout's properties, you can enable "Unbounded scrolling".

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

    To play a sound at an inaudible volume (essentially silent), you'll probably want to use something like -60 dB or lower. Decibels (dB) are logarithmic units of volume, so "0 dB" is actually full volume, (100% original sound volume).

    Decibels are kind of a weird scale. And to make things weirder, computers use the dB scale differently than the way it's used to describe the loudness of sounds in the real world.

    Computer dB

    When dealing with computer audio, most programs use the convention that a sound's original (100%) volume is "0 dB", no matter what the sound is. Could be crinkling paper, could be a jackhammer, but on a computer 0 dB means play this sound file at 100% of whatever volume it was recorded at.

    Decibel scale

    When you *add* to a sound's dB level, you *scale* its power level up.

    When you *subtract* from a sound's dB level, you *scale* its power level down.

    (I say "power" rather than "loudness" because the human perception of audio signal power has its own non-linear issues.)

    Adding +10 dB to a 0 dB sound gives you the original sound power times 10.

    Adding +20 dB to a 0 dB sound gives you the original sound times 10, and then times another 10, for a total of times 100.

    Adding +30 dB to a sound yields 10 x 10 x 10, or 1000 times more power.

    And -30 db scales it down by 1000, making it 1/1000th the original power.

    So, playing a sound at -60 dB is playing it at 1/1,000,000th its normal volume, which is going to be silent enough. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    For more confusion, here's the wiki page for Decibels ... http://en.wikipedia.org/wiki/Decibel

    Preload sounds

    All that said, if you're looking to play all the sounds once to force them to preload, so that there's no delay the first time a user tries to play a note, then there's good news.

    As of one of the recent updates to Construct 2, a "Preload sounds" option was added to the project properties in the "Configuration Settings" section. This will automatically preload all sounds (not including sounds in the "music" folder).

    Playing all sounds once

    If you need to play every sound once, you could create an event "Start of layout", with an action "Play sound" at -60 db for each sound.

    Or, if your sound files are named with a fixed name followed by a number (e.g. "note00", "note01" , "note02", etc) then you could create a loop using the action "play sound by name", using the name [ "note" & zeropad( loopindex , 2 ) ].

    The zeropad() function will convert a number to a string with a fixed number of digits, such that leading zeros are used when the converted number isn't large enough to fill the fixed digit amount. e.g. zeropad( 77 , 5 ) = "00077"

    Hope that helps. Sorry for the long explanation of the dB scale. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • No problem

  • edit: Wow, I left the reply window open for a while, came back to type up a response, and when I submitted it, there were a bunch of other replies ahead of me all of a sudden.

    Not sure if I'm interpreting this correctly, but it sounds like you're asking how you can have a platform game character change to a special "edge wobble" animation when they are standing on the very edge of a drop-off, Sonic the Hedgehog style.

    For example...

    This can be done either with detector objects, or with the condition "is overlapping at offset".

    Detector objects

    You can have two objects that "hover" to either side of your character's feet, sitting just below ground level. If you walk over to an edge, one of the detector objects will no longer be overlapping the ground. You can use a condition to check for that and then switch to the edge wobble animation.

    Is overlapping at offset

    You can use the condition "is overlapping at offset", and specify an offset that would shift the character off the edge and slightly downward before checking for the overlap. If the the player is not overlapping any ground, then they are standing at the edge of a drop, and you can then switch to the edge wobble animation.

    Hope this helps.

  • This would scale up a 100 x 100 area of your game to fit the 400 x 400 window, meaning every game-world "pixel" would actually be a 4x4 block of screen pixels.

    The problems...

    Now, just zooming in will make everything bigger, but if we stop here, you'll also start getting blurry pixels, pixels that don't snap to the pixel grid, and even diagonal pixels if anything rotates.

    So, there are a few extra things you'll need to do...

    Setting up for pixel art retro games

    1: In the Project panel, in the tree view, click the root folder for your project.

    (Now in the Properties panel, you should see all the global properties for your project.)

    2: In the "Project settings" section, set "Pixel Rounding" to "On".

    3: In the "Configuration settings" section, set "Sampling" to "Point".

    That should fix the blur and pixel grid snapping, but not the object rotation or scaling issues. (I'll come back to this in a sec...)

    Point Sampling

    "Point Sampling" means that pixels will stay sharp when you zoom in on them, instead of fade smoothly into each other.

    Pixel Rounding

    "Pixel Rounding" means that objects are displayed as if they are always at integer coordinates. This means that an object with an X position of 99.8 will be displayed as if it were at X position 100. This keeps objects from drifting out of the pixel grid. This is really nice if you want to keep everything snapped to the pixel grid, but there's one catch; you can still misalign an object's pixels from the world's pixel grid by rotating or scaling the object.

    Pixelation post-processing

    I've run into this rotation and scaling issue in a few of the retro-style games I've made.

    (In fact, my member avatar is from one of them. At the moment, anyway.)

    I solve it by pixelating the game environment by the same value as my zoom factor. That is, if my zoom/scaling factor is 3, then I pixilate the game into a mesh of 3x3 pixel blocks. This ensures that anything that rotates off the grid is still converted into a single on-grid pixel with the correct pixel scale.

    You can pixelate the entire game by using WebGL effects.

    Hope that helps.

fisholith's avatar

fisholith

Member since 8 Aug, 2009

Twitter
fisholith has 2 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