AnD4D's Forum Posts

  • I would like a system that can find all of the whole number divisions of each number.

    E.g's

    10 = (1,2,5)

    15 = (1,3,5)

    28 = (1,2,4,7,14)

    The only save number I can figure out is 2.

    Rounding up or down won't work.

  • Hi guys,

    Sorry if this isn't really the correct place for this, but I tried looking online for a solution, and can't find it anywhere, and the things I've seen people pull of with numbers on this forum are incredible.

    I'm trying to set up a system that will work out the division of a number, and so I have Var1/Var2=Var3, but I only want to use numbers that will divide into whole numbers. I have therefore set it up so that it will only show me even numbers, and to do this, I used the expression choose(2,4,6,8...) as the first variable, and then 2 as the second, as that is the only way I can guarantee a whole number.

    I thought about having a system that would divide the first variable by 2, and then generate randomly from 0 to that figure, but I knew I'd end up getting decimals (10/4=2.5).

    Is there an equation that would choose numbers that would generate a whole number as a result?

    Division Example

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I thought bumps were supported by the developers so that new users can see these.

  • Wow! Thanks I'll look into this. Very clever... though I barely understand it. Never used parameters before, nor the ? or : symbols in expressions. Still got a lot to learn.

  • vee41, Brilliant! I didn't know about choose. That will come in useful :) Thank you very much!

  • If I disable the "Trigger Once" command, the event loops, and quickly changes the numbers. If I press 1 or 2 on the keypad, it triggers once, but the event changes. Why does this not work?

  • Instead of having a global variable like that to handle things, why not put the function calls directly at the event that is triggered by the spacebar press?

    Thanks, I tried that and it didn't work <img src="smileys/smiley36.gif" border="0" align="middle" /> I also tried having the variable switch to another number before picking a random number, but it didn't change anything.

  • I'm having trouble with something. In the example I'm adding, please can you just press space, and let me know what you see happen.

    The numbers are meant to change each time, but they only seem to change when it switches between odd and even (You'll understand when you load it).

    I've tried it a couple of different ways, and it's just not working. The code in question is shown at the bottom, events 3 to 30.

    Link

    Help please!

  • I feel you may need to start off smaller if you want help.

    Instead of asking how to make a whole game, try asking smaller questions, such as, "How to place buildings on a map".

    You'll get more help that way.

  • Also, to fix the first issue, using RawAxis creates a better result. Looks like this could potentially sort things out for me, but it's a little more complicated than I expected.

    C2 is obviously spoiling me <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Lol! If you start a new post, you get bounced to this one.

    If you raise a thread from the dead, you get called up on it.

    Can't win with some people <img src="smileys/smiley1.gif" border="0" align="middle" />

    I for one hadn't seen this thread, so thanks!

  • RamPackWobble

    It's nearly there, but for some reason the main 90 degree angles (up, down, left and right) have a dead zone to them of around 15 degrees. I also can't figure out how to sort it out so the number doesn't change when you don't move the stick.

    I guess this behaviour still needs some tweaking?

  • RamPackWobble

    Thanks, I noted that when I have is as set to it worked fine, but it's not the effect I want. I'd like the sprite to be able to rotate toward the direction of the stick, rather than just pop in the certain direction. Maybe I could try lerping if that's not working for me.

  • jayderyu

    I can't get this working with the rotate to command. Do you mind having a look at the example I put above (I stupidly highlighted as "Wha?")

  • Hmm, not having much luck with that. Also, is it right that I have to push a button on the controller before the rotating even begins?

    Surely there's an easier way to do this.

    Rotate sprite angle to gamepad right analogue stick angle.

    Wha?