ID based doors and switchs.

This forum is currently in read-only mode.
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • DoorID and SwitchID should be tie together as well as the color of the switch. So, Blue SwitchID (1) shold open Blue DoorID (1), Blue SwitchID (2) shold open Blue DoorID (2), Blue SwitchID (3) shold open Blue DoorID (3), and so on.

    However, it doesn't appear to work. I tired a For Each and Containers, non of which seems to work. It worsk for the first two, but not the others.

    http://www.mediafire.com/?r5lhjth2smjcwa4

  • A few things in your cap seem a little long-winded. It's best in my opinion to use the function object, define clear functions like "Open Door" and call them passing the according parameters. That way you'll end up with a very clean setup.

    To fix your cap quickly, you could just merge events 2 and 3 of the gimmicks sheet into one event that makes more sense. Basically it would look like this:

    <img src="http://dl.dropbox.com/u/2306601/switchy.png">

    Now there shouldn't be any more picking confusion and the right doors will open.

    Other than that I noticed you move your doors by simply adding +X to the position, without applying Timedelta. This will result in different door opening speed on different systems. You don't want that.

    Also instead of comparing the animation frame paired with a trigger once condition, you could just use the "On any animation finished" condition. In theory it's better in case there are multiple doors on the same frame at the same time. Don't forget to uncheck the loop property of the animations for this to work.

    A word of advice on a different matter: if you want people to look into your cap, try to get rid of custom plugins/effects if they're not necessary for the problem at hand. Or at the very least mention and link the custom plugins needed to open your cap.

  • Wouldn't timedelta make things slower?

  • Time scale make things slower (or faster). With timedelta, things moving at the same speed, even at lower framerates. Just search "timedelta", its already explained, how it works.

    edit:

    scroll down to Tulamides post.

  • Wouldn't timedelta make things slower?

    Azu.... come one man!

    You've been a member since 2007, I think it's time to learn what timeDelta does and how to use it

  • I tired it and I really don't like it. I tired Door.Y-0.25*timedelta and it move super slow, like 0.25 every second. I had to do like Door.Y-100*timedelta. I'm not use to using big numbers. I really know nothing about timedelta because I never used it.

  • I tired it and I really don't like it. I tired Door.Y-0.25*timedelta and it move super slow, like 0.25 every second. I had to do like Door.Y-100*timedelta. I'm not use to using big numbers. I really know nothing about timedelta because I never used it.

    0.25*Timedelta means it moves 0.25 pixels every second. Yes, that would be quite slow. And 100*Timedelta means that the object would move 100 pixels per second on that speed. It's just a matter of thinking in pixels per second when it comes to movement speed I guess.

    There's also a nice little example on the We Construct blog, which deals with TimeDelta to create a custom timer. Maybe that will help you understand. Also it's never the wrong idea to revisit the wiki article.

  • I tired it and I really don't like it. I tired Door.Y-0.25*timedelta and it move super slow, like 0.25 every second. I had to do like Door.Y-100*timedelta. I'm not use to using big numbers. I really know nothing about timedelta because I never used it.

    No, no, use Door.Y-(100*timedelta).

  • No, no, use Door.Y-(100*timedelta).

    I may misunderstand this, but if you mean the parentheses I should say that they are not needed in the example. Construct follows the mathematical rules of order for arithmetic operations. Multiplication and division has higher priority than addition and substraction.

    Door.Y - 100 * TimeDelta

    Door.Y - TimeDelta * 100

    Door.Y - (100 * TimeDelta)

    All three do exactly the same. First multiplying 100 with TimeDelta (or TimeDelta with 100, which doesn't make a difference in multiplication), then substracting the result from Door.Y.

    I tired it and I really don't like it. I tired Door.Y-0.25*timedelta and it move super slow, like 0.25 every second. I had to do like Door.Y-100*timedelta. I'm not use to using big numbers. I really know nothing about timedelta because I never used it.

    Like PixelRebirth said, don't think in fractions but in the resulting period. If you aim for your game to run at 60 fps and add 1 pixel per frame, then the effective pixel rate is 60 * 1 = 60 pixels per second. And value * TimeDelta simply means "that much of value per second" (and Construct cares about how much of that needs to be used per frame). So, when your game would run constantly with 60 fps, then

    +Always
    -> Set x to x + 1[/code:3tmazibc]
    and
    [code:3tmazibc]+ Always
    -> Set x to x + 60 * TimeDelta[/code:3tmazibc]
    do the same. But if the framerate changes, then the second event makes sure, the speed is still constant 60 pixel per second.
    
    TimeDelta is a number that expresses the time passed between the current and the last tick. On a system where there is constant 60 fps, TimeDelta will be 1/60 (or 0.016p) on every tick. Now multiply 60 with 0.016p. Yeah, it's 1, just as wanted and expected.
    
    Of course, TimeDelta serves as an indicator for all changes and hickups in the framerate, not only a constant change. And that's what makes it so flexible and guarantees a constant line of whatever you need (movement, speed, rotation, color fade, etc.) over time, by using higher or lower portions per frame to compensate.
  • Whoops. Well then, good to know!

  • I'm use to Pixel Per Frame rather Pixel Per Second.

  • i don't like using timedelta, it messes with my need for perfectionism.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i don't like using timedelta, it messes with my need for perfectionism.

    Don't confuse the guy Quazi. TimeDelta is important unless you really, really know what you're doing. You're expert enough that you can work around it with advanced methods to get beyond it's limitations.

    But for the rest of us who aren't that advanced, and for about 95% of everything we would need to do, timeDelta is the way to do it. It's a very important tool to learn, and you really should learn it before you can safely gauge whether or not you will need it for any particular task.

    My advice to Azu:

    Set down your game for an hour or two and mess around with timeDelta in a fresh .cap. Move some boxes around. Make some timers. That sort of thing. Once you get used to thinking in pixels per second instead of pixels per tick, it's not so hard at all.

    And with your new mad skillz you will be one step closer to being a Construct Champ that gets all the ladies*

    *(Individual results may vary)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)