99Instances2Go's Forum Posts

  • Concept behind mine is ...

    I used 4 helper objects, to check for overlaps. The reason why i use helper objects is that checking overlaps with the same instances of an object is a bit tricky. Should use families. oosyrag did not use a family, so i was like, wth, i not gooing to do it too.

    Those helper objects (hor1 hor2 ver1 & ver2) have there origins set in a way that they overlap the questioned object and the object on the left, the right, on top and under. When i was dooing this, i found out that i dont need the 'under' for defining a rule, but i left it in there.

    Now, when you place an object over other objects. And when you pick all objects that overlap that placed object, the expression object.PickedCount gives you the amount of objects that are overlapped. Including the questioned object.

    So, in short, when i place the 4 helpers objects (in the for each loop) on the questioned object, i can according to how many objects this helper overlaps, make rules. And for this concept, there are only 2 rules needed, as you can see in the capx.

    oosyrag does kinda the same, he is using the cornerobjects to dedect overlaps. So he's also not checking overlaps between instances of the same object, wich is as i said very tricky.

    I was a bit suprised by his solution, but i did not understand his rules.

    So i had to find them out, stronger then myself. But i am old school. So i need to see what i am dooing. And helper objects i can see. Now, at this moment, i know the rules, i could translate the idea to an array, or translate it to a loop in a tilemap, if i wanted to. But in the end, what i have given to you is for me the first step in solving things .. see what i do. I often use the tick-top-down-loop first, before making the real loop. Because that way i see, tick by tick, what i do. How it works, or actualy dont work at all. If it works, i bring it in the real loop.

  • Bring the solids in 1 family ?

  • AllanR You seem very comfartable with regex expressions. Point me to a place to learn them ?

  • Sometimes it helps when you make those events in a differend order.

    Say .. have ....

    if x = 1

    set x to 2

    if x = 2

    set x to 3

    if x = 3

    set x to 4

    The first event makes the second true. As a result they will run all. A chain of elses is the best option, but it can also very easy.

    if x = 3

    set x to 4

    if x = 2

    set x to 3

    if x = 1

    set x to 2

    Now they do not make each other true, when executed top down.

  • Yes that is possible.

    The Pathfinding behavior has the Expressions

    NodeXAt

    NodeYAt

    Return the position of a node in the path that was found, in layout co-ordinates, using the zero-based index of the node. This is only available after On path found.

    And

    NodeCount

    The number of nodes in the path that was found. This is only updated after On path found.

    So, with NodeCount you know how many waypoints are in a path. If you want the coordinateds from point 2.

    That is NodeXAt(2) & NodeYAt(2)

    Now, to move to them is another story.

    I would use .

    Why? because (i did not try this one, but all rexrainbow 's plugins have the same great features) it has a condtion 'On arrived'. Wich is pretty easy and lovable.

    So, your objects need a instance variable that knows wich node they are supposed to go to.

    Add 1to that variable when it arrives. NodeCount tells you wich is the last one.

    Send it moving to NodeXAt(instance variable) & NodeYAt(instance variable)

  • You have this 'away' timer in place. It tells you how long the game has been offline.

    It actual tells you also how long the game is running.

    Just set a variable to round(TimeAwayL.ElapsedTime("away")), but this time only once and when it is zero (first start). The difference between the actual round(TimeAwayL.ElapsedTime("away")) and that variable = the online time.

    Now the total time is just = TotalTime + that variabele (online time). TotalTime = zero for first run. The offline time (you have that one allready in place), we handle once on getting from the local storage.

    You have to store total time in the local storage.

    24 hours is 86400 seconds. (if i count right) So, its the same thing as you do allready with your build time.

    So on TotalTime getting from the local storage.

    TotalTime = TotalTime + away time (away time has to been get allready)

    round(TotalTime /86400) gives you the amount of times this total time passed 24h.

    If its bigger then 1 do the random thing

    set TotalTime to (TotalTime) - (round((TotalTime /86400) * 86400), this sets the total time to the remaining second left to complete again a 24 hours cycle.

    Say your total time is 216000... round(216000/86400) gives you 2 (2.5 rounded) ... means there are 2 times 24 h passed. Now there is still .5 times 24 hours left, and have to start from there for the new cycle. (TotalTime) - (round((TotalTime /86400) * 86400) gives you what is left.

    Now the total time is just = TotalTime + that variabele (online time) again.

    You do the same with buildtime, where you have to use ceil instead of round, because it is zero based.

  • Well i am not a specialist at all, and certainly not in js codes. But i dont think that will help you. At the moment you close the iFrame, the inserted construct code is gone. I think. And you cant change the page that is embedding your code.

    Did you try the conditions in the browser plugin ? No luck ?

    On resized

    Page is visible

    On suspended

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Bring the 'is playing' from event 21 to event 17.

    Are sprint, walk, crawl and idle really playing ?

  • oosyrag, (without families, took your capx) I think this are the rules.

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

  • No solutions, since i have no darn idea what you are up to. Just ideas 4 you. How to use animation triggers, functions and an array.

    In this one only the oldest created can be destroyed. Creation happens kinda random when clicked on an empty position. Newly created groups can be destroyed when it is their turn to be the oldest group.

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

    It's not sorting many objects, nor rearranging them, it just sorts a GroupId. And picks according.

  • The "on exist" triggers every tick, everything got calculated every tick. Because those things just are in the Local Storage = true.

    I should have used ceil(), my error, forgot you made it zero based.

    That 10 seconds trigger did things wrong, if the local storage returns a build time like 7 seconds (3 of 10 done previous time) it still took 10 seonds in stead of 7.

    Hope i corrected everything in this, else yell.

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

  • You can use one of those noise plugins too.

    plugin-noisejs_t93998

    http://c2rexplugins.weebly.com/rex_noisejsmod.html

  • Can't you stop the audio based on where the mouse is ? (corner). I know you can't do this based on touch.

  • Wich site is it running ? I cant visualize it. Is it a close button from the site itself ? Is that 'thing' always on the same place (mouse wise) ? Can i see this site ?

  • edit:

    that was the same answer as previous