Why won't my boss reset?

0 favourites
From the Asset Store
Endlevel boss, brainwave animation, projectiles, ...
  • file:///C:/Users/leool/Videos/Captures/Vanguard%20-%20Google%20Chrome%202020-12-26%2015-14-16.mp4

    I'm not sure if you're able to see my video, but if not, basically I'm making a game where I want a boss with 2 stages. The first stage will have him just charge at you and attack if you're close enough, and the second stage is where it'll fly into the air and start breathing fire. I was able to get those to work, but once the boss finishes stage 2, I just want it to return to it's starting position and go back to stage 1 basically. But, for some reason, once the boss returns to it's starting position, it won't do anything else. If someone could please tell me why this might be happening I would really appreciate it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your video link doesn't work, you need to upload the video to some file sharing service or youtube.

    But more importantly, you need to share your project file, or additional screenshots of your code. From what I can see, the problem may be with the "State machine3" group. Or possibly you have other "Demon MoveTo arrived" events somewhere else, which may trigger simultaneously and mess with the logic.

    Also, remove "Wait for previous action to complete" action, this is the wrong way to use it.

  • Here are some more images of the code, I appreciate the help.

  • It's hard to tell. Like I said, you have multiple "Demon On Moveto arrived" events. Maybe several of them are triggered at the same time.

    I would suggest debugging - add "Browser Log" actions to these events, press F12 in preview and check messages in Console. You'll see which events are triggered and when. You can also use Debug Mode with breakpoints.


  • Alright, thank you! I also think I might be able to work around it by creating a second "Demon" object.

  • Subscribe to Construct videos now

    So, I've been stuck for the past 2 or so days. It's pretty much the same issue as before, but now, instead of having the boss change again, I'm having a copy of it spawn in. But, as you can see in the video, after it spawns in it just doesn't do anything. If someone could please help me with this I would greatly appreciate it.

  • Also, here's a screenshot of some of the code I added for the "Demon2" object.

  • You should be using a State Machine to control your enemy states.

    A State Machine is a common programming tool that defines states something can be in. Each state needs an entrance and exit condition. All the code the enemy uses will be defined by the state it is in. Take a look at this example I through together from your question.


    My enemy will wander randomly until the player gets within 200 pixels. It will then charge the player and return to where it started the charge. It will be unable to charge until after a cooldown. If the player climbs the stairs so they are higher than the enemy, it will enter a flying state. I didn't add the code for attacking in the air but the state is there. After the player returns to the ground, the enemy will return to the ground and start wandering again.

  • I'm actually already using a state machine. There's an example of it in the pictures above the video.

  • Ok. Sorry I missed that.

    That being said, your code images don't really appear to be making use of the state machine. I may be misunderstanding your code but it looks like you are relying on disabling and enabling code groups instead of changing states. This is extremely difficult to debug because there isn't an easy way to check if code blocks are enabled or not.

    Did you take a look at the example I built? I think you may find the answers you need there.

    To be honest, without access to your project, we are just guessing about what is happening. Can you post your project? You'll probably get better results if you do.

  • Sorry, how do I share my project?

  • I save it on my google drive using Constructs cloud save option. I then go to my google drive and get/post the link to it. You can also upload it to a dropbox, github or other online hosting account and share the link from there.

  • https://drive.google.com/file/d/1N_sC8jVo57SE6Ob6aTzcw_oX3_kTDAV_/view?usp=sharing

    Alright, here, I think this link should work.

  • https://drive.google.com/file/d/1N_sC8jVo57SE6Ob6aTzcw_oX3_kTDAV_/view?usp=sharing

    Alright, here, I think this link should work.

  • I have run into multiple really big bugs that all seem to point back to the enabling and disabling of code blocks.

    1 - I saw the Demon stop working after the air attack. I was unable to really debug why because of the other following errors that made it so getting to this point was inconsistent.

    2 - I have had the knight lose the ability to attack or turn around when walking into the boss room. This was fixed by disabling the action that disabled the Knight Controls group. When you run the cut scene of the knight walking into the door, the Knight Controls get disabled and sometimes don't get reenabled.

    3 - When fighting the boss, quite often, the entire game would freeze. I haven't been able to figure out why.

    In the image below, I have marked events that deactivate code groups but don't have a corresponding activate event.

    Also, I noticed you have 2 copies of the Boss Events. Both are nearly identical. Duplicating code is always a bad idea. If you need to make changes in 1, you then have to remember to change the second as well. Also, you can have a hard time knowing which event sheet is causing the problem. If you need to use the same events on multiple event sheets, you should put all the shared events in their own event sheet and include it in the others.

    I suggest you redo the event system removing ALL the disable actions and instead use state to define which block of code to use.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)