[behavior] rex_spline

Post your work in progress addons and get feedback

Post » Sun Jul 03, 2016 4:46 am

Heh
That's what I was using:
Sprite.Spline.Point(Sprite.Spline.CurSegP1,"x")
Sprite.Spline.Point(Sprite.Spline.CurSegP1,"y")
for
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726

Post » Tue Jul 05, 2016 3:31 pm

I was trying without using the angle, and this is what I get:

Code: Select all
Javascript error!
TypeError: seg is null
http://localhost:50000/Rex_Spline_behavior.js, line 132 (col 9)

This may be a bug in Construct 2 or a third party plugin or behavior - please report it to the developer following the bug report guidelines. Subsequent errors will be logged to the console.


I had just add points to the spline path and set it Enabled + made it Start; the problem appears on the "On spline reach last point".

Edit: here is the example: https://www.dropbox.com/s/0w81a8w0sqkgef2/Spline%20Rex.capx?dl=0
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
13
G
4
Posts: 141
Reputation: 4,832

Post » Tue Jul 05, 2016 10:52 pm

Update

Fix a bug of calculating angle of motion.


@Jeff Skyrunner
Fixed.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Wed Jul 06, 2016 7:54 am

@rexrainbow

Now it works, but I do not see the property "set angle" under the "spline" actions
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
13
G
4
Posts: 141
Reputation: 4,832

Post » Wed Jul 06, 2016 8:40 am

@Jeff Skyrunner

"set angle" is not an action, it is a property, like official bullet behavior.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Wed Jul 06, 2016 11:25 am

@rexrainbow

My idea was that I could say "in step 1 the sprite must have a facing angle of 10 degrees", "in step 2 the sprite must have a facing angle of 15 degrees", and so on...

I thought it would be possible to set it while adding a point to the path.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
13
G
4
Posts: 141
Reputation: 4,832

Post » Wed Jul 06, 2016 1:08 pm

@Jeff Skyrunner

+ spline: Condition:On reach any point
+ system compare Expression:CurSegP0 = 0 (1,2,3... )
- set angle to ...


"Condition:On reach any point" will be triggered while reaching a point, then get the point index by "Expression:CurSegP0"
Last edited by rexrainbow on Wed Jul 06, 2016 1:22 pm, edited 1 time in total.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

Post » Wed Jul 06, 2016 1:22 pm

Create a list at point creation by appending the angle to a variable string.
set variable to variable&","&yourangle
Then get the angle with Sprite.Spline.CurSegP1
Set angle to tokenAt(variable,Sprite.Spline.CurSegP1,",")
Image ImageImage
B
169
S
50
G
170
Posts: 8,291
Reputation: 108,726

Post » Wed Jul 06, 2016 1:38 pm

@rexrainbow

Ok, that is a workaround (a nice one :) ): I was trying to give a suggestion to try to embed it in the behaviour, maybe in the same action where you set (x,y) for the point :) .

Just my two cents
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
13
G
4
Posts: 141
Reputation: 4,832

Post » Mon Jul 11, 2016 2:21 pm

@rexrainbow

Hi. Do you think you're going to implement it in this way or have I to use the workaround? :)

Many thanks in advance.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
30
S
13
G
4
Posts: 141
Reputation: 4,832

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: digitalsoapbox and 2 guests