Problems with porting events from Classic

Get help using Construct 2

Post » Tue Mar 13, 2012 2:54 am

To implement "while", try this plugin.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri Mar 16, 2012 8:44 am

Alright, update. The .capx has been updated, with:

- Input fixed properly, thanks to a fellow over at Sonic Fan Games HQ.
- Animations are fixed up and ready to go, though animation speeds do need tweaking, such as running.

Currently, the main issues are stemming from moving on slopes (and possibly on edges). It may be a collision issue, I'm not sure. I sincerely doubt collision polygons are the reason.
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Tue Mar 27, 2012 11:31 am

Once again, .capx updated, and I have a status report. There is one major problem - when the player's angle is not perfectly at 0 and moving on a horizontal plane, the player's angle fluctuates to ridiculous degrees, which a friend and I discovered using a debug thing we rigged up.

In the "Calculate Player Angle" section, in the original .cap, there's this:



In C2:



Note the function at the bottom - it's using an "Else" under a function, and a function within a function is pretty much impossible in C2 because of the way the Function plugin works, so... I had to substitute a variable in there to replace both the function and the else, and use an action to reset the variable after the "function" is completed, which, logically, should function perfectly.

However, turns out it doesn't. I tried the same work-around in the Classic .cap. The results were... Enlightening. It prevents Sonic from rolling while moving in both engines, but it doesn't cause the angle to go haywire in Classic.

So, two questions: Is there a better workaround, and is there anything else I'm doing wrong here?Candescence2012-03-27 11:32:49
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Sat Apr 07, 2012 1:20 am

About function:

1. event with green arrow can not be put under other event anymore, you could try to put "start of layout" under other event.

2. what is "else" for function? One of my solution is when you try to call a function by name string, but there is no compared name, so there is no function be called.
Put "Function xxx not be called" in event is strange. For example,

+ on function "f1"
+ Function "f1" not be called
+ on function "f2"
+ Function "f2" not be called
+ on function "f3"
+ Function "f3" not be called

If you call "f1", it will trigger event:on function "f1", and event:Function "f2" not be called, event:Function "f3" not be called
Do you think it really you need?
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Apr 11, 2012 2:13 pm

I do think I'll need an "else" for the function, yes, at the very least. Placing a function inside a function, as I said in the function topic, may not actually be at all necessary, and should logically be unnecessary in my opinion.
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Sat Apr 14, 2012 10:09 am

ALRIGHT. I've isolated the angle problem to TWO main possible factors. It can only be one or the other, not both, I presume.

a) The anglelerp(a, b, x) expression. It's supposed to replace the RotateAngle() expression from Classic, but I have a feeling it's not working right. I'm gonna ask Ashley about it via PM.

b) The collision detection system might not be working properly in this instance, though I can't see how it would cause spontaneous and virtually random changes in angle.
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Sat Apr 14, 2012 4:11 pm

Or you can download the newest beta of Construct 2 (R86 or later), which implements or, else and while!

It is a beta, so if you don't want to deal with that you'll have to wait for the next stable release. I couldn't try it out until I finished a project that was using R84, but I'm about to try it now.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Sat Apr 14, 2012 4:33 pm

Uh... I've already done that, actually. That being said, "else" isn't compatible with the Function plugin, but that's not my main problem right now. *Points at my last post*
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Tue Apr 17, 2012 8:05 am

PROGRESS! Ashley has let me know that my suspicions were correct. Turns out that RotateAngle() is basically the same as C2's "Rotate towards angle" action, which required me to change some things and introduce a new 'angle sensor' purely for the sake of replacing the 'pvAngle' variable so I can take advantage of this.

The result, as you can see in the .capx, isn't perfect, but it's getting there. The angle isn't spazzing out, but there seems to be some odd delay at times, which makes me suspect that there is indeed collision issues.
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 30 guests