CJacobsSA's Recent Forum Activity

  • edit: moved to its own thread as it is a different question entirely

  • Thank you, that fixed the problem! I figured it'd be a pretty simple solution. I sometimes forget that actions execute every tick unless you manually tell them not to.

  • Hi, I've got a pretty simple question pertaining to some odd behavior by the enemies I've created.

    It has two LOS behaviors: A big one that sets it active (Enemy01los01), and a smaller one that tells it to attack (Enemy01los02. When the player leaves the smaller one, it's supposed to set the enemy back to the walking animation, and it only sort of does. The enemy gets stuck at the beginning of the walk animation for a few seconds before it fixes itself, and I can't figure out why.

    Here is the entirety of the enemy's code. Anything jump out that could be the culprit?

  • Ahh, thank you for the explanation! That's a big help, I appreciate it.

  • Oh, interesting! I reversed the order of the two upgrade actions and now it works just fine. I guess order of operations is more important than I thought. Thank you!

  • Hello, I've got a weird logic quirk that you folks can surely help me unravel. I want my game to have certain upgrades be repeatedly buyable for a number of ranks. This seemed like it'd be easy, but it's proving to be pretty tricky.

    The way I've got this set up, what I expected to happen is: when the player clicks the button, if var_isbought is 0 it does the first upgrade and then sets it to 1, and stops. What I figured is that it would only perform the action that is true when the player first clicks the button, but it turns out that's not the case. Instead, it continues to the second upgrade and makes that change as well. How do I make it work like I intend for it to?

  • Unfortunately neither solution works; with Aher0's, it just flat-out does not create the 01top and 01bottom objects. I think the reason for that is that the obj_enemy00s aren't created, they're spawned, which is a weird technicality? Maybe? And Gmoney's solution would work, but it's incompatible with my current spawning system.

    is there a way to add the second enemy to my array system and skip spawning the enemy_00 entirely? I think that might work.

    Here is the event that spawns enemies from the spawners. Basically it takes whatever is at the front of the spawnlist array (pushed there in the previous step of the spawn process) and creates an obj_enemy00 with the 'type' variable set to whatever the array says. Is there a way to make it something like, say, "if spawnlist says 'tankguy', spawn obj_enemy01 instead"?

  • Hi, I've got a weird problem I can't figure out how to solve. My game is an arena shooter where enemies are created from a number of spawners with the logic set up basically like so: Every x seconds, create obj_enemy_00 at the spawner with y dedicated ID variable, et cetera. For just spawning a single object (the base enemy object), this works great! The trouble comes when I try to spawn an enemy with multiple parts.

    The way I have it set up, obj_enemy_00 has a variable called 'type' which determines what kind of enemy it is when it is spawned. The tank guy has a couple extra bits that I need to create when it spawns, but I can't figure out how. If I do this:

    it only creates one of each no matter how many tank guys I push out of the spawners. If I do this:

    it creates a scary feedback loop that, for reasons unknown to me, spawns hundreds of them per second (it does this with and without the extra "type = tankguy").

    The system is relatively complex so it'd probably be easier for you to just poke around in the .capx to see if you can figure out the problem, you can download it here. I'm hoping I'm just having a brain fart and the answer is real simple.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is how I handled the issue.

    Subscribe to Construct videos now

    Thank you! This is exactly what I was looking for, I feel like a dummy for not trying it. <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

    To avoid jittering movement, it's best to use a proper AI follow code.

    To stop an enemy AI from jittering, we could use a variable like this.

    https://www.dropbox.com/s/1g0lseyx71z9h ... .capx?dl=0

    My recommendation is to use a simple set of events with variables like my next example.

    By the way, I made this myself.

    https://www.dropbox.com/s/iwftjcj2izc6j ... .capx?dl=0

    1. Try approaching the enemy to be on enemy's line of sight.

    2. Get caught. Enemy will stop.

    3. Run away. Enemy will stay in the stopped state.

    4. Approach the enemy again to provoke. Enemy will follow again.

    Right now I don't have any enemies that would need this complex of an AI but I'll keep it in mind in case I ever do!

  • Hi, I'm making a game a top-down 8-direction movement perspective. One of the basic AI systems most of my enemies have is one that allows them to follow the player, it's a very simple implementation with no frills, just "if the player is here, simulate movement in this direction" like so.

    (obj_legs is my player's body hitbox object)

    The problem is, when they align with the player on the X or Y axis, they constantly switch between up/down or left/right, causing this weird slow and jittery movement. Is there a better way to do this real simple AI that would prevent that?

  • Excellent, that works just fine. Thank you!

  • I'm creating a game that has rooms sort of like a zelda dungeon, and I'd like to make pickups randomly spawn in the room the player is currently in. Each room is surrounded by a plain box called obj_spawnzone:

    (visually represented here in stunning HD)

    What I'd like to have happen is, every 1-10 seconds, a pickup spawns at a random position inside obj_spawnzone. The first part I've got with an "Every round(random(1,10))" event, but how do I spawn the pickups at a random position inside the object? Keep in mind that I don't want pickups to spawn in rooms the player isn't in.

CJacobsSA's avatar

CJacobsSA

Member since 26 Sep, 2014

None one is following CJacobsSA yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies