New to Construct

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hello, I found Construct after watching that amazing Metroid remake, Minitroid. I've been working with Construct and I'm loving it! I'm currently testing my abilities and also learning from Platform School as well. Could some of you check out my example and tell me how it's looking? Thank you.

    http://www.mediafire.com/?ds9imdshh2pghye

    PS: I'll use this topic to ask questions as well.

  • 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.

  • 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.

    Thanks! I'm really enjoying all the little things that Construct will let me do.

    I do have a few questions actually:

    Is there a spot to implement Global Variables? I'd like to have a running tally of each "Enemy" in the game, so that when it's down to 0, you win the game.

    What's a good way to do a transition between 2+ layouts? Can you do this with 2 doors, 1 in each room to take you into the other? If so, how best would this be accomplished?

    Sometimes my character or one of the enemies will be sent outside of the room, how do I fix this neither of us can leave the layout? Also, sometimes the physics will get wacky and when an enemy pushes me up or down through a platform I teleport through it, any method to alleviate this issue?

    Thanks.

  • Is there a spot to implement Global Variables? I'd like to have a running tally of each "Enemy" in the game, so that when it's down to 0, you win the game.

    When you go to select your objects, for actions and such, choose the system object. It has global variables. Just make an action. System-Set Value

    For this particular case though, unless you don't really have all those enemies there, are you're making like a wave of enemies and behind the scenes you're creating them offscreen or something, There is actually a System expression that counts objects CountMatching(objectname). it counts the objects currently picked, so if you don't have any type of picking condition before you use that expression it will just count all the objects of that type in the layout

    [quote:19ilh352]What's a good way to do a transition between 2+ layouts? Can you do this with 2 doors, 1 in each room to take you into the other? If so, how best would this be accomplished?

    I've never worked with multiple layouts other than quick experiments so I'll leave that one to someone else

    [quote:19ilh352]Sometimes my character or one of the enemies will be sent outside of the room, how do I fix this neither of us can leave the layout? Also, sometimes the physics will get wacky and when an enemy pushes me up or down through a platform I teleport through it, any method to alleviate this issue?

    first question is do you mean physics like the Physics behavior? or just the general sense of the word physics and you're using the Platform behavior? if physics behavior what actions are you using to set the speed or strength of the enemy? If platform, what actions are you using to simulate pushes?

  • >

    > Is there a spot to implement Global Variables? I'd like to have a running tally of each "Enemy" in the game, so that when it's down to 0, you win the game.

    >

    When you go to select your objects, for actions and such, choose the system object. It has global variables. Just make an action. System-Set Value

    For this particular case though, unless you don't really have all those enemies there, are you're making like a wave of enemies and behind the scenes you're creating them offscreen or something, There is actually a System expression that counts objects CountMatching(objectname). it counts the objects currently picked, so if you don't have any type of picking condition before you use that expression it will just count all the objects of that type in the layout

    [quote:3mb7a0r8]What's a good way to do a transition between 2+ layouts? Can you do this with 2 doors, 1 in each room to take you into the other? If so, how best would this be accomplished?

    I've never worked with multiple layouts other than quick experiments so I'll leave that one to someone else

    [quote:3mb7a0r8]Sometimes my character or one of the enemies will be sent outside of the room, how do I fix this neither of us can leave the layout? Also, sometimes the physics will get wacky and when an enemy pushes me up or down through a platform I teleport through it, any method to alleviate this issue?

    first question is do you mean physics like the Physics behavior? or just the general sense of the word physics and you're using the Platform behavior? if physics behavior what actions are you using to set the speed or strength of the enemy? If platform, what actions are you using to simulate pushes?

    1. Awesome, that CountMatching works perfectly! Now when all of them are dead, you get the You Win text!

    CountMatching("Enemy") <= 0: "Set text to "YOU WIN""

    3. Essentially, the enemies and myself have the attribute "Solid" and no physics behaviors. It seems to work fine, except for the teleportation.

  • does the character need the solid for anything? if not, take it off the character...same with enemies unless they have some reason to use it

  • does the character need the solid for anything? if not, take it off the character...same with enemies unless they have some reason to use it

    Pretty much to make sure that bullets and missiles don't pass through it.

  • why not just do on collision with whatever. they don't need to be solid. the solid attribute is so things with behaviors such as platform and stuff, know what they can stand on and go through, etc. if you just want to make something happen when it hits something

    just use the on collision condition

  • why not just do on collision with whatever. they don't need to be solid. the solid attribute is so things with behaviors such as platform and stuff, know what they can stand on and go through, etc. if you just want to make something happen when it hits something

    just use the on collision condition

    Alright. Removed the Solid attribute from the enemies. While I was doing that I implemented a shotgun too(Press F). Check it out:

    http://www.mediafire.com/?8h8a7p4bx0xfdl9 (Another New Platform file, last one didn't have music or the Solid attributes unchecked or various collisions properly implemented. Apparently crashes don't save anything for your game, SAVE YOUR APP AFTER EVERY CHANGE!)

    Also found an awesome little tool for 8-bit sound FXs: http://www.superflashbros.net/as3sfxr/

  • Alright, now I'm trying to do a Weapon system, where you press a key and your weapon changes, like this:

    Current Weapon is bullet

    Pressed key D: Weapon changes to shotgun

    Pressed key C: Shotgun shoots

    How would I go about this?

  • 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.

  • Dang, I've done just what you've said, but I'm doing something wrong. Even though all 3 choices are under the Trigger Once condition, it will simple go back to default. I've got it set like this and I know what's wrong, but I don't know how to fix it currently:

    + input: On player 1 pressed "Change Weapon"

    + System: Trigger once

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

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

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

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

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

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

    It pretty much goes through each condition and sets them correctly...right back to bullet. How do I fix this?

  • 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.

  • i think it would be simpler to just use numbers

    [quote:3235mgqm]weapon = 0

    you know for yourself, and in your comments which number corresponds to which weapon

    [quote:3235mgqm]on player pressed Change Weapon

    add 1 to player('weapon')

    if player ('weapon') is greater than the highest number you have defined

    player('weapon') = 0

    so it'll loop around to the first weapon...much cleaner and easier to maintain. just two little events that won't change no matter how many weapons you add

    I think just using numbers and comments is fine, you can copy paste a little comment chart or the relevant parts wherever you need it, like here's your comment block for the event that increments:

    remember this is just a comment field that does nothing except let you read it and remember

    [quote:3235mgqm]0=pistol

    1=shotgun

    2=chainsaw

    3=friendship ray

    then on the event where you have

    if player('weapon')==1 or whatever

    you can have a little comment that just says

    [quote:3235mgqm]1=shotgun

    if you're against comments like that for whatever

    make a bunch of global variables

    one called shotgun with the default 1

    one called chainsaw with the default 2

    etc

    and just never change those variables, so they'll be constant

    then your events won't need comments because they'll look like this:

    [quote:3235mgqm]if player('weapon') == global('shotgun')

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)