tarek2's Forum Posts

  • what i need to be able to do, for example, is loop over each sprite instance of an object type in a family, and add up the current animation frame number.

    In pesudo code this looks like this:

    set global variable v = 0

    for each instance inst of object type in family boxes

    add to v inst.animationFrame

    This code should run everything any of the boxes is touched / tougled

    this would yield a number that indicates if all animation frames are zero -- i.e. white, or at least one red, i.e. the sum is greater than zero.

    But, i don't see a way to do this with family

    the only way i see right now is to hard code the sum using the actual sprite names

    Hoo I see, You don't need a loop for that, you need just a simple comparison of the Frame it will loop automatically through all the instances matching the condition if none is found the Else, in this case, means all the family Frames are = 0

    see event 5 where I call the Function

  • Thanks.

    Sorry for the confusion.

    No problem mate

    is it something like this?

    https://www.dropbox.com/s/xevtnf2s9p9b4ah/ColorChange.capx?dl=0

    For the explanation you gave it looks like you have 4 separate objects so I follow your design but I don't think you need separate objects or families in this situation, let me know if something is wrong

  • So your problem is with the (fourth box) that it should change the color when one or more boxes from the family change color?

    or

    When One of the Family boxes changes color none of the other two boxes on the family should be colored?

    it's a bit confusing what exactly you trying to archive

  • > I have many Links saved That I collect throughout the years organized in folders by Topics to easy Find Them, are all the old links gonna be lost?

    They'll all work now

    Haa Thanks a lot for the quick Fix that's awesome :)

    I will wait until you come back from your holidays to ask about my other questions again, you know about the profile links not showing up etc.. but those are not urgent

  • you can do it in many ways, the first idea that comes to my mind quick and easy using triggers?

    here's an example

    https://www.dropbox.com/s/85dfhev2iig6014/Z-Order.capx?dl=0

    Note: has no solids yet but you will get the idea

  • Can someone link me to a post with broken links? Having a quick scan through some posts and they seem to be working.

    Hi Tom,

    I have many Links saved That I collect throughout the years organized in folders by Topics to easy Find Them, are all the old links gonna be lost?

    As a random example here are a few

    https://www.scirra.com/forum/viewtopic.php?f=146&t=189093&p=1108924&hilit=how+picking+works#p1108924

    https://www.scirra.com/forum/viewtopic.php?f=147&t=190451

    https://www.scirra.com/forum/viewtopic.php?f=178&t=189058&p=1108913#p1108913

    https://www.scirra.com/forum/viewtopic.php?f=147&t=194900&p=1136297#p1136297

    https://www.scirra.com/forum/viewtopic.php?f=147&t=169959&p=1022372#p1022372

    Most of my saved Links which are a lot they show me the 404 Error I hope you can fix all the old Links as has been huge work collecting and organizing by Topics

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

    And another thing can you restore the old search from profiles where we had all the post that we post since the first day that we register on Scirra, that was very useful as you can trace all the post in chronological order from the newest to the oldest Plus they had the Tittle of the Topic of the thread before you enter on the post to easily identify in which thread you posted

    Example if you go to my Scirra profile it doesn't show anymore the section of all the post that I posted

    https://www.scirra.com/users/tarek2

    And would have been awesome if you had given the change to select the theme for the forum (New or Old) as I'm finding the new one very bright is hurting my eyes, with the old theme was perfect I could spend hours and hours reading without any problems

    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:1ho0bt26]Aah .. finally it's solved.

    Thanks for giving your time to help and explaining the concept

    No problem m8

  • [quote:2uvyqft1]In the file, I provided previously when I am setting the layout where both the targets are overlapping each other then the drop function does not work. When both are placed separate then the drop works perfectly.

    Ok I think I get what you mean now

    So you are saying when both Targets are together and you Drag&drop an object on the targets it doesn't work right?

    That's because they are two states that are true at the same Time and therefore both of them they will fire at the same time as the object overlaps two Targets at the same time

    Object overlaps >>> Target >>> yes is true and picks Both Targets

    > object.id = Target.id >>>> is True >>>set position

    Else>>>>>>>>>>>>>>>>>> is True >>>Back to the starting Position

    The problem is here (object.id = Target.id) is not the same as (Target.id = object.id) even if they are technically the same just inverted but the results will be different, one just compares and the other one Picks

    Capx:

    https://www.dropbox.com/s/3oe5og12khuk14l/DragMatchObjects2.capx?dl=0

  • jmg89

    Here is a capx using Family

    https://www.dropbox.com/s/fsok38w5qh0uqgu/DragMatchObjects.capx?dl=0

    you cant open it with the free version

  • [quote:1zeh2cur]

    Thanks for the comment.

    Can you please provide a capx file?

    I've even tried family, but there too experiencing same problem

    Sure, just to make sure I followed what you trying to do as is not very clear

    1-When Sprite overlaps Target and is the same Id >>> Sprite set position to the Target

    2-When Target Overlaps Target has to be the same Id or doesn't matter??

    if you can explain the steps you trying to accomplish will be easier and quicker

  • [quote:2bd3vftc]When the targets are not overlapping each other it works correctly. But, when 1 target is overlapping on another target in the layout then the drop function does not work in the overlapping region.

    How to solve this issue?

    You have the Events Referencing (Sprite Vs Target) only, what you need is to create Events referencing (Target Vs Target) swell

    Will be easier if you put all the objects in a Family so you create just one Event like you did

  • [quote:3sbgnu9v]4 different tiles are fine, BUT you cannot animate them. So if you don´t intend to animate them, use the tilemap.

    I see what you mean, they are just static animation

    [quote:3sbgnu9v][quote:3sbgnu9v]I thought that I read in other threads that if the Tiles are the same it counts the draw call as 1

    Is should be sort of true if you use the same tile. So if you use the same tile 100 times it should be 1 drawcall (I´m not sure if it´s actually only a single drawcall but it should be faster) if you have 100 different tiles, each will have a drawcall.

    /quote]

    Cool, that's what I was looking for, as in all the threads talking about this topic they mention if the Tiles are the same it counts the draw call as 1 but they end up with as long you don't use many different (Tiles Animations) which instead will be better to use sprites, since my confusion of how much will be categorize to

    much (different Tiles Animations) as it sounded you cant mix up many different Tiles that's why I asked if 4 Tilemaps will be more efficient.

    But if you can mix tiles as you said then is much easier to know who will be a better choice

    TileMap of 400 Tiles: using 4 different animations, say 100 tiles for each animation that will be = 4 Drawcalls

    400 Sprites: using 4 different animations, say 100 tiles for each animation that will be = 400 Drawcalls

    if this correct is much easier to see who is the winner unless I missed something

    WackyToaster thanks very much for helping me clear up the confusion

  • [quote:31ijvx8s]The drawcalls will be the same. Each sprites needs a drawcall, each tile also does. This also means it´s not recommended to have single objects span over multiple tiles, because each tile will be rendered individually. So an entire tree is better off beeing a sprite rather than 20 tiles in a tilemap. I think though there is more going on in regards to rendering. Also:

    Interesting, so if you have 4 different (Animation Tiles) to use on 400 Tiles is not a good idea to use the TileMap I guess, unless I'm not understanding well, I thought that I read in other threads that if the Tiles are the same it counts the draw call as 1 but still were a bit confusing to understand as the TileMaps have many different Tiles animations

    [quote:31ijvx8s]It also has some downsides though, that´s why I personally never really liked working with tilemaps. For example, you cannot animate tiles and I generally found it a bit cumbersome to work with for various reasons.

    I agree is a bit messy and hard to follow the events once the project starts to get big as they don't have the option to use variables and booleans

    [quote:31ijvx8s]It also depends on where you want to play the final product. For mobile it´s probably a better idea to use tilemaps because you wanna use that limited power well, on a PC you probably can get away with just using sprites, I don´t think you´d run into a bottleneck anytime soon on any reasonably modern machine.

    The project is for Mobile any tiny performance gain is much Welcome

    2

    [quote:31ijvx8s]Hard to say. If the game is entirely based on tiles, it´s probably a good idea to use a tilemap since it offers tools (like a drawing tool) that are not available with sprites. You have to keep the downsides in mind though. If you want to use animations in all your tiles except a few, you probably should just use sprites. I don´t think you can calculate it.

    I guess there is no an easy "Equation" to assess who will be much better suited for the Job which is why I opened this thread to find out, is strange I read most of the Threads on this topic and the Manuals c2/c3 many times but yet I always end up more confusing as it doesn't give any clear guide to be able to choose wisely, I will have to keep looking

    WackyToaster Thanks for your Time

  • Hello to all,

    I'm a beginner with construct 3 and I do not know how to compare multiple variables

    I explain

    I have a "function call" that passes a parameter that can be "yellow - blue green or red"

    In the function I have to test if the parameter passed to the function is" yellow - green - blue or red" and for each of these "colors" I have to increase a different global variable

    How can I do?

    Capx

    https://www.dropbox.com/s/is8zgiqmhdco96q/Compare%204%20variables.capx?dl=0

    If you cant open the capx here is Pic

    https://www.dropbox.com/s/c4h4vq5rlie65c8/Compare%204%20variables.png?dl=0

  • So I'm making a game where the player places a boulder in the river to cross it. The river is a solid tile map and I need a way of making only part of it passable without disabling the solid behaviour for the entire tile map. Is there a way of spawning a new object on top of the boulder that would act like a bridge over the tile map? This is for a college project so I need the answer quite soon. Thank you.

    Creating two TileMaps the same Size at the same coordinates one for the Graphics and the other one for the solids

    Have the river on the Graphics TileMap, and duplicate the same on the Solid TileMap but the solid TileMap will be invisible so when the Player is allowed to pass the River delete the "boulder" solid Tiles from the Solid TileMap that will make him able to pass the River,

    that can be one option