mone's Forum Posts

  • The method you suggest works.

    For my example, in fact, I took a cue from an inventory template I'm working on. But probably my example is wrong because I didn't think that with on drop the problem is solved.

    With my question basically I wanted to understand if it is true that the use of "Trigger once while true" (in a situation like the one in the example) is:

    1) absolute evil and is to be avoided always and in any case, otherwise I could commit a crime punishable with humiliation and torture by more capable programmers than me.

    2) they are just rumors and I can therefore simplify my life and use it if necessary without worrying too much that nothing breaks out.

    3) it is only a matter of elegance to be able not to use it, but if necessary even the good ones use it

    Anyway thanks for the answer Lionz, if it had been a real problem as always you would have guessed the solution even despite the problem explained wrongly.

  • Hi everyone, I have some doubts regarding the correct use of "trigger once while true" in a situation like the one in my example. Basically, if I am not mistaken, if I need to do something only once when an overlap occurs between two objects, I am forced to use "trigger once while true". Reading various posts on the forum, however, I seem to have understood that it is better not to use it.

    If I use method 1 instead of method 2, is that more correct? And how can I get the result of method 1 without using the collision as a trigger event, which in some cases (for example when my objects use solid behavior or physics) can create other problems that are more complex for me to solve? I would have managed all the logic with variables, but in this case I was unable to get the desired result as construct continues to execute the code indefinitely. I hope I have explained myself well despite the use of google translate.

    Thanks to all those who will participate in the discussion.

    Link to the Project: https://mega.nz/file/maRkyJzR#B0tjnsuupItCpxaaxd4VUN3OvPnwHa95_CxG7B3WY0s

  • Great Alextro, this is what I needed !!! The tag system is brilliant and I just wouldn't have known how to implement it ... Thanks again for your invaluable help!

    Thank you all!!!

  • I feel a bit stupid because either I still don't understand or I still don't explain myself well.

    When I run your example on my pc, nothing works as I expect. I try to make a video to show what I want to happen.

    https://mega.nz/file/rKJgnZKZ#MitDbHMVj1xT_RIIoE2uNtJfhAbP19_EQRdrd_ULzeY

    I apologize if I am not understanding something obvious, but unfortunately what you have suggested to me is not the behavior I expected ... or maybe what I want to achieve is not possible in construct 3?

    thanks for your help and your patience

  • I forgot ...

    the sprites circled in red are the ones I activated with the right mouse button. I first activated the one on the left, moving it among the other sprites everything worked correctly, then I activated the one on the right and now only this one works correctly, the other one has stopped making the adjacent sprites change color. How do I fix or get around this problem?

    Thanks again!

  • Thanks for the example but I think I have not yet explained myself well, I do not speak English and it is becoming an obstacle. I tried to redo the project by commenting on it in the hope that we can better understand what I need.

    https://mega.nz/file/2aoySLaC#neG8FESN6FnDWuAI3ooV6lRLY125dZVHU1Y5VZGwMPk

    Basically I need that any sprite that is activated has the ability to make the adjacent (inactive) sprites change color, this is because in a real situation it will be very easy to find multiple instances of the same object close together and I need to prevent the behavior from malfunctioning in case of several groups of nearby and / or active objects at the same time.

    This time I hope I was clearer, unfortunately my english comes completely from google translator so I know I might be misunderstood again. Anyway, thanks again for the help!

  • thanks for your help Alextro, I had tried this solution too, unfortunately it only works if I have only one active object.

    As you can see in the image I attached ...

    both are active ...

    but only one of the two works, among other things why does the one on the right and not the one on the left work? Certainly I am missing some fundamental concepts.

    the for each I used it like this...

    in the meantime, thanks again for your help

  • Anyone know how to fix this problem? Or do you know how I should redesign everything to make it work?

  • Hi, if I understand correctly you need this...

    even if it works, if you check the debug mode it goes that using the overlap the creation of new instances will continue until the overlap is stopped. To avoid this I recommend that you use the collision instead.

    The link to the project ...

    https://mega.nz/file/LCBFTCyA#ZU2_G18rg1nenEIgPhWd77vyrqTNcuTSEeJxfGaRWDc

    I hope I was helpful, I am a beginner too and I don't speak English, but if I can help I do it willingly. Hello and good luck.

  • Thanks for the answer and for the example, but it only works partially. My question was perhaps not well expressed.

    Your example works perfectly until I add a second pick condition, then, the active sprite changes its frame by updating it to the last available frame while it should keep the frame set as active (in this case frame 1).

    Another problem that remains is that in the case of two sprites active at the same time, the reaction of the other sprites becomes unpredictable, they do not always assume the frame indicated by the distance in pixels indicated by me in the pick condition and sometimes they do not react to the proximity to the active sprite.

    I hope I have better explained the problem now, otherwise I will try to make a video to show what I expect, in the meantime I am attaching an image of the modification I made and the problem that arises. Thanks again for the help.

  • Hi everyone, I have some problems in obtaining the expected result.

    In my project i have a family that contains an object, the family has a boolean variable called "active", how do I select all instances close to an object instance with the boolean active? I cannot simply reverse the control of the variable because I have multiple groups of instances close to each other and I have to select only those close to, for example 100px to the active object.

    Below I attach the images of the project.

    What I was hoping to achieve was that by approaching an active sprite to a sprite or a group of inactive sprites, the latter would set their variable ID_Aquired the UID with the UID value of the active sprite so that you could change the color only of the groups of sprites close to the active sprite. Currently the behavior occurs on the active sprite, but this is incorrect.

    Thanks to whoever will be able to help me and sorry for the English, I'm using google translate.

    Below is the link to the project.

    https://mega.nz/file/7KQCmbKS#i4c0MfY07Tiy-UUK_CgnY-fuvXDUj-Ofg5x8Sxmc1ew

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This way everything seems to work fine, thank you very much for your help.

    Below is the project and a screenshot to facilitate those interested.

    https://mega.nz/file/CDoFTa4b#Cy3eC9aMIToheGpzihBa7788NhFiBitviE4-5r27Kj8

  • I did some tests trying to follow Lionz's advice but clearly something is missing me so I can't put the advice into practice.

    How can I take advantage of the Timer behavior to avoid the continuous spawn of objects at each tick? without checking the attack variable i just don't know how to do it.

    I think I need an example to understand the concept because at the moment I'm confused.

    Below is the link to the modified project.

    https://mega.nz/file/WDBlxQaT#a5t2nxxd15RWK93IHu_IqyiJPs2J2cAK34oTMfovumg

  • thanks for your help lionz, now I'll try to understand what you suggested and put it into practice and then I'll update you.