Anthracite's Recent Forum Activity

  • Hi there, back again for a little advice and a hope that I'll be pointed in the right direction as I'm sure I'm thinking about this incorrectly.

    In our project we have the functionality for the player to have multiple weapons. These weapons are collected during the game and a boolean is set to true for each one that is unlocked. There's six in total.

    The current weapon is stored in a string called "costume_name"

    When the player presses a button we would love it if the player cycles through the unlocked weapon boolean

    So if the current "costume_name" is X and the player has already unlocked Y (that boolean now being true), when they press a button the costume_name variable is changed to Y.

    However, if they haven't unlocked Y (as in the boolean isn't true) but they have unlocked Z (that boolean is true) then the "costume_name" is set to Z.

    And the cycle continues so the player can tap a button and quickly cycle through the unlocked weapons.

    This is what the code looks like currently, but it just doesn't add anything to the costume_counter

    Thank you, hopefully I explained myself well enough here.

  • Figured it out, but wanted to post so any people trying this could find the answer easily.

    So when the platform was moving to the left, the Platform_Moving_Small instance variable was -47 ... essentially this was making the player object move in the opposite way so I used ABS to turn it into a positive number and boom it works.

    The event looks like this ...

    + Platform_Moving_Small: Speed < 0

    -> Player: Set X to Self.X-(dt×(abs(Platform_Moving_Small.Speed)))

  • Thank you both for replying AllanR and dop2000

    Unfortunately I can't share a project, as it's almost a full game.

    The code looks like this ...

    However, when the player object stands on the platform_moving_small object, the player doesn't move with the platform. Very odd.

    If I change the movement of player X to look like this

    The player moves fine (as 47 is the Platform_Moving_Small.Speed instance variable)

    But this leaves us with only ever having one speed for platforms. So how can I use the speed instance variable with this Set X ?

  • Thank you so much dop2000, that's so brilliantly simple. You're a genius!

    One final question,

    So when the Player is overlapping the Platform (it's a top down RPG) how do I get the player to move in time with the platform?

    I've tried this (and a few others) to no avail

    Self.X-(dt*Platform_Moving_Small.Speed)

  • Previously we have been using the Bullet Mechanic for floating & moving platforms for a top down RPG and these seem to work fine however, every once in a while they just ignore their rules and disappear off into the ether.

    So I'm thinking about using the Sine Behaviour as a replacement as it's 100% reliable in its movements.

    However, previously we were using this to move the player left & right on a moving platform (that had the bullet behaviour)

    Self.X+dt*Platforms_Moving.Bullet.Speed

    Which works fine, but there seems to be nothing similar to Bullet.Speed that I can use from the Sine Behaviour?

    Thank you in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Gotcha, thank you so much. So I have amended the code and used the Pick by Comparison for each 'Phase' and then a for each underneath this and it looks to be working perfectly.

    Thank you!

  • Thank you for replying oosyrag, really appreciate it.

    So would I place the For Each above all of their phases in one big loop? As when I try to do that it hangs the game completely ... I must be doing it incorrectly.

  • Hi there, thank you in advance for taking a read. Hopefully, I explain myself well enough and don't come across as an idiot!

    So, in our game, our enemy has an instance variable called Phase. We use this to advance the enemy through its various motions, animations and attacks.

    However, we have one location that has three enemies in and all of them act in sync all the time. Regardless of whether the conditions are met within each phase (Screenshot attached)

    In this example, the "OctoSpitter" is meant to activate when you're within a short distance of its X and Y coordinates. However, if one of the "OctoSpitters" does the spitting animation. All of them do the animation.

    How do I correctly make these little blighters act independently?

  • Hi there, not sure why I can't seem to find this. But looking for an action to clear the path from a pathfinding object completely.

  • Thank you for that additional code, I just tried that and it seems to be the thing it needed. As always, utter legend!

  • Thank you dop2000

    So does this look good to your expert eyes?

  • Hi dop2000, thank you so much for helping me with this (and the previous one too!) You're a legend!

    So I have tried using 'Is Between Angles' and 'Is Within Degrees of Angle' but they don't seem to correctly trigger the animations either. Would it be possible for you to lay out your best way of doing this so that all instances on a layout follow the rule?

    Just noticed your BuyMeACoffee Link so enjoy the coffee, and anyone else reading this ... buy Dop2000 coffee :)

Anthracite's avatar

Anthracite

Member since 30 Dec, 2016

Twitter
Anthracite has 1 followers

Trophy Case

  • 7-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

11/44
How to earn trophies