noisetank's Forum Posts

  • So, I'm still fairly new to Construct and even more new to the paid version, so I'm having a bit of difficulty figuring out how to properly implement the Families feature.

    First, some background:

    The main character of my game has an invisible sprite with platformer behavior and a visible sprite with all the animations (walking, running, jumping, shooting, etc) set to the player's position every tick. To trigger these animations, I use the player object's platformer events to change the player_sprite object's animation (ex. If player is on ground and player is moving, set player_sprite animation to run).

    NPCs (be they enemies or friendlies) will generally follow the same set of rules. They may not have quite the same range as the player, but they'll still have the basics (walk, run, jump, shoot, etc) that will trigger much in the same way (if object does platformer event, then visible sptrite does animation).

    What I'd like to do:

    Setting up individual events for every character would be a pain. So instead, I'd like to use families to simplify things and make it SUPER easy to add new characters on the fly. I've been careful to use the same naming conventions across character animations ("Walk", "Run", etc) so there's no issue there, but the think I'm REALLY struggling with is how to select which animation sprite belongs to the picked object sprite.

    As I said, the object that actually MOVES is SEPARATE from the object that the player sees animating. They have no actual connection to each other as far as the game is concerned, aside from the "set sprite to object every tick" event (which still doesn't mean anything to Construct).

    What can I do to make it so this works?

    To summarize the intended functionality with an example event:

    If Character family is jumping, set picked object's animation sprite (which I have put in an Animation family) to "Jump". Making this event will currently just make EVERY character sprite play the "Jump" animation, rather than find just the one that belongs to the acting character.

  • Oh, okay. I think I'm starting to understand the usefulness of functions now. Passing Left/Right/etc to a Move function really cleans things up.

    As for referencing all players...Families are only available in the paid version, correct? I might have to invest. I think that's exactly what I'm looking for.

  • Alright, I took a swing at functions...I'm not sure if I'm following your example correctly, but I don't know if this is going to save me all that much as far as copying events goes. Here's an example of what I've done so far:

    i47.photobucket.com/albums/f173/kitsune37/functions_zpsb74e5e22.png

    Is there a nicer way to clean this up? Otherwise it doesn't seem much more efficient than what I was doing already.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aceofpack

    Four controllers on one computer.

    justifun

    Alright, I think Functions were exactly what I was looking for. I'm still not 100% sure how to use them properly, though. Here's a (hopefully) clearer version of what I have set up:

    I have four blank player sprites (named Player0, Player1, Player2, Player3) placed on a layer by themselves. Each one has a "Controller" variable to match their number (0-3).

    When a stage starts, it spawns as many of these player sprites as needed (Player0 for one player, Player0 and Player1 for two players, etc) and pins the selected character animation sprite to each (this might be another issue entirely, but I'm also not sure how to handle two players choosing the same character sprite).

    Now, I have events created for controls and animations, all referencing Player0. What I'd like to do, as opposed to copying these events for each player, is to have a single set that is smart enough to pick up on which controller is sending inputs and move the matching player sprite. I'll also have to set this up for animations and a dozen other things, but I think if I understand how to set it up for controllers, the knowledge will apply elsewhere.

    I'm going to play around with Functions a bit and see if I can get the desired result, but I thought I'd at least take a moment to clarify and thank you both for being so helpful. :D

  • EDIT: My topic name might be a bit misleading...I actually worked out half of the problem while typing that post...here's some clarification:

    I've created four Player sprites (Player0, Player1, Player2, Player4) on a blank layout, made them global, and I create them as needed on the start of a stage. Each one has a "Controller" variable with the same number as in their names. I want to use a single block of actions for all four player characters by matching the gamepad number with the "Controller" variable from the corresponding Player sprite.

  • I'm looking to create a game similar to Super Smash Bros, where four players fight in an arena setting. The issue I'm wrestling with at the moment, however, is how to streamline the addition of new characters for up to four players.

    Ideally, there's a character select screen with a number of characters available and four players (using gamepads) can select whichever one they like (even the same one multiple times). The problem I'm having with this is I don't know how to create four copies of the player sprite that can each be controlled and animated separately by each controller.

    I could do this by copying the basic control/animation functions four times for every single character, but that seems insanely time consuming and terribly inefficient (I'll have to repeat the process each time I add another player). Is there a better way?

    The way it works in my head is that the number of the controls would be relative to which number player sprite is moving. I can set this for the controller movements by giving each of the four player sprites a "Controller" variable numbered 0-3 and then making a function referencing the "Player.Controller" variable (so one event works for all four controllers), however, I don't know how to make it figure out which player to move.

    As it stands, it seems like I can only pick a single object to create the action from, rather than making it use "Player(Controller.Player)" or something to that effect (so Player0 is moved when controller 0 is pressed, Player1 is moved when controller 1 is pressed, etc).

    Sorry if I didn't explain my issue well, I'm still pretty new to Construct. Can anyone understand my problem and maybe help me find a solution? It would be greatly appreciated, especially since I don't want to get too deep into working on other aspects of this game if I find out that local multiplayer isn't feasible. D:

  • Is there a workaround for this? I'm having the same issue and I have no idea how to fix it.