WRS's Forum Posts

  • Try this:

    Start with turret enabled: no

    And create a condition to enable it only when you have line of sight, also when you have line of sight use the action: Add object to target.

    Create a else condition and set the action: Unacquire target.

    Lets see if it works.

    Yes, I have done so.

    When tvrag gets into the zone of visibility, then we activate the taurel.

    The most interesting thing is that I use treys and I see visually a line of sight, I see how solid objects overlap it.

    Also, through the zone of direct visibility, the pursuit of the enemy is configured, and everything works fine.

    But with taurel it does not work.

    I'm afraid the fact is that taureli has his own parameter of visibility and he ignores hard objects.

  • Try using a line of sight behaviour together.

    Yes, I use this behavior. But it does not help, as soon as the movement occurs, it is taurel induced and opens fire on the object behind the wall.

  • When using Taurel's behavior, the taurel itself shoots even if it sees the enemy behind a hard object. That is, shooting through the wall. How to make so taurel would not see the enemy behind the obstacle?

  • WRS

    that line creates all the level sprites in a grid to evenly space them out.

    you don't have to do it that way - you can have them already placed on the layout.

    it takes a short while to load the array data from local storage, so the game wont know which levels are locked or unlocked when the layout starts. You might want to set the level sprites as invisible until the array is loaded and you can set the correct animation, and show how many stars have been earned.

    Many thanks for such a detailed example. I will deal with him)

  • WRS

    I was only showing how to store the number of stars in an array, and save that in local storage.

    in your screenshot you store the level name as an instance variable, and that is perfectly fine - I just didn't want to make a lot of levels...

    I'm sorry for the meticulousness, I just want to understand how to work with the array as much as possible))) I apologize for the clarifying questions.

    What does this expression mean?

    100 + 125 * loopindex% 5

    150 + 150 * floor (loopindex / 5)

    Not all technical language, I still understand.

  • WRS

    you can save the entire array AsJSON...

    I made a quick sample...

    https://www.rieperts.com/games/forum/levelstars.capx

    I can not understand what makes this expression?

  • WRS

    you can save the entire array AsJSON...

    I made a quick sample...

    https://www.rieperts.com/games/forum/levelstars.capx

    Do I understand correctly that your example is still responsible for opening levels?

    That is, the system that I showed above at the opening of the levels is not quite suitable and good?

    I just understand it.

  • The Array docs are pretty good: construct.net/en/make-games/manuals/construct-3/plugin-reference/array

    Arrays have a "AsJSON" and "Load" actions or expressions that let you get the array contents as a single string (AsJSON) and then reconstitute it (Load).

    Yes, I just started to understand how arrays work.

  • WRS

    you can save the entire array AsJSON...

    I made a quick sample...

    https://www.rieperts.com/games/forum/levelstars.capx

    Big thanks. Now I will understand how it works.

  • Then you might store the array or other values in local storage: construct.net/en/make-games/manuals/construct-3/plugin-reference/local-storage

    Yes, I generally understand how saving works, but I don't understand how to save an array. Save the entire array can not? Can you just save each cell as a key?

  • Use an array!

    I tried, but did not understand how to save the array. after reset it is reset

  • I can not solve the problem with the discovery and preservation of stars.

    For example, a player passes the first level and on it he can get up to 3 stars. There is no problem. I just think every selected star at the end of the layout, I give the message you have passed the level of 3 stars.

    The problem is that there is a layout with a choice of levels. I open the levels (in the screenshot), that is, I have 1 box with 2 animations (closed or open) and I have a star (I copied it to 3x)

    But how to light these stars, depending on how many stars the user has spared, I do not understand.

    I can solve this problem by creating 100 global variables, but I understand that this is not correct.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are using Trace addon to visualize the cone of view! It crashes on my pc, so I can't help you.

    I recommend you use the official LoS behavior instead. In the latest C3 beta they added raycasting feature, so you don't need the Trace addon. And with the built-in LoS your glass should work correctly.

    https://www.construct.net/en/make-games/releases/beta/r143?utm_campaign=marketing&utm_source=sendgrid&utm_medium=email

    Thank you very much now I'll try)

  • How did you make that visual radius? You need to post your project file.

    I use LOS for visibility

    yadi.sk/d/70m0TTVnmPpduA

  • Like I said, the glass should be set Solid to block 8-direction. LoS should use custom obstacles. You need to add walls, trees etc. to LoS obstacles, but don't add the glass. Demo:

    https://www.dropbox.com/s/flcf4a7rqr98x1n/GlassWall.c3p?dl=0

    Yes, that's right, everything works like this. But the problem is different. Visible radius does not penetrate the glass. That is, objects (Enemies that fall under the visibility) become visible but the visual radius of visibility itself cannot penetrate behind it.