ome6a1717's Forum Posts

  • 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 :)

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

  • I know the general differences between key down and key pressed, but I'm curious as to the reason why something like this wouldn't work:

    If VARIABLE = 0,

    On 1 pressed, set VARIABLE to 1   

    If VARIABLE = 1,

    On 1 pressed, set VARIABLE to 2

    The VARIABLE goes straight to 2. Can anyone explain why this happens, and if it can be averted through on 1 DOWN (and if so, why that is)?

  • I figured it out, but am still having an issue. I had to set the BadGuy is X Frozen as a sub-event. The only issue now is it still effects every instance. Isn't this the point of instance variables? Or am I still doing it wrong?

  • I've been trying to fix this for almost an hour now.

    <img src="http://stevemazzaro.com/instancevariable.png" border="0" />

    As you see in the picture, I'm trying to make the enemy stop the "ChasePlayer" function when the BadGuy instance variable "Frozen" is set to false.

    The weird thing is, if I revert the X Frozen to "BadGuy is Frozen", it works (just the opposite of what I want and still affects all BadGuy instances).

    Is this a bug, or am I missing something?

    I've also used a global variable to test it, and the global variable worked (but stops every BadGuy instead of the one that it hit). On top of that, I've created a text box to see if the collision is changing the instance variable, and it IS changing, but the target is still chasing the player regardless.

    Any help would be greatly appreciated.

    Thanks!

    Steve

  • Just something to be aware of - we've determined that the Browser > Close function does not always work with the node-kit exporter. It will sometimes close it, but will most of the time crash the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're right - I can't believe I missed this. You can't use a function while utilizing instance variables :).

    Much appreciated!

  • Just bumping this post - I've been trying different methods and nothing seems to be working. None of the other pick instance threads seem to cover this, either.

    The best way to put what I'm trying to achieve is to create a bunch of instances of 1 object and control them as if they were all separate objects (without having to make separate objects).

    Is this perhaps not possible?

  • Windows 7 here.

  • I've read every forum and tutorial I could find on the matter, but I cannot figure out how to pick specific instances of a single sprite object.

    I've created a variable instance called "Instance" for each object instance and set a specific number to each for recall. But when I do a command such as "If Sprite's "Instance" = 1, do this ; If Sprite's "Instance" = 2, do this", it does the same thing for all instances.

    Any idea why this is happening?

  • Try changing "every tick - subtract 1 to seconds" to "every "1" second - subtract 1 to seconds".