Tsardall's Forum Posts

  • Because those 40’000 objects are all tiles that make up the map. They change colour depending of the country owning them.

  • I have about 40,000 copies of a sprite and it's slowing down my project immensely with CPU usage at 95%. With the debug menu I see that some event-sheets are also contributing to the lag but turning them off changes nothing, the same amount of CPU is used whatever I disable or modifie. So I'm having trouble finding what the problem could be other than the massive amount of objects.

    Thank you-

  • Basically, I am using only one object and copies of it. What differentiate some of the copies is their variable : Ownership (which is whether owned or unowned)

    Now I need to calculate if the distance between a owned object and an unowned one is less or equal to 8.

    For now I am using the Line of sight behavior to do so but I feel like it makes performence drop to much for some reason and want to know if there is an alternative to it .

  • Thank you, it worked

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Are your pages only sprite or you have text pinned to them?

    Because I did something similar only using 1 sprite, instead of many pages on different Z layers, I used sprite animation and frame.

    That way you would only have to refere to one sprite and just tell which frame/animation you want.

  • In this situation whene a square is 7pixel near an other square having a special variable, the square detected should change colour. For this I use LOS, but the way my event is structured, each square with special variable checks every ticks (i guess) if there's an other one near which obviously cause lag.

    So I would need to fix this by only calculating if there's squares near whene a button is clicked but also have the colours display until it updates.

    Thank you

  • I tried your first option, but could make it work...

    This is contexte:

    The squares represent territories, the yellow ones have the variable ''Unowned'' and the reds ''Owned'' but they all have the variable ''Adjacent''. So if a yellow square touch the red (owned) ones the ''adjacent'' variable would change to 1 (meaning it's touching) and then if its equal 1 I change the colour of those touching.

    So I need to know how to change the variable ''adjacent'' of the unowned squares in dirrect contact with the reds.

  • I have tried using overlapping and LOS condition to know if a copy of the sprite is near, but I wasn't able to make it detect only if the variable of this copied object is for exemple: 1.

    In short

    I would like to know how to do this:

    If object is overlapping and that overlapping object instance variable = 1

    then

    change this object colour...

    Thank you

  • You do not have permission to view this post

  • It works but the hitbox of the 3d shape is completely off, so my square can go into the shape but theirs also an invisible wall because of the weird hitbox. I only need the shape to pârtially go over the 3d object that's why I need the hitbox.

    (I am also using a 3d camera)

  • But this completely changes its position, I need something that can put the sprite over the 3d the same way layers or Z order would do.

  • For exemple, on the image below, the red square is under the 3d object and I would need it to be projected over it instead. I tried putting the square in a new layer above the one that contains the 3d object but it didn't worked. Also the only way I found to make the 3d object appear under the sprite is to put an higher Z value than the hight of the 3d object which is not practicle. So I would like to know if there's a way to achieve this?

  • I have tried with 2 different variable instead of signals before, but I couldn't figure out how to make it work since I can only compare the two to each other.

    Because of that I would like to know if it's possible to send a signal each time the desired variable changes.

    Tagged:

  • You do not have permission to view this post

  • Is there a way to use sprite.count and simply add an other expression that would make it so it only count the sprites that have the desired variable?

    It would be so much simplier if it's possible since I haven't used loops often.