Yann's Forum Posts

  • Nope, the array object is just using indices and you can only have 3 dimension

    something like Array.At(3,5,1) you can't have strings as "index"

  • justifun

    Of course it's undefined

    If it were in javascript you would probably do something like

    myJSONData["data"][0][0][0]["Username"]

    So in the plugin it would translate as

    JSON.Value(0,"data",0,0,0,"Username")

    Ya need to tell the thing where to put the data from.

  • amitcv86

    You probably meant that the dropbox link wasn't working anymore.

    Now it should.

  • Wisdoms > convenience (like arranging various links inside the post for clarity) and habits =)

    And to solve the problem I would have to go through most of my post and convert the links to attachement... And as you said, I'm kind of laz... busy

  • Katala thanks... It seems I'm victim of my sucess v_v

  • rexrainbow

    Maybe a container behavior? so you could link any datastructure to families? I'd like to avoid forking my plugin into a behavior, since it's a pain to maintain two almost similar code base.

  • newt

    long time no troll \o/

    Otherwise int is the exact translation of the javascript parseInt function

    in chrome console:

    >  parseInt("33",10);
    <· 33
    

    parseInt("33xx",10);

    <· 33

    parseInt("xx33",10);

    <· NaN // which C2 doesn't allow and returns 0 instead[/code:3vaeyj07]

    But yeah, it should probably be more thorougly documented.

    in my opinion, javascript/c2 shouldn't allow for conversion of a non numeric string, java for instance throw an exception on "xx33" and "33xx".

    But that might be too hard/expensive to check...

    var cast = parseInt(input,10);
    input === ""+cast;[/code:3vaeyj07]would be too weak a check, since it wouldn't take into acount the case where input = "0033"  which would be a valid integer representation in my opinion.
    And a regex check like might be too much for just that.
    (Also, C2 doesn't have any error handling mecanisms...)
  • Ashley

    Well, as a general rule, I'm usually for exposing as much information as possible.

    Now for other use cases, I could imagine some people wanting to personalize the letterbox scale mode either by having other colors instead of black bars, or even some special images/background/animation/ads

    The scale outer could almost do the trick, but you need to know the original windows size set in the project if you want to emulate viewportRight/Bottom/Left/Top and Viewport Width/Height (here viewport means the playable area without the letterbox areas)

    Also, in some games, like infinite scrollers, I handle the scaling myself to fit any screen ratio (using crop mode, unbounded scrolling and tweaking layoutscale and scrolling by hand). Having the original window size allows for a more consistant "game-space" through the different ratios.

    Though, since I use unbounded scrolling, the size of the layout doesn't really matter anymore and I use those values instead.

  • Usually, if the world was a perfect place, the IDE, here Construct2, should take care of highlighting bad references.

    The problem is that Construct2's "IDE" have either an overly tight referencing of object and variables (so you can't temporarily write an expression without having all variables/objects involved already defined/created, where common IDE would just display a warning or an error) and a loose referencing over any properties accessed using strings (like animations, functions or layout names, no checkings done and no warning displayed, and I believe that's the reason why almost everything is case-insensitive in C2...).

    Few exceptions exists, like when you try to create a "disable group" event with the name of a group that doesn't exist, C2 will prevent you to do it (though I'd say it should allow it but display a warning), but if you later change the name of the group, nothing warns you.

    All that falls into the domain of modularity/refactoring feature C2 is sadly lacking (at least for now let's hope). If you want such features, you can try your hand on... dudum... classical programming :D

    For now, I would suggest you use a consistent naming convention throughout your entire code-base. I usually use a lot of camelCasing for everything. And families have the first letter uppercased.

  • Hi,

    Here's the problem:

    We currently have:

    • WindowWidth,WindowHeight being the size of the area used to display game: it's the screen-space available width and height (minus the size of the black bars in letterbox)
    • LayoutWidth, LayoutHeight: always equal to the layout sizes set in the project
    • ViewPortRight,Bottom,Left,Top: which allows us to get the projected width/height of each layer (how wide the viewport is, in layer-space coordinates)

    But, in all that, unless I missed something, we lose the windows size defined in the project.

    It can be a good information when we want to implement "manual" letterbox... (for instance in cocoonJS...)

  • Jaydon > yeah? what about it?

  • Hmmm ok, I see, thanks Ash

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    Yeah, I know it's by design, my point was that it shouldn't because you almost never want that to happen.

    spongehammer

    Can't reproduce what you described, be sure events are properly enabled/disabled by group

    If you see the explosion on start, it means the particles isn't destroyed, and if left clicking doesn't do anything, check if the left clicking event is properly enabled, and that you're not running with the chrome mobile emulator on. (don't have any more ideas :D)

  • Problem Description

    The "On Destroy" trigger is called on the object when on layout change.

    I can see situations where that would be usefull (like saving some enemies position, though a "On Layout Change" + foreach Enemies would be cleaner)

    But in general, you don't really want the "On Destroy" to trigger. Personnally I often use it to trigger special fx like explosion graphics and sounds.

    So if you implement an in game pause with an "Exit to Main Menu" button, you'll see and hear the fx when going back to the menu because of this "On Destroy"

    I would expect either:

    • the "On Destroy" to only happen when a destroy action is performed on the object,
    • or, to have the choice of the two behaviors with an extra parameter to "On Destroy". Like "On Destroy ignore layout change (yes/no)"

    Also, the current behavior is a bit inconsistent since it happens on layout change but not on layout restart, though I'd expect the object to be destroyed and recreated.

    Attach a Capx

    UnWantedOnDestroyChangingLayout.capx

    Description of Capx

    Start the preview and just left click to change layout. You'll se the explosion generated by the destruction of the Sprite.

    To see the expected result, disable the "Problem" group and enable the "Work Around" group

    Steps to Reproduce Bug

    See capx

    Observed Result

    The explosion is played on Layout 2

    Expected Result

    Nothing should happen on Layout 2

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    r178

  • Yeah so do I, it might be some shaddy configuration switch like "tolerate windows back slash" or something

    But yeah, forward should be used anyway.

    Thanks (: