tarek2's Forum Posts

  • Perhaps some more clarification is best.

    Yeah, great explanation from lionz, I dont think it needs more explanation than that:

    A few points that I think are important:

    but pushing back on the X axis with Armor.X adds a new entry, in my opinion is super weird.

    Is exactly the same thing you were doing:

    You were using "Insert" in the Y so what this does is insert a new Row.

    I use "Push" which is the exact same thing I push a new Row or column.

    The only difference between the two is that "Insert" lets you pick the (Y or X) index where you want to insert the Row or column. And push just insert the new (Row or column) at the back or the front.

    "Yeah it works and I sort of understand what's going on but it isn't very intuitive."

    Is quite intuitive and safer than the system you were using as By inserting always back you protect all the Rows and values that you already had in place for the old parts, especially since you say that ober time you gonna keep adding new parts, therefore you better no change any index reference. So if you you keep inserting in any index you will have the risk of breaking your code as you gonna have to constantly change the references that you already had in place to get the old part values.

    On the other hand, if new parts get inserted in the back then all the old parts are protected since you do not change their index reference ever.

  • I dont think QR Code supports sending the image in itself but I could be wrong.

    I haven't seen any QR code do that yet.

    Normally what they do is:

    1-Take the SnapShoot

    2-Upload the image to your server

    3-Copy the direct URL link of the image

    4-Use the QR Code generator to create a QR code using the URL

    Then when the players scan the Code with their phones they will give them the direct link to the image, where they can open it and save the image on their phones.

  • find(Text, "Word")

    It will give you the index number of where it found the first-word match

    or

    If didn't find any it will give you -1

  • each row is supposed to be its own instance, the rest of its information is on the Y axis.

    I think you meant each Column is supposed to be its own instance, this is if you want to save the rest of the instance info on the Y axis as you mention.

    At the moments:

    -You are inserting values only on the Y of the first raw as you are not defining the X.

    If you want to save each instance on its own column like (X0 Instance1, X1 Instance2,X2 Instance3, etc...)

    Here is a better approach:

    Before you start the loop to insert values you need to set the size of the Array once and do it outside the loop

    To a size(0,3,1)

    Then in the loop:

    For each Armor is overlapping:
    -----> Array Push Back Armor.X
    -----> Array Set at (Self.width-1, 1) Armor.Y
    -----> Array Set at (Self.width-1, 2) Armor.Zindex
    
  • Can you also tell me if it is possible in Contruct 2 to create a life bar for a family? Because it is not possible to add a container to a family with

    Containers dont work with families.

    You gonna have to create your own tracking system with UIDs or something similar to link the (Enemies Family + HealthBars)

    Here is a very basic example of how to create and link a health bar in C2:

    Basically just shows how to (Pin and link UIDs) using families.

    Is a long time since I dont create UIs in Construct2 and forgot how tedious the process was. Especially when you have been using C3 hierarchies for so long time, which takes care of all behind the scenes, it is as simple as building the HealhBar in the editor and just spawning it with the enemy creating a hierarchy. Also, the picking is simple, just pick Enemy childs. Few lines of code compared to all you have to do in C2 to get it working with UIDs etc...

    https://www.dropbox.com/scl/fi/gtj2nb73mcdwi6ov8lg6v/1-Health-Bar-That-Works-with-Family.capx?rlkey=fv045430xdv09n7s96qyntat9&dl=0

  • Unfortunately I'm creating it in Construct 2, can you do this in it? Thank you so much for helping, I've been having a headache with this for months.

    Is the same thing, they use the same events, nothing different.

    Just copy the events line by line in Construct 2, it should work.

  • Hi Amanda

    Will this help you?

    https://www.dropbox.com/scl/fi/d7xxwpil8ig6ft96dm687/1-Dont-Target-objects-from-the-same-Team.c3p?rlkey=z47eudlybobwvwzkxcv4rrg1n&dl=0

    The turret behaviour can be a bit tricky to set up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Unfortunately, there is no expression for that.

    An idea maybe is to keep track manually by adding the tags into a dictionary keys and then you can just check "Dictionary.KeyCount"

    You will just need to remember when you stop an audio make sure you remove the key from the dictionary.

    or

    By making a loop to check all the audio tags one by one to see if it's playing, then add to variable 1 for each tag that you find playing.

  • If you really need it and dont mind using Construct 2 then it is possible by using a Plugin. I use it all the time but for personal projects that is not meant for release to the public. It is a great plugin and is a shame that it wasn't ported to C3.

  • There are many issues in your events:

    1-The trigger "On any animation finishes" will never trigger as you stop it manually. That trigger is meant for when the animation reaches the end of the animation.

    2-Your Animation (Attack & Walk) are conflicting because both are constantly true when the enemy is at (less than 85px) distance from P1:

    Example:

    Line of sight = True ----> Set to walk

    The enemy's distance to the player is <85 -----> set to attack, as you never stop the line of sight

    The best way to control the states is by variables.

    Here is one possible solution:

    Add an instance variable to the Enemy and call it "State", and set its (type = String)

    Events:

    -Enemy has LOS to P1

    -Enemy distance to player > 85

    -->Action:

    MoveTo move to player

    Set Mirrored

    Set animation to walk

    Set state to "walk"

    ============================================================

    New event:

    State is = "Walk"

    Distance to player is (=< 85) less or equal 85

    --Action:

    Stop MoveTo

    Stop Animation

    Set State to "Attack"

    Wait 0.2 seconds

    Set Animation to "Attack"

  • So how can I find out if an array has only zeros?

    You need to loop through each cell and compare if the value equals zero.

    If it's a 1D Array use:

    If it's a 2D Array use:

    "For Y" from (0 to Array.Height-1)
     "For X" from (0 to Array.width-1)
     ----> Array.at("X","Y") = 0
     ----> Else = Stop the Loop
    

    I cannot get the format properly, here is picture, that looks better:

  • Np

    Glad you sort it out)

  • The item is actually a family. So is there a way to check each instance of the family separately?

    Yes you can check each instance independently by using "For Each"

    item overlaps Family:

    ----->For Each Family:

    ---------> Check whatever you need here

    However, you don't need to do a for each if just want to find out two matching items.

    A simple check it should work:

    item overlaps Family:

    ------> "item Name" = "Family.item name": destroy item & destroy family

    Edit:

    Unless you are overlapping more than two items, in that case, the "For Each" will the best option to find the first matching pair.

  • Are they different objects or are instances of the same object?

    If they are instances of the same object you can use families:

    item overlaps family:

    -----> item 1 name is "STICK"

    -----> Family name is "STICK"