Bug : particule overspawn [SOLVED]

Get help using Construct 2

Post » Fri Aug 26, 2016 8:45 am

In my game, when the player fall out the layout, he created a death particule and explode (destroy). After 1 sec he come back to the spawn
Code: Select all
Player is outside layout -> call "death"

On fonction "death" ->
set local key "deaths" to int(WebStorage.LocalValue("deaths"))+1
Player spawn particule_Death
Player destroy
Wait 1 sec
object_Spawn spawn Player

Everything works perfectly but when the player walk on spike :
Code: Select all
Player on collision with Spike -> Call "death"

That create a bug :
1rst time particule spawn one time
2nd time 4 particules spawn on death
3rt time 8
4rt time 32
...
That very anoying cause it make the game lag and not so beautiful
Image
I DO NOT understand why with the outside layout it's working perfectly but with spike particules invade my screen

Thank for reading me
Last edited by MisterAqua on Sat Aug 27, 2016 6:40 am, edited 1 time in total.
B
11
S
3
Posts: 25
Reputation: 1,110

Post » Fri Aug 26, 2016 9:06 am

When you look in the debugger, how many players are in the game after the 4th respawn ?
It shows you the amount of instances.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 26, 2016 10:44 am

...16
There it is
but how it is possible i just destroy it and respawn it one time

In fact when i say
Code: Select all
object_Spawn spawn playe
r i use a second fonction which :
Code: Select all
destroy player (again)
system create player at object_spawn.X , object_spawn.Y
apply skin etc...
B
11
S
3
Posts: 25
Reputation: 1,110

Post » Fri Aug 26, 2016 11:02 am

Use the "Trigger Once While True " function. You can find it under the systems plugin.
Image Image Image
B
29
S
11
G
27
Posts: 735
Reputation: 17,012

Post » Fri Aug 26, 2016 11:28 am

To know that, i have to read your capx.

But if i might make a wild guess. There is a player in the layout. You did not destroy it in a 'on start of layout'.
And you spawn a new player on some place during run time. So actualy, there are two players in the game.

Assuming there is only 1 player in the game, your code does not pick a certain player. So all actions adress both players. If you move the player, both get moved. So you dont actual see that there are two players.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 26, 2016 11:54 am

#99Instances2Go : no there only one player in the game at the start i delete the first at the start of the layout
#MPPlabtIfficial : i use "trigger once while true" and that don't fix the bug. By "Trigger Once While True" you mean the condition which became "Trigger Once" when create or i'm using the wrong condition
B
11
S
3
Posts: 25
Reputation: 1,110

Post » Fri Aug 26, 2016 12:05 pm

As 99Instances2Go has already said, and is always recommended, uploading your .capx is the quickest and most effective way to get the help you need.
Otherwise the users who generally help can only use guesswork.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,391
Reputation: 58,464

Post » Fri Aug 26, 2016 12:06 pm

Where did you put trigger once while true? It needs to go as a sub event under Player on collision with spike.
B
46
S
16
G
74
Posts: 2,090
Reputation: 44,189

Post » Fri Aug 26, 2016 12:30 pm

wrong topic, sorry
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Aug 26, 2016 1:00 pm

Message: MisterAqua can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://mega. nz/#!mEljADiY!dczm9gBSqRzefjChVPCJGlwrtWakJ4lGo36Dq4P3vT
my capx (delete space)
Special gameplay : a plateform-type game
But every try three random color being "transparent" (no more solid)
Colors change every respawn

I'm french so i hope you will understand my events . Some usefull translations : mort = death
all my principals event are in event sheet named (Event du jeu)
fonction "mort" : group Perso -> group Perso mort
fonction "reboot" : Group Random color

Debbug command :
in the level choose layout , press = to unlock new level
in any level , press ^ to open soft debug HUD
when soft debug HUD open :
1 - See transparente plateform
2 - Plateform behavor
3 - 8direction behavor
4 - Add point (useless)
5 - Stop chrono (useless)
6 - Being immune to deaths (outside layout and spike)
B
11
S
3
Posts: 25
Reputation: 1,110

Next

Return to How do I....?

Who is online

Users browsing this forum: Bootfit and 25 guests