CinderFlurry's Recent Forum Activity

  • I've solved the problem already but thanks.

  • Found the issue, completely slipped my mind.

    I needed to add 'random' in front of the first value, it was always going to 100 because it was set to simply '100', instead of 'random(100)'.

    • if value random(100) < 20

    --- compare two values: if random(5) = 1 - Spawn blue gun

    --- compare two values: if random(5) = 2 - Spawn green gun

    --- compare two values: if random(5) = 3 - Spawn red gun

    --- compare two values: if random(5) = 4 - Spawn rainbow gun

    --- compare two values: if random(5) = 5 - Spawn orange gun

    • if value random(100) > 20 - Spawn coin.
  • I think you're misunderstanding.

    Remember, first it checks whether it should spawn a gun or coin.

    To do this, I did:

    Compare two values 100 < 20 = Spawn Gun

    Compare two values 100 > 20 = Spawn Coin

    Meaning the coin has a 80% chance of spawning, and the gun has a 20%.

    If the value is < 20, we spawn a gun. But which gun? There are 5 guns in the game, so I figured I'd compare another value.

    So, if Compare two values 100 < 20, we'll check another value to see which gun it should spawn.

    In the event sheet, it'll now look like this:

    • if value 100 < 20

    --- compare two values: if 5 = 1 - Spawn blue gun

    --- compare two values: if 5 = 2 - Spawn green gun

    --- compare two values: if 5 = 3 - Spawn red gun

    --- compare two values: if 5 = 4 - Spawn rainbow gun

    --- compare two values: if 5 = 5 - Spawn orange gun

    • if value 100 > 20 - Spawn coin.

    Hopefully I made sense.

    Oh, I'm talking about the compare two values system expression.

  • That's the issue yeah, I have no other events influencing these ones, and I've reproduced the issue in another project. The only explanation is that it's always set to 5 for some reason, not sure why.

    These are the events I have set up:

    • if value 100 < 20

    --- compare two values: if 5 = 1 - Spawn blue gun

    --- compare two values: if 5 = 2 - Spawn green gun

    --- compare two values: if 5 = 3 - Spawn red gun

    --- compare two values: if 5 = 4 - Spawn rainbow gun

    --- compare two values: if 5 = 5 - Spawn orange gun

    Perhaps Construct doesn't allow the 'compare two variables' to be done after another? I'm not sure, I must be doing something wrong here...

  • I have an event that - when the player destroys a box - compares two values to decide whether a coin or a weapon should spawn.

    Easy.

    On box destroyed, compare two values, right?

    if value 100 < 20, spawn a weapon.

    if value 100 > 20, spawn a coin.

    Works perfectly! However, there are multiple weapons in the game, so I thought I should add a second 'compare values' under the first event. So,

    • if value 100 < 20

    - if value 5 = 1 - Spawn blue gun

    - if value 5 = 2 - Spawn green gun

    - if value 5 = 3 - Spawn red gun

    - if value 5 = 4 - Spawn rainbow gun

    - if value 5 = 5 - Spawn orange gun

    I figured this would work, but every time I break the box, it spawns the final gun on the list - the orange gun. No matter what, it's always the orange gun. Does anyone know what I'm doing wrong here?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't have my C2 available at the moment, but maybe you could try this:

    - check whether the enemy is near another enemy (through the "Is between two values" system condition). Alternatively, go with the "When Overlapping" condition though it might be a bit late when they are already overlapping

    - when that is true, just reduce the speed of one of the two enemies to zero.

    - add another condition, when the two enemies aren't next to each other AND one enemy's speed is zero (which selects that enemy), set its speed back to its original value

    If you encounter any problems or this doesn't work for you, I can setup a little capx for you.

    I'd really appreciate a capx if you ever find the time

  • I know that, that's not what my question was though. I'm asking if there's a simpler way.

  • I have a sprite that uses the Line of Sight behavior.

    I want the Line of Sight 'cone' to be facing left, not right. I've tried using negative values for the cone size to see if that would change the direction, but it didn't.

    I could easily mirror the sprite and set up a few events for that, but surely there's a simpler way to change the direction of the cone. If not, just say so and I'll do a workaround.

    Thanks in advance!

  • Both my friend and I are having this problem too.

  • I have a bunch of enemies with pathfinding.

    Unfortunately when they're walking along their path (they usually have the same target every time), they overlap one another. I'm not sure how to stop this from happening.

    I've tried setting each enemy as an obstacle, which causes lag.

    I've tried giving each enemy the solid behavior and 8direction behavior (this would usually cause the enemies to move out of the way of each other), but it lags.

    I've tried setting up an On Collision / When Overlapping event, where the enemy is teleported X -10 but that looks terrible.

    My question is how can I make the player move out of the way while still keeping it's current path? I have no objections to re-setting the path, I just want to have them move out of the way from each other if they were to overlap or collide.

  • Bump!

  • Thanks a lot, new question - When using the 'set layer effect parameters' event, how do I set multiple parameters in a single event? Doing ' 0, 1, 2 ' doesn't work. Is there a way to do this?

    I'd also like to know the same thing for setting multiple Layer effects to 'enabled' using a single event, for example "Layer 1", "Layer 2", etc. But that doesn't work. I like making all my events as compact as possible. Thanks in advance.

CinderFlurry's avatar

CinderFlurry

Member since 16 Jul, 2015

None one is following CinderFlurry yet!

Trophy Case

  • 9-Year Club

Progress

9/44
How to earn trophies