tarek2's Recent Forum Activity

  • 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"

  • The results are correct.

    You have an array size:

    Width = 10

    Height = 1

    If you want to empty it, you can set the size to:

    Width =0

    Height = 1

  • It's hard to know without seeing a minimal example.

    For the error you describing my first guess will be to look at the (character and the Rock) if they are on different layers that have different parallaxes. If they are then you need to make sure that all the objects that need to interact with the player have the same parallax, otherwise, there will be an offset between them.

    Other than that, not sure what could be the issue.

    Have you checked the collision box? and the Origin point if they are set properly? Maybe you cut the picture and the image point wasn't centred after.

    If it is none of the above, please post a minimal example showing the issue so someone can have a look at it and give you better help.

  • Grab a glass of water and regret ever asking for help!

    Lol

    I will skip 3D Arrays.

    Thank God you had some piety for the poor soul :)))

    Thank you for the response! I guess a better question would be, how to fit the tilemap json data into the array and the downloaded file. The concept of arrays is really confusing to me, but as i understand it has 3 dimensions being used for the object name, x, and y position. It doesnt seem the tileset data would fit into the array, perhaps a different configuration or 2 files will be necessary to save a level? Im completely unfamiliar with the dictionary object and its capabilities.

    The goal is to save each level as a separate file and load them all when starting the game. More elements will likely need to be saved as I continue development, so just trying to get an understanding of how to compile complexities into a save. Thank you for reading over this and my ramblings attempting to understand code :) updated the project link it should be accessible now!

    Let me add to the combo, to give you the final blow :)

    A lot of it is repeated, though I will try to make it more visual, maybe it will be easier to digest.

    The first thing I will recommend to you is to spend some time learning (Dictionaries & Arrays). Take your time and learn how to (Add & Retrieve) data from those plugins. There are plenty of tutorials for that.

    And have a look at the Manual:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/array?utm_campaign=C3Editor&utm_source=browser&utm_medium=r391&utm_term=PropertiesBar-LinkProperty

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/dictionary?utm_campaign=C3Editor&utm_source=browser&utm_medium=r391&utm_term=PropertiesBar-LinkProperty

    Dictionaries:

    You can learn them in minutes as they are the easiest.

    Use "Add Key": to add a -------> (key & Value)

    Dictionary.get("KeyName"): to retrieve the Key -------> (Value)

    Have a look at the Manual they will show you all the Expressions and Actions.

    Arrays:

    You can customize it to your needs, you can use (1D, 2D or 3D)

    What is the difference between those 3 types?

    It depends on the (Width, Height, Depth)

    The depth is represented by "Z" --------> (Width, Height, Z)

    Width = Total Columns

    Height = Total Raws

    How C3 works to retrieve the data?

    X = Which Columns index Number is

    Y = Which Raw index Number is

    Z = Which dimension is

    1D Array:

    It is when you have a (Height = 1), meaning one Raw.

    So here to retrieve any Column index data you just need the X index number

    For example:

    Here is an Array

    Width = 7

    Height = 1

    The first coulmn will be --------> (X = 0)

    The Last column will be --------> (X = 6)

    If you want to retrieve the value from the first column ------> Array.at(0)

    If you want to retrieve the value from the last column ------> Array.at(6)

    2D Array:

    It is when you have a (Height = 2) or greater, meaning multiple Raws.

    So here to retrieve any data you will need the (X,Y) index numbers.

    -The Top-Left Array cell will be at (0,0)

    -The Top-Right Array cell will be at (6,0)

    -The Bottom-Left Array cell will be at (0,2)

    -The Bottom-Right Array cell will be at (6,2)

    If you want to retrieve the value from the Top-Left------> Array.at(0,0)

    If you want to retrieve the value from the Bottom-Right ------> Array.at(6,2)

    3D Array:

    Is when you add depth, meaning more than one dimension, (Z = 2) or greater

    Each dimension is one Array independent, you can view it as layers:

    (Dimension 1= Layer 1)

    (Dimension 2 = Layer 2)

    Etc...

    As you can see in the picture:

    Array 1--------> will be stored on Dimension1

    Array 2--------> will be stored on Dimension2

    Array 3--------> will be stored on Dimension3

    To retrieve the data now you will need (X,Y,Z) for 3D Arrays.

    If we take the example from the 2D Array Picture Avobe:

    If we want to retrieve the data from:

    -The Bottom-Right Array dimension1 will be at (6,2,1)

    -The Bottom-Right Array dimension2 will be at (6,2,2)

    -The Bottom-Right Array dimension3 will be at (6,2,3)

    Finally:

    How you save the data you will need to figure it out by yourself so you can select a structure that you will understand and feel comfortable with. There is no right or wrong, every one has his favourite way of doing it. You can use Dictionary only or just Arrays, or both. You can use multiple Arrays and dictionaries, the possibilities are endless.

    If you do step one properly then you should be able to figure it out easily.

    Here is just a quick random example, just for this tutorial:

    You say you want to save the Tilemap XY and with, height

    Use the expression ---------> Tilemap.AsJSON

    -That will save you all the data of the tilemap

    -Then for example you decide to use Dictionary to save all the enemies

    -Then you decide to use Dictionary2 to save all the Objects like (Coins, Powerups, etc..)

    Here is one possibility of how it can look like:

    X = Level Numbers:

    X = 0 ----> Level1

    X = 1 ----> Level2

    etc...

    Then you have the whole (Height or column) to store all the data for the levels:

    Example:

    Level1:

    Array.at(0,0) = Tilemap JSON

    Array.at(0,1) = Dictionary Enemies

    Array.at(0,2) = Dictionary Objects

    Level2:

    Array.at(1,0) = Tilemap JSON

    Array.at(1,1) = Dictionary Enemies

    Array.at(1,2) = Dictionary Objects

    Level3:

    Array.at(2,0) = Tilemap JSON

    Array.at(2,1) = Dictionary Enemies

    Array.at(2,2) = Dictionary Objects

    And so on...

  • Hi DexRage

    Have you tried to set the "Origin Point" of the SVG object to the centre?

    It works as it should on my end.

  • I couldn't have a look at your file as it needs permission to access it.

    But in general, if you just need to save the Tiles of a tilemap, then you can save the JSON "Tilemap.TilesJSON" in an (Array or Dictionary) and download it.

    Then load from AJAX the (Array or Dictionary) first and after that load the Tiles Tilemap from that "Tilemap.TilesJSON" that you saved in one of those plugins.

    Here is one example:

    https://www.dropbox.com/scl/fi/y9o8swpe7xthug47awb85/1-TileMap-Load-From-JSON.c3p?rlkey=t36g5zfwa09wrxv749nu086g6&dl=0

  • It could be related to this issue:

    https://github.com/Scirra/Construct-bugs/issues/8236

    He added the fix in r407.2

    Try version r407.2 or higher to see if resolves your issue.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > > > Use the condition called "Is overlapping at offset".

    > >

    > > My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    >

    >

    > If you don't need to check at offsets then you should always use the normal condition:

    >

    > "Is overlapping another object"

    >

    > You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    >

    >

    > If you need to check the offsets, the manual can help you in how it works:

    > https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

    "Is overlapping another object" is useless. These two objects use the "Physics" behavior. The "Physics" behavior can set the collision boundary to a circle. They cannot overlap and can only push each other. The manual shows that offset cannot solve this problem. there is no better way than to detect the distance between the two.

    I missed your second post where you mention the Physics, I apologise:

    My answer was for non-physical objects.

    If both objects have the physics behaviour then indeed the overlaps check will not work, as it will resolve the physics collisions first and push them apart, and by the time it checks for overlaps, it is too late.

    1-Distance check is a great alternative.

    2-You can also use invisible colliders as an alternative:

    Here is one example:

    https://www.dropbox.com/scl/fi/pq3f2ne6q2sjngo020bxp/1-Physics-Overlaps.c3p?rlkey=0pues73jekqf4fzyzdttl3q3w&dl=0

  • > Use the condition called "Is overlapping at offset".

    My two objects are circles. If I use "Is overlapping at offset", the offset point XY can only detect one point. Is there a convenient formula? What I am using now is to compare the two values ​​​​distance (friendly circle.X, friendly circle.Y, enemy circle.X, enemy circle.Y) < (friendly circle.Width / 2) + (enemy circle.Width / 2).

    If you don't need to check at offsets then you should always use the normal condition:

    "Is overlapping another object"

    You will probably want to adjust swell the collision points of the circle if you need it to be 100% accurate instead of a Square box.

    If you need to check the offsets, the manual can help you in how it works:

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/common-features/common-conditions#internalH1Link10:~:text=Is%20overlapping%20at%20offset

  • You have multiple doors, but you use "Trigger Once" which is causing you conflicts as this trigger doesn't run per instance. If you want to run it per instance you can replace the following:

    "Trigger once" -----------> by -----> is Animation Playing "Closed"

    This will make it run per instance.

    You can also remove the "For each" and all the other extra checks as they run every tick unnecessarily and do all your logic under the

    Player is overlapping door:

    ----> door_plate is not Active

    To skip all the subevents when the (Player is not operating door & door_plate is Active)

    Also, you will have everything more organised in one event.

    Here is one example:

    https://www.dropbox.com/scl/fi/s7yw609wcrqc9w5eu7ph1/Multiple-Doors-Fix.c3p?rlkey=lpmf1k0mx7u0zp68s2d6tynr1&dl=0

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies