Underdog's Recent Forum Activity

  • Hey Robertjs3,

    nice idea Robertjs3

    In the capx, I did not use this approach.

    I used a boolean for the same purpose but on my main capx and it did not work neither.

    However, I will investigate because I may use it at the wrong place. Thank you, I will double check my events, you may point something I do wrong

    I'll keep you posted guys,

  • lmchucho

    Actually, it does not work for my mechanic.

    I need to keep "For Each" because I can have bigger enemies that overlap other enemies. Therefore, I use a variable that correspond to their Y position.

    Like that, my characters can shoot the correct enemy because they are on the same Y.

    I tried to remove for each and now, my characters shoot but their projectile pass through the enemy. Which is normal because they do not match their Y position anymore.

    If I remove the variable for the Y position, the projectile will hit the enemy that is not on the same line but can overlap the Y position.

    Anyway, I really believe that there is a bug because it does not make sense why "For Each" will impact the Spawning Event even if I put a Trigger Once.

  • Duh!

    Thank you lmchucho

    it works well indeed without "For each"

    I will become crazy, I don't know why when I tried at home without the event "For each" it only works for one unit.

    Now, it is working perfectly without it

    Thank you for your time

    Cheers

  • Hi everyone,

    I looked around hours and days but I don't know if I do wrong or if Construct 2 has a bug.

    I have several units of the same instance that spawn and need to shoot one projectile once an enemy reaches their range.

    When they do so, some units (not all) will shoot more than 1 projectile.

    This is really annoying because it breaks all balancing tweaks.

    Do you have any idea of what I am doing wrong?

    Here is a short Capx I made to focus on my issue.

    Thank you for your help. I don't know how to fix this?

  • UI, I meant UI object which is the term we use in video game for user interface such as health gauge, radar, icons.

  • Hi Zed2100,

    yes but my issue is that I have a lot of enemies and depending on the enemy spawned, I would like to display the UI close to the edge of the screen.

    Let's say that if enemy 03 is spawned first, I would like to have it close to the edge and not 3 spots away from the edge, leaving an empty spot between the UI of the enemy 03 and the ledge of the screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi guys,

    I can't find a way to create an object (UI) when an enemy is spawned and is not already in the array.

    The sentence looks a bit crazy to understand so let me explain.

    For each enemy of the same instance that is spawned, I would like to have only 1 UI object that is displayed.

    Each time there is an enemy spawned, I populate the array with the name of the enemy.

    At the moment, each time that an enemy is spawned, I generate 1 UI object for it.

    I just want to have 1 UI object of this enemy because I want to have a number that corresponds to the sum of the same enemies on the UI object.

    I want to keep an array because I would like to sort the UI.

    Thanks for your help!

  • Problem Description

    If several sprites play the same animation at the same moment, and at frame X, they need to spawn/create 1 object, they spawn twice the number of objects instead of one each.

    Attach a Capx

    For Each [Character]

    [Character] is playing animation "X"

    [Character] is animation "3"

    Tigger once

    then Character spawn Object

    It works fine if all [characters] do not play the same animation at the same time.

    If they are synch, each character will spawn as many object there are characters

    Steps to Reproduce Bug

    • Step 1 Create one character with one animation
    • Step 2 Spawn object at frame X
    • Step 3 Try to have several characters playing the same animation at the same time

    Observed Result

    ____ What happens? ____

    Expected Result

    ____ What do you expect to happen? ____ Each character should spawn one object

    Affected Browsers

    • Chrome: (YES/NO) YES
    • FireFox: (YES/NO) YES
    • Internet Explorer: (YES/NO) YES

    Operating System and Service Pack

    ____ Your operating system and service pack ____ windows 8

    Construct 2 Version ID

    ____ Exact version ID of Construct 2 you're using ____ version release 178

  • Colludium, oh my god!!!!

    Your way is the correct one

    I gave it a try and I realized that my way was way too much complicated after testing yours

    I never used "For Each (by ordered)" and I guess, I will use it more often now.

    Thank you Colludium, I'm really grateful for your help.

  • Hi Colludium

    thank you but by default, C2 will put the new sprite atop of the older ones. Since I have several sprites that can be spawned randomly on Y, the issue will be that sprites that are supposed to be behind some of other sprites will end up in front.

    However, after hours of try and error, I finally found a solution that I will share with everyone, in case it could help others...

    Don't hesitate to ask me a Tuto if you need it!

    First

    • Create one sprite that called "RAIL" and duplicate it how many times you would like on the Y axis.
    • On your Sprite (enemies for example), add the variable RAILUID

    Second:

    • Spawn your sprite enemies by picking a random "RAIL" ==> On sprite enemy, Set Enemy.RAILUID to RAIL.UID

    Third and finally :

    • For Each Enemy
    • If Enemy.RAILUID = 73 (for example) ==> Move Enemy behind RAIL
    • System Pick RAIL where RAIL.UID = 74 ==>

    Increment it how many times you have RAILS

    • If Enemy.RAILUID = 74 ==> Move Enemy behind RAIL
    • System Pick RAIL where RAIL.UID = 75==>

    Enjoy! Joy! and Freedom!!!!!

  • Btw, I also tried the technique where I linked another Sprite called "UP" to the "SPRITE"

    If "UP" is overlapping "SPRITE"

    "UP.vrUID" is different than "SPRITE.vrUID"

    "UP.Y">"SPRITE.Y" =========================> "SPRITE" move to bottom of layer

    "UP.Y"<"SPRITE.Y" =========================> "SPRITE" move to top of layer

    This technique works but does not solve the issue because if I have a "SPRITE" that is between 2 "SPRITE"(s), he will always be on Top of the layer instead of being in front of the "SPRITE" that is <SPRITE.Y and behind the other "SPRITE" that is >SPRITE.Y

  • Hi everyone,

    I usually use UID, Zorder without any problems but for this one, I have no clue how to do it.

    I would like to manage the Zorder between the same instances that are spawned each X sec.

    If Sprite.Y > Sprite.Y ==> Move on top of Object Sprite

    If Sprite.Y < Sprite.Y ==> Move on behind of Object Sprite

    The issue, as you may probably guess, is I don't know how to get the correct Sprite.UID and even then, I'm not sure it is the correct way (duh)

    I usually do the following but it does not work and it is normal that it does not:

    Pick by evaluating Sprite.UID

    Compare Sprite.UID is different than Sprite.UID

    Sprite.Y > Sprite.Y ===========================> Move behind Sprite

    I know that it is wrong but I don't find the solution after many hours of testing a few different approaches

Underdog's avatar

Underdog

Member since 1 Feb, 2013

None one is following Underdog yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies