The link seems down, so I'll try downloading later tonight.
Thanks,
Mobichan
Printable View
The link seems down, so I'll try downloading later tonight.
Thanks,
Mobichan
Ok, its fixed. The link should work now.
Thanks for the example. It makes me curious about using the Movement Controller more, since it has the ability to work with angles. Unfortunately (as with most examples) it uses the mouse pointer as one set of points in the equation. This will probably come in handy for future projects, but since I am using this for enemy bullets, I need to figure out a way to define a set of points that don't involve the player/mouse.
Maybe I'm not approaching this the correct way, but I have a feeling I should somehow use the enemy's position and an arbitrary point in front of the enemy as a sort of "reference" point. Then at least I will have a starting angle to work from. I noticed the "Convert Direction to Angle" expression. Is it possible to set an initial direction with the standard 32 angles and then convert it to degrees, after which I can work solely in degrees? Or is that for setting the angle and not the direction? :confused: The distinction between the 2 terms is a little confusing.
If only the standard MMF2 directions could have an option to support 32 or 360 directions. Sigh...
Mobichan
It doesn't use the mouse to determine where to shoot. It uses the player's angle, which is exactly what an enemy would use to fire. There is no XMouse or YMouse in the equation. It should be easily adaptable to enemies.
It looks like the initial angle is set as a direction based on 2 points, one of which is the turret and one of which is the mouse x,y. Then that angle is used to determine the shoot direction. Or am I misunderstanding the equations?
Yes, you are misunderstanding the equation, I'll dissect it for you. The original equation is:
Angle( "Player" )+(value( "Angle Range" )/value( "N Of Bullets Per Shot" )*((value( "N Of Bullets Per Shot" )/2)-LoopIndex("Shoot")))
Angle( "Player" ) = Starts off the equation by providing a base angle for the bullets to fire in.
(value( "Angle Range" )/value( "N Of Bullets Per Shot" ) = Spaces out the bullets when multiplied by the next part of the equation. Dividing the range by the number of bullets evenly spaces them out.
((value( "N Of Bullets Per Shot" )/2)-LoopIndex("Shoot"))) = This part is multiplied by the previous part. The reason the number of bullets is divided by two is so that half of the bullets travel above the angle of the player and half travel below. That alone wouldn't work though, because you have to subtract the Loop Number from it, and it loops the number of times that there are bullets, so half of them will be a negative number, and that is subtracted from the angle.
It's a bit confusing, but I explained it the best I could. As you can see, there is no reference of mouse positions. The only thing in there remotely like Mouse Positions would be the angle part at the beginning. This doesn't require any input from the player and is completely set by the angle of the object shooting. So if the enemies travel based on angles, they can fire using this system. Even if they use simple 32 directions, simply dividing by 11.25 (360/32) would put it into 32 direction. The angle of the player is set by the mouse positions, as you can see when you move the mouse the player turns to face it. But if you set the angles for an enemy, you will not be setting it by the mouse and can still use the angles.
Brandon: This really helps me out quite a bit. I am definitely learning there are MANY ways to do the same thing. I actually was stuck on how to recreate this until I realized my bullet's movement was set to bouncing ball and yours was set to vector. It seems that the Bouncing Ball controls are not in the Movement Controller , so I might be out of luck with trying to combine both of our approaches into one system. But I might just use the things you've taught me for more complex enemies like bosses. All in all, thanks for spending the time to work with me on this.
:grin:Mobichan
No problem :) . Glad I could help somewhat.