usbtypec's Forum Posts

  • It works! Thanks for such a quick response btw

  • So I have a weighted button in my game that requires a minimum of X creatures overlapping it to press it. It works mostly as expected, but when I have multiple instances of the button, as long as at least one is overlapping it it checks all instances (So if button A is overlapping 2 creatures and button B is overlapping 1 creature, both buttons count it as overlapping 3)

    How do I fix this?

    Here is a screenshot (Ignore the disabled events, that was a different method I tried with the same results) Note that the animation frames being set to 1 or 0 just means pressed or not pressed, respectively.

  • Oh yeah I forgot about containers.

  • I don't know if this would be 100% working, but you could try

    FLASHLIGHT > Is Pinned (Inverted to make Is Not Pinned) & Overlapping ENEMY > Pin FLASHLIGHT to ENEMY.

    Since it is only picking the instance it is touching, this should work, UNLESS one flashlight is overlapping multiple enemies.

  • So I'm making a small natural-selection sim and need to make offspring inherit variables values from parents.

    However, I have no clue how to do it. The biggest obstacle is instance selecting, since the way (I hope) the inheritance goes is that for each stat (speed, sight, etc) it would pick one of the parent to inherit that from (so if one parent has a speed of 150 and the other 170, the offspring has a 50/50 chance for 170, repeat for other stats). However, how would I pick between parent A, parent B, and the offspring?

    Or would it be easier to convert it to a sort of mitosis, where the parent just duplicates?

    Thanks in advance.

    Tagged:

  • Check out the Ceiling Trap example in the Example Browser, it may help.

  • So I am making a game similar to Angry Birds, and I have a text object that shows how much damage was done/score gained whenever a damaging collision happens. However, since there are so many collisions, a huge amount of the text objects appear. So I was wondering if there was a way to check if two damagetext objects are close to each other, destroy one and add the number it had to the other (as in if a 50 and 200 are close, destroy one and make the other 250). This would help clear the clutter.

    How would I do this? Thanks in advance for help.

  • Nevermind! It's fixed.

  • Ok, I'll try that then. The reason I thought I couldn't pick just the one instance is because lets say the player had 2 spheres, then got a third. The first would be offset at 0, and the second at 180 (which would be correct)) but then getting a third and only moving that one would make it something like 240, and the others wouldn't move.

    But yeah, I'll see if that fixes it. If not, I could just have an id variable for each sphere and just check "If spheres = 2" & "id = 1" it would be handpicked with events.

  • Wouldn't that just select all instances though? I'll still try it, I just don't know a huge amount about loops.

    Edit: Just tried it, didn't work.

  • So I am making the upgrades for a game of mine, and one is a sprite that orbits around the player similar to the Satellites from Magic Survival (or the Guardian from Survivor.io).

    The problem is, when the player has multiple spinners, I can't get them to evenly space around the player. As of right now the way the code works is that if the number of spheres is below what the player should have (since they can get more), it spawns another sphere and respaces all with a function (the function is so it doesn't keep the same instance selected)

    However, it doesn't work. Can someone help? (Event screenshot is below)

    spheres is a variable btw

    Tagged:

  • METHOD 1 - Just have two different goal objects and each goal will award the team when it goes in. (So RedGoal awards blue, BlueGoal awards red)

    METHOD 2 - add a new Global Variable (I'll call it LastTouched)

    On RedPlayer Collided with Ball -> Set LastTouched to 0

    On BluePlayer Collided with Ball -> Set LastTouched to 1

    Then when a goal is triggered, check if LastTouched = 0. If so, award red team. Otherwise, blue team.

    Note METHOD 2 means that scoring in your own goal would award the wrong team.

    Note that this does assume you already have the ball-deflection thing working, this is just for awarding the correct team for scoring.

    (btw I am assuming you mean football as soccer and not american football)

    Let me know if any other assistance is needed.

  • Honestly I'm a bit lost as well. I know how to store the rooms and stuff using arrays or JSON, but getting infinite storage is what the problem is. You could probably have an array of your JSON data, each storing one board, and then if it fills up you can expand the array for more slots.

    As for getting variables from JSON, you would probably have to load the data into an array and check a specific slot to find a number, however I have never done something like this so I'm a bit confused as well.

  • I don't know much either, but this may help a bit

    construct.net/en/forum/construct-2/general-discussion-17/chowdren-fast-construct-134395

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It may be better to ask someone more experienced than me, but your best bet is probably arrays. If you need to save a larger amount of arrays/levels, you could change each array to JSON format and save the JSON data in another array (So RoomsArray Slot 1 would be the data for Room1, etc)

    This may not be as reliable, but if you used the Advanced Random, since it will always generate the same random numbers, it would generate all the rooms the exact same way.

    Hope this helps, if not tell me or ask someone better (like dop2000)