Nitro187's Recent Forum Activity

  • My expression was actually "Compare instance variable" and not set value.

    I'll try your method and report back, thanks.

  • So here goes... I have 4 players in my game... and rather than doing the same exact events for all of them, I decided to do a "for" loop to get everything done in one... which I have done for mostly everything in my game.... however... here is my situation:

    My Player is setup with an instance called "Player" to which 1 - 4 is labeled just that... 1, 2, 3 and 4. My gamepads, being listed from 0 - 3 however (0 being the first) I need to change my for statement a bit, so this is what I have:

    System: For "" from 0 to 3

         Player: Player = loopindex +1 //Gets the proper instance

              Gamepad: Gamepad loopindex D-pad up is down

                  ?Do something

    Directional seems to work just fine for the most part.... But if I try this with buttons:

    System: For "" from 0 to 3

         Player: Player = loopindex +1 //Gets the proper instance

              Gamepad: Gamepad loopindex Button A is down

                  ?Do something

    It doesn't seem to work... or is sparatic, and very un-predictable... completely useless... or just skips over it. What am I doing wrong?

    If I spread it out (not in a "for" loop) it works flawlessly:

         Player: Player = 1 //Gets the proper instance

              Gamepad: Gamepad 0 Button A is down

                  ?Do something

         Player: Player = 2 //Gets the proper instance

              Gamepad: Gamepad 1 Button A is down

                  ?Do something

         Player: Player = 3 //Gets the proper instance

              Gamepad: Gamepad 2 Button A is down

                  ?Do something

         Player: Player = 4 //Gets the proper instance

              Gamepad: Gamepad 3 Button A is down

                  ?Do something

    I've fiddled with this now for two days... and rather than having an extra 300 events in my game, I would rather keep it down to 75 with the "for" loop for my inputs.

    Any help?

  • Yeah, working with only two players can use this method, but I have 8 players, which this technique would not work for. Any other ideas?

  • I'm trying to have my game zoom with the players... and the only thing I've been able to do, is in my attachment... which is extremely annoying, because the player has to get out of view completely before it zooms out, due to the condition I have in place.

    Is there a better way to accomplish what I'm trying to do here?

    Controls are : up,down,left, right, and w,a,s,d

    Thanks so much!

    nitrolic.com/zoom.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to create an object at random intervals for each player.

    For example, when all players are not moving... after 5-10 seconds, I want one of them to drop something off their head... but I don't want them all to at the same time... I want them all to be random, between 5 and 10 seconds rather than all at once.

    What I have:

    System: For each player

    System: Each random(5,10) seconds

    Action: Create object Hair on layer 0 at (Player.X, Player.Y-20)

    What am I missing? They all do it at the exactly the same random number.

  • Thanks man - it worked. Hard to get your head wrapped around the way it works sometimes... but it makes sense now. :)

  • system pick nearest player?

    Never heard of that... nor do I see it... how can that be used in an action?

  • I think I figured it out.... but this may not be the best way:

    Rotate 3 degrees towards (Player(0).X, Player(0).Y)

    only thing is, I'll have to do that four times to each reference of "Player"... sigh.

    Is there another way? At least I have it working... some what.

  • Obviously everyone here should know how to make an enemy follow the player... I currently have 4 players, each with a different instance variable "player"... however, currently this is the code I'm using:

    For Each -> Baddie : Baddie -> Rotate 3 degrees toward (Player.X, Player.Y)

    Which makes the Baddie follow Player instance variable 0... for some reason, rather than all of them. How would I make it, so that it follows the closest one for example?

    I can't even do a "distance(Baddie.X, Baddie.Y, Player.X, Player.Y" because it assumes the first player instance.

    I really don't want to quadruple up on all my events to separately track each player.

    Any pointers?

Nitro187's avatar

Nitro187

Member since 26 Jan, 2014

None one is following Nitro187 yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies