For loop not working in "on start of layout"

Get help using Construct 2

Post » Sat Jun 27, 2015 4:55 am

Message: ptstd is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
A pretty simple problem.

My for loop works fine outside "on start of layout", but when it's nested under it doesn't work. :/

I was basing this off another similar tutorial and I -swear- I have everything exactly the same, but obviously I am missing something.

Here is the capx :
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 4:56 am

How do I post a link to the capx?

I guess this will do for now until I can post links : mediafire DOT com/?8y8vivl1j0685b5
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 5:32 am

Image
B
64
S
23
G
7
Posts: 1,483
Reputation: 10,827

Post » Sat Jun 27, 2015 5:58 am

[quote="korbaach"][/quote]

Can you explain what is different on this than from my own? I feel like I am going insane. I don't see a difference.... like on the CAPX I uploaded, when I drag the for loops under "on start of layout" so they are nested, it doesn't work. :/

Here is a screenshot

Image

I copy pasted your code to my project and it didn't work.

Is my project bugged?
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 6:07 am

Here is my project with your code copy pasted exactly and it's still not working.

mediafire DOT com/?ujpmecbd4jjxx76
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 6:10 am

Okay, I'm whittling down the bug... it seems to not be working because the object I am calling is from another layout.

Can someone explain to me why this is the case?

At start of layout do I have to have the objects I am working with on this specific layout? I'm used to being able to just dump everything into an empty layout to pull from... but it's not working for start of layout?
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 6:12 am

Yeah, that definitely is what the bug was. I'm just curious why I've been able to load items that are stored in another layout within the event sheet, but not during the start of layout.
B
4
Posts: 11
Reputation: 224

Post » Sat Jun 27, 2015 12:41 pm

The problem there is that when there are no SP_001 sprites on the layout then SP_001.Width and SP_001.Height will return 0. All the sprites are being created at (0, 0).
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Mon Jun 29, 2015 12:22 am

ramones wrote:The problem there is that when there are no SP_001 sprites on the layout then SP_001.Width and SP_001.Height will return 0. All the sprites are being created at (0, 0).


Cool. That makes sense! Thank you! :D
B
4
Posts: 11
Reputation: 224


Return to How do I....?

Who is online

Users browsing this forum: bluesun66 and 2 guests