SullyTheStrange's Forum Posts

  • (Hopefully I get this one right >.>)

    With the "currentWeapon" sprite, you can have multiple frames, each one being a sprite of a different weapon, and set the animation speed to 0 so it'll never actually change frame on its own. Then you manually tell it which frame to go to based on the value of 'weapon', so if 1 means shotgun and the second frame of "currentWeapon" is the shotgun sprite, say this:

    + player: Value 'weapon' Equal to 1

    -> currentWeapon: Set animation frame to 2

    and so on and so forth.

  • Generate a random number from 0 to 10 and then add 10 to the result, effectively changing the range from 10 to 20. It works for that simple example, at least.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeahhh, numbers work too. I got myself into the habit of using text now that there's way too much stuff to remember by number, so that didn't even occur to me. My bad!

  • Yeah, that can be a problem sometimes. The easiest thing to do that I can think of is to make another variable called "Change" or something and add it in like this:

    + input: On player 1 pressed "Change Weapon"

    + System: Trigger once

    + System: player ('weapon') Equal to "bullet"

    + player ('change') Equal to "0"

    -> player: Set 'weapon' to "shotgun"

    -> Set 'change' to 1

    + System: player ('weapon') Equal to "shotgun"

    + player ('change') Equal to "0"

    -> player: Set 'weapon' to "missile"

    -> Set 'change' to 1

    + System: player ('weapon') Equal to "missile"

    + player ('change') Equal to "0"

    -> player: Set 'weapon' to "bullet"

    -> Set 'change' to 1

    And then set it back to zero. That limits it so that it can only pass through one of the conditions rather than all three.

  • You should use what they call a "state machine", which can be set up something like this:

    Weapon (player's private variable, default) = "Bullet"

    Pressed key D

    Trigger once

    • If Weapon = "Bullet"

    -> Set Weapon = "Shotgun"

    • If Weapon = "Shotgun"

    -> Set Weapon = "Bullet"

    Pressed key C

    • If Weapon = "Bullet"

    -> Shoot default gun

    • If Weapon = "Shotgun"

    -> Shoot shotgun

    Might take a bit of tweaking to get it to do what you want, but something like that should work fine.

  • Animations act a bit strange sometimes. You definitely don't ALWAYS need a Play Animation action, unless you're always pausing it or something, but sometimes it seems to be necessary. Not sure what's up with that.

  • For just starting a few days ago, you're doing very well so far. Looks like you've got a grasp on all the basics. I only started a few months ago myself, so I know how confusing things can be once you start getting more advanced -- don't be afraid to ask for help, there's a great community here.

    So, welcome to Construct, and good luck on your future work.

  • I just noticed that all this time, I've been completely ignoring the former in favor of the latter. I guess it's easier for me to differentiate between "Equal to" and inverted "Equal to" at a glance because of the red symbol, when I'd otherwise have to look closely for the "Not".

    So I randomly got curious -- which one do you guys tend to use?

  • Ahah, works beautifully. Thanks.

  • I know this has had topics in the past, but the last useful one was from 2008 and, well, I'm hoping things have changed since then.

    You're probably familiar with the issue, but just in case, it's when you're standing on a platform moving vertically and the player is constantly jittering instead of being attached to the top of the platform. I'd like to stop that. Has any concrete fix been found for it yet?

  • I'm interested in this fix too, and I have no idea what the "svn" is or where it can be found on source forge. Can someone point me in the right direction?

  • I love the mountain of indie platformers, personally -- I mean, it's the only way the genre gets any love nowadays outside of new Mario games, more or less. But hey, I'm a platformer junkie.

  • Awesome. Altered a bit for what I need, and it works perfectly. Thanks!

  • Okay, after fixing a handful of other issues, I can finally get around to doing this. And, uhh... that's quite an explanation.

    I more or less understand most of it now... The way I'm doing it, though, is to have it set to display the contents of a variable constantly rather than every 200 ms. Would I need to destroy and recreate each digit every tick?

  • I got the idea earlier that it might be the camera (using MagiCam), but I couldn't see what the problem might be... At your suggestion though, I went back, looked at it, change one tiny thing, and it hasn't happened since. Killed myself twenty times in a row and it restarted perfectly every time.