oosyrag's Forum Posts

  • An Ajax request can take a URL, as long as it is on the same domain.

    https://www.scirra.com/manual/107/ajax

  • There are other ways to do loops over time... I just would just use an incrementing counter and/or every x seconds instead of the loop condition. I can make an example for you when I get back to a computer.

    Also I tend to avoid the wait action as much as I can, as it is a special case and breaks the normal flow. It has it's uses in the proper situations though.

  • Assuming your range indicator is a circle with diameter the same width of the sprite... your range, or distance from the tower to the edge of the circle, would be the radius of the circle - half the diameter. So set the width and height of the range indicator to 2*range and center it on your tower.

  • Your problem currently is using the "Wait" action, which basically breaks the normal flow of the event sheet.

    A loop will run to completion in one frame.

    A wait action will basically take what remains of the actions after it out of the current flow of events, and complete them at a later time.

    In your loop, there are no actions after your wait, so nothing happens. All four instances of your sound get played in the same frame.

    If you use waits, it is best to have all your actions in one event rather than a loop.

  • Try the manual entry.

    https://www.scirra.com/manual/149/function

    [quote:26dg0304]Returning values from functions

    Functions can also return a result. For example, a factorial function could calculate the mathematical result and return it. In an On function event, the return value can be set using the Set return value action.

    If the event was called using the Call function action, the returned value is afterwards available using the ReturnValue expression. Functions can also be called directly from an expression using the Call expression; in this case the return value is automatically returned as the result of the Call expression.

    And in case you are not familiar with what an expression is: https://www.scirra.com/manual/78/expressions

  • Also you may want to use "On A pressed" instead "A is down", otherwise it will switch between the two every tick as long as you have A held down.

  • Add the condition "layer is visible" to the relevant events.

  • Loops should run to completion before the next frame is rendered, as far as I know. Not completely sure if functions have a special timing for when they are run, I assume the function just gets inserted wherever it was called.

  • Getting right into advanced array usage <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    https://www.dropbox.com/s/pwiwps06mn7pn ... .capx?dl=0

    I've updated your capx with comments, let me know if there is anything you don't understand. The key points are that we want the cursor to follow the object based on its UID only instead of its position in the array (since that can change now chage), and also to update the CurrentSelection when the UID is in the "wrong" place after it's position in the array moves.

    I've also modified a few events to make them more compact, again with comments. Also want to emphasize there is nothing wrong with having more events - doing so can make a project more readable and easier to understand, especially if you were the one that put them together.

  • Only the "Wait" actions will allow events to complete out of order.

    https://www.scirra.com/tutorials/56/how ... ait-action

    To keep an event with "Wait" in it from activating every tick, add a "state flag"(a variable) that you check as a condition. Upon running the event, toggle the state flag to active, and after the wait action, toggle it back to finished. Have the event only run on the condition that the state is finished.

  • Wow ng.io has a pretty fantastic feature set. Thanks for these plugins! Time to experiment to see how best to use...

  • Thanks armaldio, I have no experience creating plugins or working with JS directly, but I guess I can look into it.

    Are there any other ways to get time from a third party server rather than local system time?

  • Usually you can put all your input triggers in a group and enable/disable the group as you pause and unpause.

  • You need conditions to "pick" the instances your actions are applied to. By clicking greenf, you pick that greenf but bluef is not specified, so when you destroy bluef all instances of bluef are destroyed.

    You can add an additional condition bluef is overlapping greenf to pick the correct one to destroy.

    But in this case, it sounds like you should be using containers instead of families.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The event with Else will only run if the previous event did not run. Very useful for toggles.

    Invert is usually for picking like usual.

    For example, if you had is overlapping, and inverted is not overlapping, both these will run and the relevant actions applied to the objects that are or are not overlapping.

    If you had overlapping, then else, the else event would only run if nothing was overlapping. If anything was overlapping, the else event would not run.