lionz's Recent Forum Activity

  • I don't see any logic that triggers on collision. Anyway your brain conditions run constantly, you need to make it a trigger once choice on collision.

  • Make the cell border larger, and verify that the collision box of the obstacles is the size of the object and not smaller.

  • Such as? When you collide you can pick out the two instances using what I mentioned and then whenever you reference the object it is referring to the one picked.

  • Great, glad it's resolved.

  • You are adding it to a loop but the wrong loop, you need to create a new one as a sub event at the point in time where you need to convert all numbers to int.

  • Hmm again the actions are not added into the loop I mentioned. You should create a new for loop, for from 0 to array.width and add those actions.

  • In a collision or overlap event you can make use of system Pick nth instance, where instance 0 and instance 1 are the two involved in the event.

  • Alright no problem. And just to clarify my first few responses on here are in reference to saving or storing that data. So the tilemaps you are drawing to create the racetrack, you can save the tile positions as a string of data, that's what I originally thought you meant by reusing.

  • If you go to the layout during runtime then yes.

  • By full array I meant all the data available not that it must be full of scores. You can sort it whenever you want but I guess after adding all data which I assume you do on start of layout? I also thought you had done sorting already because you mentioned it earlier? There is an array sort which puts them from lowest to highest, you use this, then you use array reverse to put them highest to lowest.

    As for the int conversion, i said to put it inside a for loop. All this logic can go within the other event you had for filling the array as long as its done after. You use a for loop to run through all scores in the column and convert them to int. You can do this on a button click but you need to add the for loop as mentioned above as a sub event otherwise loopindex does not mean anything.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's fine to use an array for tracking but my point is if you use instance A and instance B of farm, you will still be using variables so the array is just for holding all the data. The idea is on creation of the building you set the array identifier to 1, then increase it in general by 1 (this would be a global variable to compare against), so when you create the next farm the identifier is 2. The identifier links to a row in the array so you can have all buildings in there. As for a log of the days activities you could total up a column of units produced etc

  • Oh yeah that was the issue, sorting. It's been a while so I had forgotten.

    Yes the array needs to be full first, do you know where that logic is and when it has all the data?

    Once full I would use something like this to convert back to int, this logic assuming Y=0 and Y=1 are values to turn back to int :

    System for from 0 to array.width : array set value at xy(loopindex,0) to int(array.at(loopindex,0))

    System for from 0 to array.width : array set value at xy(loopindex,1) to int(array.at(loopindex,1))

    That should convert all the string numbers to ints that can be properly sorted

lionz's avatar

lionz

Member since 5 Aug, 2013

Twitter
lionz has 79 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

25/44
How to earn trophies