(SOLVED) How do i correct my SPAWN problem?

Get help using Construct 2

Post » Sun Nov 01, 2015 9:06 pm

hi to all

i have a bug in my code, but i can't find where is the problem, here it's my formula
The problem is the money "bonus" are floating outside a platform and i don't want that

http://s9.postimg.org/ar0h0j2ot/ERROR_BONUS_XPOSITION.jpg
Last edited by imothep85 on Sun Nov 01, 2015 11:48 pm, edited 1 time in total.
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 9:26 pm

How many spawner_blocks2 instances are there?
Could it be the bonus is spawned by a spawner_blocks2 instance that hasn't spawned a ground-object?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Nov 01, 2015 9:31 pm

my "ground2" object is spawned by 3 "spawner_blocks2" the bonus is also spawned by the 3 same "spawner_blocks2"
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 10:01 pm

imothep85 wrote:my "ground2" object is spawned by 3 "spawner_blocks2" the bonus is also spawned by the 3 same "spawner_blocks2"


All I'm saying is..

Could it be the bonus is spawned by a spawner_blocks2 instance that hasn't spawned a ground-object?

A random instance of the spawner_blocks2 is picked for spawning the bonus..
If this instance hasn't spawned a ground2 object at the exact same time, the bonus won't be over a ground2 object..

You could always choose to have a ground2 object spawn the bonus, that way it would always be above a ground2 object..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Nov 01, 2015 10:18 pm

im completly lost with the two formulas.............completly lost....
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 10:40 pm

OK i FOUND the problem this is the most WIERD

IF i change the collision polygons of the ground2 object THEN all the bonus are spawned a the wrong places....WHY????
Solved this by just re-doing the collision polygon for the platform
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 10:58 pm

WATCH THIS:

First picture url is the ORIGINAL sprite with his original collision polygons and the result is, all the bonus "gold" are on the top of the platforms
http://s3.postimg.org/larzixv9t/collisionpolydefault_RESULT.jpg

and THIS:

This is what happens when you CHANGE the collision poly, AL the game is corrupted the Bonus "gold" objects are created at wrong places...
http://s28.postimg.org/fvjuzptyz/collisionpolydefault_RESULT2.jpg

I don't think this is LOGIC !!!!
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 11:37 pm

Correct me if I'm wrong, but it seems to me your bonus-objects have some kind of behaviour attached (solid or a movement behaviour) that pushes them out of solids..
(I actually see no reason for this, but I might be wrong)

You are creating them overlapping the ground and so they have to be pushed out..
Why not create them at the position you actually want them to be?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Nov 01, 2015 11:48 pm

yeah i solved this problem by changing the polygons collision to default and it works....but dont know why...

Thanks again for yoru help :D
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Sun Nov 01, 2015 11:58 pm

imothep85 wrote:yeah i solved this problem by changing the polygons collision to default and it works....but dont know why...

Thanks again for yoru help :D


I think I know why..
Like I tried to explain above, it would be better just to create to objects where you want them to be instead of overlapping..

Doing things the right way often prevents unexpected results..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: TL22, Yahoo [Bot] and 22 guests