99Instances2Go's Forum Posts

  • Wait 0 = happens at the end of the tick that ran that wait.

    Any wait/delay escapes the scope of the function. Cant start a start time consuming task and return the result of it inside the same function. Unless you prolong the tick.

    A time consuming loop stays in the function. The tick just gets longer.

    But you can not use triggers inside a loop.

    And when the loop is running it will not (multitask) do anything else.

    So pretty useless for you. I think (but i am not the smartest) that you need another way.

  • Do you have the platform behavior attached to both ? To box & animation ?

  • Out of scope it cant return a value. The wait brings things out of scope.

    If its not a Ajax request, then what else would take time to complete inside the function ?

  • That is a known issue. Updating the collission polygones means for the Physics engine a totaly new object every tick. Hence it runs out of memory. I saw in C3 that the error is knda solved, but that Physics dont work on a object with a scale sine attached.

    You can use this exellent engine.

    R0J0hound posted somewhere a workarround, i think it was something like dissable physics, then scale, then enable physcis. But i cant find it no more.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you scale a sprite with Physics attached in some way ? Using sine perhaps ?

  • You can see the array in the debugger.

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

  • the Mnk

    You have been wrestling with those triggers quite some times.

    Can i explain it better ? Tell me what you find complicated ? Or is it my sucky english ?

  • VectorY is in pixels/seconds. Every where you see 'second' it is already dt corrected. Like every 3 seconds, also dt corrected.

    &

    Say you want to jump max twice in height ... then body.jump_strength_bonus cant be bigger then 2

  • Change on key pressed' to 'key is down' ... add 'once while true' to the same event.

    Why ?

    'on key down' is a trigger. It fires, and then the rest of the events is executed.

    So, after firing that trigger, 'it' looks up if it can execute its actions. So, it goes up, meets the Group, is the group active, then the trigger is allowed to run its actions.

    After that, 'it' starts with executing top-down. First the group (is it active or not), then resets the local var to zero, then checks if the local is 1.

    'key is down' is not a trigger, it stays at its place in the top-down run list.

    (making the var static is not a solution if you want to var to reset)

  • You dont event need an array, you know.

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

  • I suppose you mean by 'coordinates' floor and room, not x and y.

    There are only 4 floors and 2 rooms, total 8 possibility's. Can as well create them all 8 at once, in 2 little nested loops.

    Give them an id, floor and room instance variable, and pick them randomly.

    I dont understand your code.

    Example: '&' means for strings what '+' means for numbers. '&' combines strings (ads a string tot a string). "a"&"b"="ab"

    You never stored floor&room in the array, so you will not find it in there too.

    You add 1 to guest number, even if that was an illegal combination.

  • That 'signal thing' works this way.

    User pressed button <--- root event

    _____ request Ajax data with tag "user id"

    _____ Wait for signal tag "user id" <----- actions that come after are postponed until the signal (WITH THE RIGHT TAG) is given

    _____ display result to user

    _____ delete dictionary key

    Ajax > On any completed <----- root event

    _____ do stuff with the last data, store the result in a dictionary with key "user id" and value result

    _____ signal with tag "user id" <---- run the postponed actions

  • combo is always < 6,

    because combo is always zero under the same conditions (when sprite 4 overlaps sprite 3)

    i said that already, no ?

    suggestions? well, dont make it always zero, dont ask me how, i dont understand your logic at all, only you do

    you do something like ....

    If you press my button (event 18)

    and If you talk to me

    ____ i take your all your money

    and a few lines later

    If you press my button (event 25)

    and If you talk to me

    and if you have less then 6 dollars

    ____ i kick your ass

    and

    If you press my button (event 26)

    and If you talk to me

    and if you have more then 6 dollars

    ____ kick my ass

    I never get to kick your ass, u dont see that ?

  • If i read you the right way, then the function is not the problem.

    It should not be too. Because functions act as they are 'in place'. Replace the 'function call' with the contents of the 'on function' and nothing is changing. Read 'as in place'.

    The problem is the way you use Ajax (educated gamble).

    If this is what happens .....

    On function (sync group)

    ____ Get ajax data

    ____ Set something to last Ajax data

    ____ Bunch of actions dealing with the data

    On function (UI group)

    ____ Get ajax data

    ____ Set something to last Ajax data

    ____ Bunch of actions dealing with the data

    Then... As you stated, getting Ajax data is not instantly. It takes time.

    So, the last Ajax data are for sure not ready to use in the scope of this function call.

    At some time, one of those functions is called again, and there will be data from some previous request data action.

    From which request action is totally not known, and cant be known, that way.

    It is obvious not the way to use Ajax. To avoid asynchronous blending, the Ajax requests are paired up with a tag.

    To know which data are in the last data, and to know when the data are ready to use, you have the condition 'On completed (tag)'.

    Or 'On any completed' , and the expression Ajax.tag is returning the tag.

    I suggest to call the function, request data in the 'on function' with a tag "sync" or "UI".

    Have a root event 'On any completed'

    Have a sub with a compare 2 values. Compare Ajax.tag to "sync"

    Set something to last data and do the stuff that belongs to "sync"

    Use 'else' or a compare for "UI"

    Set something to last data and do the stuff that belongs to "UI"

    That would be the basic stuff. But now, those darn users could be multitasking. And you dont know which "UI" stuff belongs to which 'user call'.

    Well, user needs to be identified. By example. Give each user an array. Give the array a instance variable with a value that is unique for that user, so you can pick it easy.

    Now call the "UI" function with a parameter holding that user id.

    Request Ajax data with a tag "UI"&"/"&user id

    If you now use the 'On any completed' as a root.

    then compare 2 values ... tokenat(Ajax.tag,0,"/") = "UI"

    then pick array with instance variable 'id' = tokenat(Ajax.tag,1,"/")

    ____ store the last data in that array

    ____ do stuff with the data all you want

    ____ update the information to the user straight a head, or 'signal' the postponed action by a 'wait for signal' right after the function call made by the user

    Hope that makes sense to you.

  • Something close to what you want to do. Straightforward. I think all basics are in here. This is just an example, no more. States are all done with booleans. I should have used Global variables, instead of that brain, thats what i learned out of this.

    The rest you should be able to manage from you own briefing above.

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