WRS's Recent Forum Activity

  • Here's my example of the objects acting independently with LOS, check it out see if it helps. dropbox.com/sh/be0cumtbjy9bx9h/AAB2HSgzGL9ciuxfYj3PWpNxa

    Yes! Thank you so much! You saved me! I spent 2 days on this simple code)))) This is exactly what is needed)

    ---

    But I have some kind of mistake when I built it at my place. It works always only in the first copy.

  • if you have a stationary npc, that needs to be in screen u can also make a boolean and say

    player on collision with object1

    if object1 boolean is false

    do action

    set boolean to true.

    that would make the object1 stop looping the creation.

    the boolean can be either a instance boolean, or a number that u set to 0 or 1 or a text variable

    I have 5 copies of the object on the screen at once, they interact with the player using the "field of view" behavior and as soon as any nearest copy notices the player, that is, the player enters the interaction zone, all 5 copies immediately begin performing the action.

  • >

    in that case you need to destroy object when collision is happening, or disable collisions once the player collides with it.

    please see my above reply i edited and added a few example pseudo-codes.

    Thank you, now I will try your example)

  • >

    in that case you need to destroy object when collision is happening, or disable collisions once the player collides with it.

    please see my above reply i edited and added a few example pseudo-codes.

    Yes, but I cannot destroy it, that is, I need this object to be, for example, as "NPS" only in my case, these are 5 identical "NPS" and not different.

  • > Imagine that we first have a Player then after 10 meters Object 1 and after 20 meters Object 1 (copy)

    >

    > When the Player approaches Object 1, then (for example) object 1 must create a new object (for example, object 2) on itself.

    >

    > And here dances begin with a tambourine, since the object object 2 is created immediately and on object 1 and on object 1 (copy).

    i see you have a collision/overlap issue, so what happens is when the player hits object1, object 1 clones himself as a new instance in the same position, position at which the player is already overlaping the object therefore triggering the collision again, and spawns again another object and so on.

    try push the player outside the object1 when collision happens even if it's 0.01 pixels outside to it so is not noticed to the player, that should fix your issue.

    also make sure you destroy object1 that initializes the new cloned object in the same event action that makes the new object. on the same tick.

    No no. I can hardly see the problem, sorry for my English))) Here is a picture

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hiya, I don't really understand the logic there as it is just a small section but be careful using functions after picking instance because when you run the function it does not relate to this instance and can pick a different one. You can pass through the UID of the object 1 through the function, and then on function call you can say for object 1 where UID = param 0.

    Yes, that's right, as long as this is my only solution so that not all copies of object 1 create a new object on themselves.

    Also, I can not use UID since I do not know how many copies to create, they can be any number

  • i don't know if this is having any sense to you but what i see in the image is this

    you call function with name"t2" but you have creation of sprites on function with name"t1" ... maybe is something we are missing?

    What "t2" is supposed to do? and why is "t1" function there? how is "t1" called? and again, as i mentioned to another function related question, having a wait 4 seconds in the trigger once function call doesn't work like that, you have to replace the wait 4 seconds with a timer being it a global number or the timer plugin.

    atleast that is how i solved that wait "n" seconds issue... mainly cause functions calls and anything else happen on a tick bassis, adding a seconds based delay inside a trigger once tick condition makes the function not trigger properly....

    creature_spawn here is the wait "n" seconds workaround inside a function call.

    hope it helps.

    Many thanks for the example.

    There are no problems with functions, since I built them in to simplify the work.

    The point is not in functions, but in the fact that when a copy of an object is created, it applies all the parameters to itself. And I do not understand how to make a copy work separately.

    We have:

    Player

    Object 1

    Object 1 (copy)

    Imagine that we first have a Player then after 10 meters Object 1 and after 20 meters Object 1 (copy)

    When the Player approaches Object 1, then (for example) object 1 must create a new object (for example, object 2) on itself.

    And here dances begin with a tambourine, since the object object 2 is created immediately and on object 1 and on object 1 (copy).

    I put the function to randomly select a copy of the object, but this led to the fact that as soon as the Player touches object 1, then object 2 can be created arbitrarily.

    And it is necessary that object 2 is created each time on the copy of object 1 to which the Player interacts.

    ---

    I will try to more fully explain the problem.

    Imagine that the player has 5 sheets of white paper. (all these papers are copies), further, when interacting with one of the 5 sheets of paper, that is, with one of the copies, this copy creates the text on itself. That is, only that copy of the paper with which the player interacts creates text on itself. If the player in turn will interact with all 5 sheets of paper, then each of them in turn will create a different text.

  • I can not solve the puzzle. Who faced this condition.

    There is an "object 1" it has the behavior of "field of view", when the "object 2" enters the field of view of object 1, then object 1 produces a text message. So far so good.

    The problem arises at that moment that there can be many copies of objects 1.

    As it should be: when object 2 gets into the field of view of object 1, then only the given object 1’s text should come out and not all its copies.

    The number of objects 1 is not known in advance and can be any number.

    Now I have 2 situations: Either only one first object 1 produces text when object 2 falls within the visibility range of any copy of object 1, or all objects 1 produce text at a time if object 2 approaches any object 1.

    How to make so that each copy of the object is independent of each other?

  • when u copy paste things, you have to make sure you select the proper layer before you paste, same as with photoshop as you mentioned it.

    in photoshop when you paste something it goes to the selected layer and incremental if u don't paste inside the layer, in construct happens the same.

    so you have to select the layer by clicking it before paste.

    In general, when you select an object in PhotoShop, its layer is turned on and, with all the desire, you can insert this object into the same layer.

  • Object overruling layer seems wrong, the layer bar is there to select your layer. If you have trouble with objects on varied layers you can select it in object bar which will select all of that object type, you can set them all to the same layer with one change.

    It's not a problem. And in the convenience of work and optimization. This is how all programs work, starting from Photoshop and ending with video editing.

    The main thing is the object and not the layer.

    And now I say on layer 1 I have object A, then I choose say object B which I have on layer 2 I copy it and paste it, but object B is inserted not on layer 2 but on layer 1 because the layer does not switch when I select an object. As a result, you do not follow this, and by the end of the scene you have a house in the layout since all the objects are not located on their layers.

    In order for this to happen, you don’t have to reinvent the wheel, just make all the programs ryut out, when you select an object, the layer on which it is located is activated.

  • I ask you to modify the system for selecting an object and a layer on which the object is located.

    Now all the work is happening on the layer that was selected initially, which is extremely inconvenient. When you select an object on another layer and say you copy it, it is inserted on that layer on which you find it initially. As a result, then you have to manually check all objects and mix them in layers.

    It would be logical that when selecting an object, the program automatically switched to its layer and all the work was done on the layer of the given object.

    This will greatly simplify life.

  • There is no easy solution.

    I made an example here of just one way to do it.

    https://www.construct.net/en/forum/construct-3/how-do-i-8/multi-language-support-is-ther-137537

    There was also a plugin, but it doesn't support the c3 runtime.

    Many thanks, I will try to study this moment)

WRS's avatar

WRS

Member since 2 Feb, 2019

Twitter
WRS has 3 followers

Trophy Case

  • 5-Year Club
  • Email Verified

Progress

6/44
How to earn trophies