How do I fix an issue with different responses to create?

Get help using Construct 2

Post » Tue May 03, 2016 6:20 pm

Hey everyone! I have a set of events that create a Head object and Segments that follow way points. The interesting thing is that they fire perfectly when the Head is hand placed on the layout, but any time I try to create it using the system action it simply refuses to create the segments. It's starting to get very frustrating.

Here is all of the code for the Spine enemy:
Image

And a video of the issue. As you can see, the first Head instance is hand placed on the layout and runs as intended. Every instance after that is created by System>Every 15 second> Create the head (which in turn is supposed to create the segments, etc.)
https://youtu.be/pDV40-VpQrk

Any ideas or help would be appreciated.

I also ran into in issue where it says that certain instance variables are <varied> when there is only one instance of the object in question. (I even deleted it and received the warning that it was the only instance, then recreated it)
B
12
S
1
Posts: 34
Reputation: 632

Post » Tue May 03, 2016 7:39 pm

You dont see any amount of segments in the debugger ?

Seems to me that fresh created segments are all on 1 place, following exactly the same path.

In event 79, the head is unreferenced. The segments get the speed of the first head + 4. But that is not the problem. They all get created on the same place and get the same first waypoint.
No idea why 80 is needed. They have a waypoint allready, just need a new one when there is a change.
I have no idea whats more in event 80.
I have no idea when you destroy the segments.

Just rattling, never mind me.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 03, 2016 8:19 pm

lol Sorry, I just noticed that 80 wasn't opened in the shot. Yes, the destruction events are in there. Here are the contents:
Image

They should be destroyed when a certain distance off of the left of the screen is reached.

Each segment should be spawned at the same y as the head with a 64 pixel (that's the segment_space variable) gap between origins on the x axis. I wondering if they are being spawned and just aren't headed on screen due to something going on with bullet instructions. I'll check the debugger for spawned events, thanks for the heads up.
B
12
S
1
Posts: 34
Reputation: 632

Post » Tue May 03, 2016 8:27 pm

They all get created on head.X + 64 , head.Y.

If you want to create them with a space of 64, then keep the first creation. And change the head.X in segment.X in the other creataions.

Since the create sets the segment picked, each next segment will pick the previous segment, and therefor spacing them.

You see ?

I think that you should bring the 'every ticks' in there resp. 'on overlap' and 'on collision events'. After you changed the target index.

I still dont like the unreferenced state of the head expression in that event.
Last edited by 99Instances2Go on Tue May 03, 2016 8:31 pm, edited 1 time in total.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 03, 2016 8:30 pm

so it ignores the multiplications? The first is at x +64. The second at +64*2, etc...

I've updated the waypoint change as you suggested. I completely agree.
Last edited by raster on Tue May 03, 2016 8:34 pm, edited 1 time in total.
B
12
S
1
Posts: 34
Reputation: 632

Post » Tue May 03, 2016 8:32 pm

There is no multiplication, wel i dont see it, try what i suggest ?

I mean change the head.x TO segment.x (but with the right and full names, i am a lazy typer)
But keep the first creation as it is !
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 03, 2016 8:40 pm

A closer look at one of the events in 78. I understand that the way the text loops around may cause you to easily miss the multiplication normally. But you can see here that each iteration of segment increases the distance on the x that is multiplied by 1.
The first is at +64. the second at +64*2, the third at +64*3, etc...
Image

I'll try what you suggested though.

EDIT: After checking the debugger I see that they ARE spawning but WAY off to the right. I'm wondering if it's ignoring the order of operations and instead performing the addition before the multiplication. Thereby adding the head.x +64 THEN multiplying the resulting number instead of just multiplying the 64 and THEN adding that to head.x.
Last edited by raster on Tue May 03, 2016 8:50 pm, edited 1 time in total.
B
12
S
1
Posts: 34
Reputation: 632

Post » Tue May 03, 2016 8:48 pm

I missed that. Indeed. In my suggestion is no multiplication needed.
And no, it should not ignore that.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 03, 2016 8:56 pm

The head creates at 64 pixels outside the layout. (width + 64, that is way on the right)
4 + 4 * 2 is calculated as 4 + (4*2). You should use that last way to put it though.

Do the waypoints move ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue May 03, 2016 9:01 pm

Hmm. even changing them to reference one another and remove multiplication (as you suggested) they still spawn with an of >1500. :/

And no, the waypoints are stationary.

EDIT: Allright, seems we've sorted it. I changed the spawn point of the head to viewportright and viewportbottom instead of windowwidth and windowheight. I then had to change the speed of the segment to 254 as it referenced and unknown Spine_Head. Phew. Here's an image of the revised events. Thank you SO much for your help! It helped tremendously!

Image

and in action:
https://youtu.be/A-w__06YnwA
Last edited by raster on Tue May 03, 2016 9:18 pm, edited 2 times in total.
B
12
S
1
Posts: 34
Reputation: 632

Next

Return to How do I....?

Who is online

Users browsing this forum: JoyfulDreamer, StillSarah and 23 guests