Player vs boss problem

hello everyone hope y’all doing good
im having this weird problem that when the player died i want the boss to return to his first phase
here’s a video explaining what im talking about :

thanks in advance :smile:

Hi, could you post a screenshot of your events.
I think it could be a matter of changing the sequence of the events, or adding a condition of what happens when player’s health reaches 0.

hey sorry for the late Gdevelop was crashing around and it took me time to fix it but here’s the events

for the player respawn :

here all the boss phases and death event’s:



death:


@ZeroX4 do you mind helping me please ?

I don’t see screenshot for phase 1
And i see when player is in boss room boss do not move for few secs
To this state you should set boss after player die

I don’t see events for re-setting the boss’s phase after the player dies.
You specify what happens to the player after their health reaches 0, they are revived and re-positioned, but no actions to also re-set the boss.

Okay I’m gonna test it out and see what happens

That was the problem idk how to set the boss to phase 1 after the player death

Same as ZeroX4, I don’t see events for the first phase in the screenshot, so I don’t know what’s happening there, but I would add actions for re-setting the first phase under the condition that checks if the player is dead [The global variable Saving.Health =< 0].

here’s the first phase :

i forgot to show this when the player is in colision with the trigger that starts the boss fight :

Okay, so you trigger the Boss fight when the player collides with the BossTrigger object, and you trigger a lot of actions, and you delete the BossTrigger.

On player’s death, you would need to create the BossTrigger object again, because that’s what triggers the phase, and hide the objects and disable the actions from that event, so that they are triggered again when the player collides with the BossTrigger when the player revives.

Perhaps there’s a better way to do it, but it seems to me that this is the reason the phase does not start from beginning when you die.

like if the player health =0 i should disable all the phases ?if so how can i do it ?

It’s hard for me to say exactly what needs to be done, it would a trial and error on my side :sweat_smile:
But I would start by adding an action “Create object BossTrigger” in the condition “The global variable SavingHealth =< 0”, so that the trigger is available again after the player dies.

This might trigger the phase again after player’s death, but you’ll probably need to do more to stop the previously triggered boss related actions, if you want to have a clean start with each death.

i tried it ut still didn’t work i tried using a boolean like if the player is in collision with the bosstrigger set it to true and if the player set the it to false :

.

But I don’t think this boolean does anything, you’re just changing the value from between true and false depending on whether the fight it on or not, but it doesn’t affect anything.

You need actions that will trigger the fight again after the player revives, and you trigger it by colliding with the TriggerBoss object, so you need to make sure that this object exists after the player revives, so the player can interact with that object again.

Here, I made a simple example of what I mean:

  • player collides with the bush
  • the bush is removed
  • npc starts moving
  • player looses health when they collide with npc
  • player dies and is revived at the original location
  • the bush is created again so that you can start the loop all over again

Is that what you’re after?

yeah that’s what i want. i will to do it like for all the phases if the player died in one of the phases it all reset ima try it and see where it goes. is it possible to apply it for different phases ??