tarek2's Forum Posts

  • What I meant is to separate a single component from the circuit in order to be able to measure it with the multimeter. In the example you showed in the image, resistor2 would be disconnected from both sides, that is, it would be completely separated from the circuit. The reason is that it has two values: one when connected and the other when disconnected.

    If You know 100% is gonna be disconnected then should be easy, assuming you add a new Variable to the family "None_Wires_Object" which you will store the "Current" for each component then:

    I'm not sure which one you refer for Multimeter the one that has one or two cables but is the same logic:

    On multimeter cable overlapping Node or the two Nodes

    You can add an Extra check (Node is Not connected) to make sure is not connected

    Pick Component by UID = Node.parent >>> and Set Multimeter to Component.Current

    Note:

    This will work if the node is not on top of another node because otherways it will pick multiple Nodes and then you gonna have to filter more the picking to choose the one you want so you gonna have to add more events to filter the picking until you are left with one. So basically you have to deal with multiple picking issue if you know you not gonna have control over that because the user is the one dragging and can leave it anywhere including on top of other nodes.

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

    - I need to implement the multimeter (as you may have seen in the simulator) to measure the components when they are connected or not. This happens at the ends of the component. What do you suggest for that?

    Sorry, but as I cannot see this image, I don't know if I understood your comment correctly. I would use the multimeter to touch the probes to the ends of a component and the value would appear on the panel. In the simulator that I shared the link in the first post, the multimeter is at the top right of the screen and you can drag it to use the probes.

    It sounds that the Multimeter is the one with two cables:

    If you just want to know if a component is not connected at all then

    You could do:

    Assuming that the multimeter is the one with two cables, you will have two check the two nodes of the component at the same time, so something like:

    -Multimeter.Cable1 Is overlapping Node

    -Node.Connected = False

    -Multimeter.Cable2 Is overlapping Torque

    -Torque.parent = Node.Parent

    -Torque.UID is not equal to Node.UID >>> To make sure is not

    overlapping the same Node

    -Torque.Connected = False

    This means Is not Connected: Your Action Here

    But again you have the same issue of multiple Picking as I mentioned above so just make sure that the nodes are not overlapping other nodes

    Example:

    Here the (Wire & Resistror1)are connected but the fuse is overlapping swell but is not connected to any of them so you have to deal with those type of situations. The Example from that website they don't have that problem because they allow multiple connections so if more than one node are overlapping it means they are automatically connected therefore they avoid this issue.

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

    Awesome! It is possible to control this animation, right? For example, use the switch to turn on (show the animation) and turn off (stop the animation) or still disable the animation when the circuit is cut?

    If you check event 43 it is just one event so you can turn (ON/Off) the boolean

  • Thanks, I'm glad it was helpful)

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

    - Is it possible to check what component was disconnected when someone cut the connection of both sides of this component? If so, how?

    Everything should be possible as long you describe exactly how it works.

    Example:

    Do you mean something like this?

    The circuit has been cut it and they are two components at the two ends:

    -Going left side the last component is Resistor1

    -Going Right side the last component is Resistor2

    Which you can already get from the debug string if you look to the last components, look at the picture.

    If it's not that can you explain it a bit more, this assuming that we start always from the Switch? Anything can be done if you just explain how it works exactly including all the different situation that can happen, other ways it's confusing and it will take longer to give the right answer.

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

    - I will need to use other components besides those. Is it possible for me to implement it?

    Sure, its dynamically so you can add as many components as you want, just remember that they need to have the two image points (L & R)

    L = at the Left

    R = at the Right

    Look at one of the components to get the idea

    That's the only Rule, Also they don't have to be the same width so it can be different as it already takes into account the size of the component.

    Also, don't forget to set their variable "Type"

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

    - I need to implement the multimeter (as you may have seen in the simulator) to measure the components when they are connected or not. This happens at the ends of the component. What do you suggest for that?

    3-If you mean how to connect this:

    Then you can add it as a normal component but you just don't include it when you check if they finish the circuit in the right order, instead, it will act as a wire if I understood you correctly. Basically, it will be skipped for circuit check but it will be used to see who is connected to it only. I can have a look if you want but I just need to know exactly how this will work.

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

    - I thought to use tile background as the wires, but I need those wires to show the energy inside them, as happens in the simulator and I cannot use tileBG for this. I also used sprites, but when I stretch the wires, the animation also stretches. Do you know another solution for this?

    4-I just saw a nice example from "Newt" on this thread, It is just one line of code and works really good, the same as the website. I tested it already and it works but only with C3 so maybe you can use that.

    Thread Link: https://www.construct.net/en/forum/construct-3/how-do-i-8/dynamic-length-animated-159710

    Here is an example for the Energy Wire: https://www.dropbox.com/s/xyrsr0eprb0j6u5/energy%20wire%20test.c3p?dl=0

    Complete the circuit to activate the energy wires

    Video:https://www.dropbox.com/s/gxgjk9pk6ilbulb/video%20energy%20wires.mp4?dl=0

  • I don't know if you're referring to the link I included in the first post, but if it is, I thought it was going to be very complex, so I tried to ask for the minimum resources. The problem is that in the end I will not be able to do the demo version and it was all in vain, but thanks anyway.

    Yeah the link on the first page.

    I was asking because I didn't read the whole thread and I thought you were trying to do that type of circuit so I did give it a try but after I finishing a demo I read many different comments so I wasn't sure that you were looking to do that exactly anymore that's why I didn't post it.

    But here it is if it helps, I followed all the rules from that website and the only difference is that this is for a single connection as you were doing instead of multiple connections like they do.

    At the moment checks the exact components and wires from the string of the Global variable but you can change it easily to check just the components instead.

    https://www.dropbox.com/s/8x21lj85u7e0eef/electric%20circuit.capx?dl=0

    Also, you have a debug txtbox that shows you the solution and the current Progress going in both directions

  • I see

    Thanks RBuster

    I am not sure if you checked the example of AllanR, which has the solution practically ready. It would only be necessary to check the wires (items 2 and 3)

    I was asking to see if you just go that route because is the only choice that they gave till now or you were looking to do that from the beginning as the website you linked it works totally differently. Also if anyone would want to help I think it will be easier for him to create his own version than try to understand the code of someone else to add on top of it, as that will take much longer than start a new fresh project which you will have more control and it will be much easier to modify.

    Why you didn't go like the website route I think it works quite nicely? and all the Rules are there to follow as an example

  • Hey guys

    I'm still stuck here. I just need to know how to create a verification system that checks wires and components to see if they are in the correct order and if the wires are all connected to them and how to know if a wire is disconnected from any component or not. Could someone help me, please?

    mm, Im a bit lost as it's not very clear now what is your goal, after reading the comments I'm lost as to if you need to check the wires or not?

    In one comment you said that you just need to check if the components are in order when you close the circuit but after that, you mention that you need to check the wires? what do you need to check the wires for?

    So for what I see is:

    1-You check exactly the order of the whole circuit including (Wires & Components) mean it can end up looking like this the correct Answer:

    Switch,Wire,Wire,Resistor1,Wire,Resistor2,Wire,Wire,Wire,Battery,Wire,Fuse,Wire,Wire,Switch

    Or

    2-You can omit completely the wires and just check the components if they are in order, so it can end up looking like this the correct Answer:

    Switch,Resistor1,Resistor2,Battery,Switch

    But Note: here there is the possibility that it could be just one Wire in the whole circuit and it will be a valid Answer if they are in the exact order the components.

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

    Another question is, are you following the Example from the website that you linked to or not? because on that website it's totally different than the one you have as it allows connecting components together. But it doesn't allow to close the circuit if there are only components for example. The Components are also easier to connect as they have one Node at the Left and the other at the Right so all the wires and components follow the same model to make it easy to (connect and rotate) but your battery has the Nodes on the side and the corner its different connection.

    The same for the voltage you said you need to check it and then no

    Still, so many questions unclear maybe that's why it's more difficult to help you, see if you can simplify all that you need.

    and if the wires are all connected to them

    What do you mean exactly? do you check each component if it has a wire? or something else?

    and how to know if a wire is disconnected from any component or not.

    This is not very clear swell, do you mean that you constantly check each component that has wire? if so why?

    Because if you just check if the Awsner is valid it will tell you if all are connected right or not, you don't need to check individually each component unless you do something else.

  • I see,

    I haven't tried yet but I think it looks like if you just follow the order of the objects of how it should be connected and don't bother about their Angles it will be the easiest like this. since you allowing Rotation.

    but not sure because I haven't tried it yet this is just a guess, it could be other things that can complicate the logic that it's not obvious at the first look, I guess is just about testing and see what is the easiest and the one that gives the fewer complications.

  • Try Construct 3

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

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

    Logically, the user will be able to assemble following the order of the components, regardless of position, but if that can be a complicating factor, as he will see the diagram while assembling, I can ask him to assemble exactly the same structure.

    I see,

    Just to make sure, so you mean this is a valid solution right

    Components and wires cannot be flipped but can be rotated 90 degrees or -90 degrees, that is, they can rotate 90 degrees and return to the starting position.

    Yes, that's why I was asking as you can rotate them at some point it will be flipped, or at different Angles so is that matters or you just looking for the right order?

    Example

    Are this a valid solution even if they are connected in the right position & order?

  • Nice Fun Puzzle to solve))

    How will I know if the 5 components are connected by wires and following the correct order?

    There a few questions still not very clear

    1-Can you solve in the same order but rotated

    Example:

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

    2-Can the pieces be flipped?

    Example

    And The same for the battery:

    And the same for rest of the pieces

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

    3-Is The correct solution just about the order that is connected or Both (Order & Angle)

    Example:

    The Switch from your picture is connected this way

    But what happens when they connected it in the right order but is rotated like this

    Is that a valid solution?

    The same for all the other pieces

  • I think there is something wrong with the project as I tested it on my (iPhone 8 plus) and it runs at

    Fps: 40

    Cpu: 3

    In both test (Physics & Move)

    The iPhone 8 It's a very powerful phone and normally runs any game at grate performance with minimum effort so its the first time I show it run that badly, I tested it with Worker (On/Off)

    It has to be some kind of bug I don't believe it can run that bad with two objects

    Also, I teste with (r234.4 & r237)

  • I did the same test in auto mode with R236 and it did go through 1000 Attempts and it didn't fail even once so I think ist been fixed.

    The only thing that I'm thinking is if it's been fixed by accident it could come back in the future if they didn't find the source of the problem so I hope it doesn't.

    Here is the capx if anyone wants to do more test, is the same one that Grimmy posted just modified it to go in auto mode

    https://www.dropbox.com/s/qn8wlxusyr2j1xx/ajax-fail-example_3.c3p?dl=0

  • I Love when you open to trying new tech to improve the Engine that gives a lot of hope for the future even if it fails but at least you try, which gives more trust and security that you trying all in your capabilities to improve your engine.

    PS:

    I hope you can try new tech for the "Android" side swell as is much needed desperately as it's deteriorated quite a lot recently. :)

    Thank you for your hard work

  • I took the example that "Grimmy" posted on page 2

    And I can confirm that it fails with (Worker On or Off) but it took a lot of tries to start failing at first and it was more random instead of waiting the 30secs as the instruction mentioned.

    Example:

    My failings fail after just wait 1 sec or 2 or doesn't matter how many I just keep travelling from one layout to the other until it fails, some times takes more than 50 tries back and forwards but it will fail 100% on all the attempts, at least for me I manage to reproduce it like 8 times.

    Another note is that when it fails it will fail forever even if you change the layout and come back it will still fail every time, so it will reset only if you hit preview again.

    I hope they can fix this issue as urgent as possible as a lot of users heavily use Ajax like me or it will brake many Games.

    Error that C3 prints on preview:

    Console Error:

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

    Video Worker mode On:

    https://www.dropbox.com/s/0s5jym4zi2zeqj1/ajax%20fails1.mp4?dl=0

    Video Worker Mode Off:

    https://www.dropbox.com/s/xz8tsplr62nsmdr/ajax%20fails2.mp4?dl=0

  • You can add a few Actions:

    -Event 12 after you create the laser you can add a move in front of the enemy Action for that lasers

    -Event 18 you can add an action move to the Top of the layer to the enemies so the new enemies they are always on top of the layer as if they where Spawned

    Like this:

    https://www.dropbox.com/s/vazqidentphzjsz/lasers3.capx?dl=0

  • OMG WOW!!!! I seriously didn't expect you to create everything for me...! THANK YOU SO MUCH YOU ARE MY HERO

    I almost feel guilty to use this lol

    No worries it was easier for me to make it than if I had to write it down as it will be some back and forwards explaining. ))

    Glad you fixed

    Ho I upload yesterday the capx that I didn't clean by mistake so you have there a few conditions that it doesn't do anything really, if you can redownload please from the same link, I apologise for that, it should be correct now. Is the same thing I just removed the two conditions from event 14 as it was meant to calculate the laser (Width & Angle) from the enemies but I changed the last minute to calculate it from the laser (X,Y) instead, as they were pinned anyway avoiding extra checking.

    Good Luck

  • I see

    I didn't know you had problems with the movements swell

    You can Pin the objects and set the Angles

    Here's one way of doing it see if it helps:

    If I understood when the player touches the little circle (PowerUp) you create the laser for all the enemies on the screen and after 3 seconds you destroy the enemies that were touch by the laser only, plus the lasers, but not an enemy that came after.

    https://www.dropbox.com/s/t2943jh9wti041t/Lasers.capx?dl=0