ome6a1717's Recent Forum Activity

  • Fantastic - thanks guys!

  • Simple question - does STEAM accept C2-made games for their greenlight program?

  • Hey RamBam,

    Thanks a lot for looking into this. I don't use the beta version of construct, so I can't open your file. If you wouldn't mind, could you post an image of the code?

    Thanks!

    Steve

  • It's been done.

  • ome6a1717

    You only want the mana timer to start if mana is less than maximum, correct?

    If mana < manamaximum, subtract 1 from mana timer

    When mana timer reaches 0, add 1 to mana, set mana timer back to 4

    Event Conditions: 1) Every X Seconds, 2) Mana < Manamaximum

    Actions: subtract 1 from mana timer

    -- Sub-Event: Mana timer <= 0

    -- Actions: add 1 to mana, reset mana timer

    I hope that's clear. :) Sometimes explaining isn't as easy as doing. If you're still having trouble, I can do up a quick capx for you.

    Hey Space,

    This is exactly what I did, and it's entirely possible with my somewhat limited knowledge of C2 I AM, in fact, doing it wrong.

    However, when I do this code and set a text box as the mana timer (just to see the effect), when Mana < Manamaximum, the timer goes straight to 3 instead of waiting a second (will sometimes wait half a second, or 1 tick, etc. - depends on when mana < manamximum because the every X seconds is running no matter what).

    Hopefully I'm explaining this right?

  • Let's say , manamaximun = 5 and mana is a variable

    ...

    Every 4 seconds

    -- if mana < 5

    ---- Add 1 to mana

    Hmm...I tried this and it still doesn't work. It seems to run every 4 seconds no matter how you put it. Is there any other way to do this?

  • I should also add it doesn't ALWAYS work in Windows 7. Some of us have had issues with this, as well.

  • Hey SpaceApe,

    Thanks for the reply.

    I thought of that, but wouldn't this technically have the same issue? Once the Mana is less than 4, the CountDown variable would start to countdown, but instead of starting at 4, because it had a buffer it would immediately go to 3 seconds and THEN do every x seconds. It does help, but still doesn't fix it.

    Unless I'm wrong, which I could be :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there a way to restart the "every x second" count teach time an event occurs?

    ie:

    If Mana < ManaMaximum

    Every 4 seconds, Add 1 to Mana

    The problem with this is if mana = maximum, the 4 seconds are still counting, so on the next tick when mana is less than manamaximum, it adds one to mana immediately. Is there a line of code that can set if mana < manamaximum, count to 4 and THEN add 1 mana?

  • I believe the same thing would happen if you checked for variables first.

    Let me ask you guys this - what if you have TEN different events you want to take place when using the escape key?

    Would you use an else if command for every event?

  • Its not necessarily that it's incrementing, its just that I have a lot of events that use the same buttons, and trying to contain without creating a billion variables.

    ie. If you hit escape it brings the menu, but if the menu is up, it closes the menu, and if the menu is in the item menu, it goes BACK to the main menu, etc.

    So far I've been able to figure a way through everything, but I just wanted to make sure there wasn't some eureka line of code that would fix all that :)

    Thanks!

    Steve

  • So what would be the proper way to code something like that?

ome6a1717's avatar

ome6a1717

Member since 12 Feb, 2013

Twitter
ome6a1717 has 3 followers

Trophy Case

  • 11-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies