This should be simple math here. what the heck?

Get help using Construct 2

Post » Sun Nov 09, 2014 6:01 am

Image
When it's set to 225, the top event does not trigger, and the bottom one DOES - aka, a complete inversion of what it should do.
I tried it in many different ways, including using a completely different behavior - the "custom" one in pretty much the exact same equivelent way. The angle of motion is definitely traveling in the correct way, but it is NOT mirroring when it should and the conditions seem to be firing completely wrong.
I narrowed it down in the smallest way possible.
Image
The middle event does not trigger here.
I am at a complete loss here.
Some quick help would be appreciated, assuming this truly is not a bug.
I am using the most recent version. I wasn't before, but updating did not fix it.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Sun Nov 09, 2014 6:15 am

edit: ok I've chopped and changed with this answer, however my original comment about integer values still stands. Don't check against an integer value as angles are floating point. Additionally, check the capx, angle vs angle of motion. Hope it helps.
You do not have the required permissions to view the files attached to this post.
Last edited by codah on Sun Nov 09, 2014 7:38 am, edited 6 times in total.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Nov 09, 2014 7:00 am

Ok, Try something like this :
Image

("side" is a instance variable )

your question is not clear. if it is not the answer, give a little description
Image
B
24
S
2
G
1
Posts: 46
Reputation: 1,112

Post » Sun Nov 09, 2014 7:38 am

codah wrote:An angle will rarely be an integer value.

edit: it's not an integer value thing (still a valid point though), but check the capx


The word "integer" means whole number, right? Please correct me if I am wrong.
But if I am correct, then I am setting it to one in the bottom event, and then checking for that same exact same number immediately after.
In the top event, it shouldn't matter, since it's a range anyway, so a decimal number would still fall under it.

tharindutpd wrote:Ok, Try something like this :
Image

("side" is a instance variable )

your question is not clear. if it is not the answer, give a little description


Firstly, why is the instance variable even necessary? It appears to affect nothing.

To clarify what I want to do, I want the bee to face left or right, however it also chases enemies, goes upward diagonally if there are no enemies, and therefore, can go in any possible angle. I want whether it is mirrored to be determined by the closed possibility, based roughly on which half of the circle radius the direction falls. With the way I tried to do it, it worked almost always, except when it was going up-left diagonally (not quite sure about possibilities for specific numbers other than 225) And I want it to be "angle of motion" for bullet behavior. As far as I can tell, the regular "angle" variable is tied to the image being rotated, and makes it go al upside down and stuff, and I really don't want that. Also, I just tried exactly what you showed me (with aforementioned bullet behavior variable instead of angle). And what it did was, only ever mirror if it faced exactly dead left. Nothing is making sense anymore.


And so you know, the bee already moves exactly the way I want. The trouble is ONLY the mirroring, and getting the conditions for such to recognize the angle correctly.
Last edited by DialgaBrite on Sun Nov 09, 2014 7:39 am, edited 1 time in total.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Sun Nov 09, 2014 7:39 am

Sorry for the changes; check my updated post above. Will check your comments now.

edit: if you set angle to 225, it will probably be 225.00000031 or something internally. But yes a range check should work in this case.

edit 2: as always, without a capx this is largely guesswork as other events could be affecting the ones that you've shown
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Nov 09, 2014 7:54 am

codah wrote:Sorry for the changes; check my updated post above. Will check your comments now.

edit: if you set angle to 225, it will probably be 225.00000031 or something internally. But yes a range check should work in this case.

edit 2: as always, without a capx this is largely guesswork as other events could be affecting the ones that you've shown


Image

Even in your example, this is not mirroring it. At all. Even though I am blatantly checking for the same exact number it was just set to. And rotating it will not help me, as I have said I do not want to do that.

edit: made a mistake, gonna try again. sorry.


Image

still doesn't. >.<
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Sun Nov 09, 2014 8:03 am

I took away the movement you gave it, ran it and pressed no keys, and it said this:
Image
I do not understand this. It sets it to 225 at the beginning, but doesn't equal it?
Remember, I said in my game, the bullets WERE moving at the angle I wanted, despite not being recognized.
Can someone please enlighten me on how this is happening?
Can someone also please enlighten me on how an angle can equal -180? I thought it was always a number from 0-359?
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Sun Nov 09, 2014 8:15 am

this update illustrates the decimal issue

You misunderstood why I supplied the capx. I'm just showing the values aren't what you think. I'm not suggesting it is the answer to your mirroring issue. 'at all'.
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Nov 09, 2014 8:23 am

Alright, this is just beyond rediculous. When using text to debug my own game, it was giving me negative numbers. 225 (left-up) became -135, while 315 (right-up) became -35. And checking for those numbers, and/or the ranges that included them, still didn't make the events work, either. And the bullets still moved in the correct directions despite this.

I really truly feel like this is a complete bug now.
B
15
S
2
Posts: 103
Reputation: 1,178

Post » Sun Nov 09, 2014 8:26 am

codah wrote:this update illustrates the decimal issue

You misunderstood why I supplied the capx. I'm just showing the values aren't what you think. I'm not suggesting it is the answer to your mirroring issue. 'at all'.



You do know that file is completely unchanged, right?
Also, I did not actually wish to download an unstable beta just to open it. Thankfully I have 2 computers and the ability to uninstall stuff. But it wouldn't have been so bad if you had at least warned me, but more importantly, had a better overall tone with me.

Please. I just want legitimate help here. I am getting kinda annoyed, so sorry for my tone.
So somebody, please either tell me something specific and obvious that is just going over my head, or say "this is just weird" and draw attention to the idea that it might actually be a bug.
B
15
S
2
Posts: 103
Reputation: 1,178

Next

Return to How do I....?

Who is online

Users browsing this forum: Christmas, minigame, zenox98 and 6 guests