AllanR's Recent Forum Activity

  • I can't see what the function does, but since it is called from the same "On start of layout" event, any objects created will not be fully created until the next top level event.

  • Yes, that is normal. When New instances are created they are not fully created until the next top level event is reached.

    You can use Pick last created, or Pick by UID, but other methods are not available until the event that created the instances completes (which includes branching to functions).

  • another thing that confused me in the past was the Date.GetDay is day of the week (0-6)

    Date.GetDate is the day of the current month (1-31)

    so make sure you use GetDate, not GetDay

  • ok, took some reading and testing, but it can be done - it just isn't as obvious as I expected.

    back in C2 I used to manually add or subtract a days worth of milliseconds (24x60x60x1000)

    but with the C3 Date plugin you can use the .ChangeDate (or .ChangeSeconds, etc...)

    the part that confused me for a bit was that you can't just say -3 for 3 days ago.

    (Today = Date.Now in following examples)

    if you say PastDate = Date.ChangeDate(Today, 0) the 0 means the last day of the previous month. So -3 means three days prior to the last day of last month, not three days ago from today.

    so, to get "3 days ago" you have to say PastDate = Date.ChangeDate(Today, Date.GetDate(Today) -3)

    or for two weeks from now you say NewDate = Date.ChangeDate(Today, Date.GetDate(Today) +14)

  • how do you need to format the date? I use the C3 Date plugin, and a function that takes a timestamp and a format string similar to what I use in PHP... no scripting or 3rd party addons required.

    https://www.rieperts.com/games/forum/FormatDate.c3p

  • have you tried right clicking on a blank area of the eventsheet, choose "Event Sheet" (at the bottom of the pop-up menu), choose "Font Size" and then click Reset.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way it is now the wires need to be there, they just don't factor into determining if the circuit is correct or not. The same thing would apply to testing voltage - you would have to know what each component does (adds or subtracts from what it inherits from the previous component). For wires, they would have no effect other than passing on what voltage they receive (if any).

    will you need to have more than 1 battery? I would need to know what effect each component has on voltage passing through it - Fuse, how much before it breaks; resister, how much it resists; battery, how much it provides...

  • all your enemies should be in a family, and the health variable should be on the family. Then one event can pick enemies with health 0. And then a sub event can do a for each enemy to call the appropriate death sequence (which can also be set as a family instance variable).

  • I just updated the previous file - it now has a global string of what components are required in the circuit. So you can change that for different circuits.

    Every time it checks connections it starts with the first component in the Answer variable and checks if it is in a circuit that loops back around to that first component, and checks if the circuit has the correct components in the correct order. It doesn't include wires in the solution, and doesn't check if components are wired in frontwards or backwards...

  • it shouldn't be hard to have it check a correct answer for different circuits once the linked list of components is properly maintained... one thing that is probably significant is how a component is wired in. Things like batteries and resisters would have to be connected the correct way (not reversed). Right now I changed all the components so that imagepoint 1 is on the left and imagepoint 2 is on the right, so that could be considered positive and negative respectively. I have some ideas on that and the animation, but wont have much time today...

  • I just updated the file, so re-download it from the previous link.

    I added wire cutters - if you drop them on a connection, it breaks it.

    I also added a connection value field. Component connections have a value of 1, wires a value of 0. When you attempt to make a connection, the total value must be less than 2. So, that means components can't be directly joined together. (although I think that should be ok, and the example you linked to allows those types of connections.)

    I didn't do anything about the double battery connection - if the connectors line up, it allows the connections. at least now you can cut one... it would be hard to tell which of the two the user wanted to connect.

  • well, that turned out to be a much deeper rabbit hole than I expected...

    I made each component a "Node" (renamed Family1 to NodeFamily), and after looking at the Circuit project at the top of the thread decided we needed to add an Connector object as well, because you can drag Nodes or you can drag the connection point.

    so, after a lot of debugging, infinite recursive loops, and strange side-effects, I think I have the connecting of Nodes working pretty well. Right now the Connector objects know how things are joined together, but the Nodes themselves don't build a proper linked list that would be required to test the logic of the circuit...

    drag Nodes or connectors until they overlap (the connectors will turn blue), when you drop the object the connection is made. Right now there is no way to break a connection. And each connector can only make one connection (unlike the example Circuit project linked at the top). My code needs a lot more comments to be readable! and it probably could be cleaned up now that it is mostly working.

    https://www.rieperts.com/games/forum/NodeConnect.c3p

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-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
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies