Overlap check after spawn in "On start of layout"

Get help using Construct 2

Post » Fri Mar 08, 2013 2:13 pm

I'm trying to make isometric field, but I don't want to make all fields with copy & paste, and I decided to replace with tiled background.

I made logic like this.

<at start of layout>
1) create "checker" object all around, in isometric fit position.
2) after that, check overlapping "checker" with tiled-background-objects for replacing. If there are, replace it.

<at start of layout>
3) place them in appropriate z-order.


and THIS DID NOT WORKed. And I guessed maybe overlap information updates after a tick.

And modified overlap checking codes to outside of <start of layout>, it worked. BUT, I don't want pass 1 tick... because It is field (background or like thing) , and If there are any lag Player may see them. :(

And... I think there might simple ways, and... It, I'm meaning this situation, is not intuitive, as I think.





thus, How can I check overlap properly right after spawning some objects? or Is it an engine-problem? (right now, I don't know so much about programming, and I don't know that.)


Sorry for inconvenience!
1) The .capx file without clay.io plugin
2) .capx file reproducing Type-B problem


and last, If there are any rude words and sentences, sorry for that. I'm not good at english.Ch_Softblow2013-03-08 23:31:36
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Fri Mar 08, 2013 3:27 pm

This includes one solution:

Forest generation

Not sure if it applies 100% in your case, but might give you an idea :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Fri Mar 08, 2013 6:41 pm

What's wrong with "Type B" with the subevent? Is that not working correctly?
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Fri Mar 08, 2013 11:18 pm

@ramones
er... It worked not properly yesterday... (the time of here is morning now. 8:15 am :D ) er... I'll check it in another pc.

WHYYYY?!!!!!!?!!? Are events have context on editing?! Or, Is it just my confusion?! Am I not remembering correct?!


@ all
after all, I solved problem in onother way, with using additional 2 ticks, via wait 0 action. But I don't want things done in that way.


@vee41
Thank you for example, and from that, I learned the "choose" expression. and tried in your way by comparing count of created things, but It was not intuitive, and also uses 1 tick for that, as I think.
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Fri Mar 08, 2013 11:30 pm

check this file, see the "platform" event sheet for reproduce problem.
http://www.mediafire.com/?47auu9el4z8kcd7


events are same as below.


result might like this.
http://img541.imageshack.us/img541/2259/20130309082443magimaric.png
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Fri Mar 08, 2013 11:45 pm

Your 'Destroy on startup' event sheet is destroying the grass and sand after it's created.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sat Mar 09, 2013 2:43 am

@ramones

ergggggg... simple mistake! thank you ?.? I'll do more care next time before asking!
B
45
S
9
G
7
Posts: 73
Reputation: 7,518


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests