“Hello, my name is Lino (ItzELinx), and I am developing a game called CODE: 187. - Skipping the game’s introductions - I am trying to make a menu appear with options to respawn and return to the main menu when the player dies, but the player doesn’t die, and when they do, the menu doesn’t appear… I’ve already tried using tween, opacity (for the menu), and nothing… What else could it be?”
Hello BDG_ItzELinx and welcome. I’ve never used bullets or health so there could be some things I’m not aware of in your events. But I wonder if your events are getting completed.
Your first event is based on a collision with the bullet. But your first action in that event is to delete the bullet. You can try moving the delete to the end if Halstead isn’t losing health and dieing.
And similarly, your second event is based on Halstead being dead. But if you delete Halstead in the first action then Halstead doesn’t exist any more and the condition is no longer true so will the tween get called?
Welcome. I don’t see anything wrong with your events. (Bubble) Actions happen after the conditions. An action can effect what happens on other frames or conditions on the following lines but they can’t affect the previous condition.
The wait before reseting the time scale is slowing down the tween. The tween would be slower until the time scale is set back to 1 but the opacity should go to 255,albeit it will take a little longer than a second.
Is the menu on its own layer? I’m wondering if the menu is on the same layer as the player and maybe the camera is following the player. If that is the case, then maybe the menu is appearing but it’s off screen. I’m just guessing. If so, add a new layer and place the menu on that layer.
There is also a prototype that I made exclusively to test new features (such as this), without messing with the time scale, nothing happens. I also have created a separate layer for this menu and again nothing happens…
The Halstead collision with the bullet event/action is based on a GDEVELOP tutorial video about “Taking and Dealing Damage”. I’ve created this part like a year ago or so, and it was fine like wine.
Thanks Keith for clarifying but just checking:
I mean the first action could be making the current condition fail. If I’m wrong then it’s confusing as I remember advice from Silver-Streak to someone (I can’t find it) about something similar about a deleted object in the first action.
Update
I might have found the old post. It was specific to a bullet collision and creating a new object at the location of the deleted obkect from the collision. It was failing because the delete action was first and meant the object location no longer existed. Objects cannot be created after collision - #7 by Silver-Streak
So does this mean I’ve been wrong all this time haha about the order of actions?
Conditions are processed first. Most evaluate to true or false. If they are true most of the time they will also pick the matching objects. If an object isn’t referenced in a condition then an action will apply to all of the objects or instances. The same is true for the compare 2 numbers. It doesn’t affect the pick list.
I always think of conditions like filter. Each condition will filter or pass thru the matching objects in a pick list. The next condition, actions and subevents will use this list and might further filter or reduce the list.
Actions can be weird. There are times when objects aren’t created or destroyed until the next event. It’s rare but it happens. It’s good form to assume the action is immediate and arrange them as such.
So, no. The only affect conditions have is deciding whether to trigger the actions or subevents and when applicable pick the matching objects. The flow is always forword unless inside a loop.
That’s great Keith, I’m bookmarking this, your explanations were very clear. I feel like trouble shooting my own problems will be simpler now.
I think I’m gonna to forget about it for a while, will look for a solution later on.
The weirdest thing is that Halstead won’t die for now…
If the character isn’t dying than either the collision isn’t happening or the health is starting at a very high value or the health is being reset.
Does the animation change to hurt? If so, the collision is working. Are there any other events affecting the health.
You can add a text object to display the character health or add the health value to the debugger. This would tell you if the health is decreasing and if it’s reaching zero.
I have had errors like that on my project. When you insert something that is giving errors, it would mess with already working stuff… Try deleting the death part.
If things dont change after that, i would assume there’s other things messing with the hurt part. Maybe some other animations or state that is interfering with the hurt part? I hope you find the solution!