Hi. I am making a top view action game. And I want the player to be able to extend his view, just a bit, when he is using a certain weapon. So moving the crosshair he can view more of the play field, but while the player character is still visible in this view....
If I understood right you want soldat style of aiming (sniper), but your char is always on screen.
If I would make it it would go like:
Always:
-Center display (0,0) from crosshair
And then you have to stop the crosshair by doing something like creating a circle which has different sizes like 16x16 and 32x32. And when the weapon changes so the animation of the circle (therefore the circles size rises and view size rises)
This is how I woul do it, but i could have miss understood waht you are lookin for.
I have proven new mathematic formula to be true...
I've tried that, it would be very hard to find a "in-between aim". I don't know how to explain it. But it would be really hard to aim. The aim has to be more smooth.
Distance < 900 =
Crosshair: Set position to (XMouse, YMouse)
This will limit it so that whilst the total distance is within the circle, it will move.
Now, for repositioning it to the edge of the circle when it escapes this, you will probably need to use a fastloop.
Any position on the circle is given by (rcosA, rsinA)
r is the maximum radius, A is the angle between the crosshair and the centre of the circle (the character)
If you combine this with a center playfield at the crosshair, whilst having a maximum distance, you should be able to achieve the affect you desire.
Please Joe, I know that's how it's written in textbooks, but I'm a strong campaigner that if you're gonna write a formula to explain something to a clicker, please include a version in actual click expression code. So people can see how the classical notation can be converted into MMF code.
So basically, if you want to find the distance between two points, using the formula Joe quoted, you do this:
So you can use the 'Compare two general values' or something like that in the Special Object under Conditions, and in the top box type the above formula, and in the bottom, type what you wanna compare it to (e.g. 100 pixels).
I'm having some real troubles with this. Joe has tried to help out over messenger, but he doesn't have MMF anymore. Does anyone want to make a quick example file?
I tried this and well when using the centered scrolling in crosshair it looks stupid, because mouse moves fast also the map scrolls too fast. This way the crosshair stops, but I don't think it works well in the game.
Edited by the Author.
I have proven new mathematic formula to be true...
Ah dam someone made before me, but I think when you are making sniper etc. you need longer extended view, and then it is a mess, because the camera moves too fast.
In my example (in my opinion) the camera is much better.
Edit: I forgot the source so I'll explain it here:
o Start of frame
-Hide windows pointer
o Always
-Center display at X=X("[Player]")+(X("[Crosshair]")-X("[Player]"))/3
-Center display at Y=Y("[Player]")+(Y("[Crosshair]")-Y("[Player]"))/3
-[Crosshair]: Set X position to XMouse
-[Crosshair]: Set Y position to YMouse
Here by changing the divider (3), if it is lower than 3 i looks farther and over 3 then it looks shorter distance.
(In full screen and other I suggest divider to be 2 or under)
This is easy way and not buggy (in my opinion), and not be needing any counters or etc. and its not so stupidly fast when you move your crosshair.
Edited by the Author.
Edited by the Author.
I have proven new mathematic formula to be true...