7Soul's Forum Posts

  • RamPackWobble c4sp3r89

    Those are all valid solutions. I'm not used to using local variables so that didn't even come to my mind.

  • c4sp3r89 that's exactly what I said doesn't work

    blackhornet choose() is too limiting, it's useful only if the values are static, and I want to change the percentages chances

    So, this is what I made

    <img src="http://i.imgur.com/tkbQVxI.png" border="0" />

    Basically I have an array with 100 width, and then I fill it with the values.

    Using the example from the first post:

    From 0 to 9 X it takes the value 0

    From 10 to 29 X it takes the value 1

    From 30 to 99 X it takes the value 2

    Now I can pick a random X value from the array, and it is going to be precise 10%, 30% and 60% chances

    Edit: actually I forgot something. The For "second" start index is supposed to be

    max(func.Param(((loopIndex("first")-1)*2)+1),0) + max(func.Param(((loopIndex("first")-2)*2)+1),0)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want a function to return the values 0, 1 or 2 based on a random chance. Let's say 10% 0, 30% 1, 60% 2. How can this be achieved?

    What I would normally do is this:

    on "function"

    random(100) < 10 -> return 0

    random(100) < 30 -> return 1

    random(100) < 60 -> return 2

    But in doing this, the first one in the list will get a significantly smaller chance of happening, as the last ones will replace the final value

    Ex:

    Ok, the 10% went through, and the return value is set to 0. But wait, the 60% chance also went through, so the return value is now 2. So this will cause the 10% to be much less than actually 10%

    I tried using "else", but this has the opposite effect:

    on "function"

    random(100) < 10 -> return 0

    else random(100) < 30 -> return 1

    else random(100) < 60 -> return 2

    So, the second chance will only fire assuming the first one failed, so that causes the second one to only even fire 90% of the time

    EDIT: I think I've found a way... I'll test it and post here later

  • Would it be possible to add atan2 and maybe other forms of interpolation?

  • Nice tip, thx

  • Are you sure there isn't a conflicting event setting the animation to another?

    That's what I think it is, but without a capx we're just shooting in the dark

  • You can use this plugin by rexrainbow https://dl.dropboxusercontent.com/u/5779181/C2Repo/rex_randomgen.html its like the default random but allows for seeds

    Then every time you make something random, it will do it based on the seed, so a "randomgen.random" will always return the same number if you're using the same seed.

    If you do "set level tile to int(randomgen.random*10)" it will give you a number from 0 to 9, the same every time if you use the same seed

  • It's pretty simple actually:

    Always - Play normal animation

    Mouse over button 1 - Play hand animation

    etc

    Since the "Always" event is before the other ones, it has lower priority, so when you mouse over button 1, it will override the "Always" one

  • Hey that's really...

    <img src="http://i.imgur.com/i54lmr2.png" border="0" />

  • Effects are used to give the player feedback. A bomb that causes a powerful explosion will feel better than a bomb that just makes the screen go white.

    Visual effects are as important as sound. A game with no sound feels empty

  • Yes, too fast. In a single tick, the bullet is moving an space greater than the size of the target, going though him. 2400 pixels per second equals 40 pixels each frame, at 60 fps

  • I may participate again :)

  • Ink Octopus, NES restrictions

    <img src="http://i.imgur.com/ApFasak.png" border="0" />

  • How do I load a Tiled map using the Tilemap object?

    Tried all kinds of file formats but nothing works

    <img src="http://puu.sh/5nfFq.png" border="0" />

  • When a tutorial preview text ends in formatted text, all the text after is will be formatted the same. Picture:

    http://puu.sh/5mj6A.jpg