Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, Akow, AndrewAMD), 1,505 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How can I do sniper binocular? #306659
01/23/10 22:11
01/23/10 22:11
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
I tried a way: I increase camera's x, but this way create like a bug.

Actually I want to ask the following:
How can I do sniper binocular?

Re: How can I do sniper binocular? [Re: WickWoody] #306660
01/23/10 22:14
01/23/10 22:14
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
there was an example in the aum wink

you need to move the cam along the x,y and z direction using the pan and tilt . yOu should also change the camera arc.

if the camera doesen't move, you cam is align anywhere in a while(1)...wait(1); loop wink

about cam arc you find in manual

Re: How can I do sniper binocular? [Re: Rei_Ayanami] #306661
01/23/10 22:18
01/23/10 22:18
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
I have a code, look this:
Code:
action oyuncu()
{
	wait(2);
	c_setminmax(me);
	my.skill10 = 1000;
	player = me;
	while(1)
	{
		if(mouse_left == 1 && atis_handle == 0 && mouse_right == 0)
		{
			mermi_at();
			atis_handle = 1;
			wait(-1);
			atis_handle = 0;
		}
		if(mouse_left == 1 && atis_handle == 0 && mouse_right == 1)
		{
			mermi_at_durbun();
			atis_handle = 1;
			wait(-1);
			atis_handle = 0;
		}
		mouse_pos.x = (1024 / 2);
		mouse_pos.y = (768 / 2);
		if(camera.pan < 135)
		{
			my.pan = 135;
		} else if(camera.pan > 225)
		{
			my.pan = 225;
		}
		if(camera.tilt > 45)
		{
			my.tilt = 45;
		} else if(camera.tilt < -45)
		{
			my.tilt = -45;
		}
		my.pan -= mouse_force.x * time_step;
		my.tilt += mouse_force.y * time_step;
		if(mouse_right == 1)
		{
		camera.x = my.x - 4000;
		camera.y = my.y;
		camera.z = my.z + 30;
		camera.pan = my.pan;
		camera.tilt = my.tilt;
		set(durbun_p, SHOW);
		} else {
		camera.x = my.x - 20 * cos(my.pan);
		camera.y = my.y - 20 * sin(my.pan);
		camera.z = my.z + 30;
		camera.pan = my.pan;
		camera.tilt = my.tilt;
		reset(durbun_p, SHOW);
		}
		wait(1);
	}
}



Which AUM have this example?

Last edited by WickWoody; 01/23/10 22:20.
Re: How can I do sniper binocular? [Re: WickWoody] #306665
01/23/10 22:39
01/23/10 22:39
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
what does the code do at the moment?

Re: How can I do sniper binocular? [Re: Rei_Ayanami] #306667
01/23/10 22:43
01/23/10 22:43
Joined: Mar 2009
Posts: 40
DR_Black Offline
Newbie
DR_Black  Offline
Newbie

Joined: Mar 2009
Posts: 40
Me too.
What does this code will do?
Anyway, use camera.arc


every body got some dues in life to pay
Re: How can I do sniper binocular? [Re: Rei_Ayanami] #306668
01/23/10 22:44
01/23/10 22:44
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
This is my code. I have wrote it for sniper rifle. Please review.

Re: How can I do sniper binocular? [Re: WickWoody] #306672
01/23/10 23:56
01/23/10 23:56
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Create a PANEL that is the overlay for the sniper zoom. Then attach a function to 'on_mouse_right' that toggles this panel on and off, with 'toggle(pnl,SHOW)'.

So now you should be able to click and the zoom overlay will switch itself on and off. For the zooming part you can just increase/decrease the camera.arc variable. You should add a check to see if the zoom overlay is visible.
Code:
if(is(pnl_zoom,SHOW))
{
camera.arc += mickey.z * time_step;
}


You should add the above code inside the while loop of your camera/player's action.

Finally to prevent from zooming in too far/out too far, you can add an 'if' statement or you can use the function 'clamp'. You should also add 'camera.arc = 60' inside the panel toggle function, to reset the zoom every time you turn the sniper on/off.

Last edited by DJBMASTER; 01/23/10 23:57.
Re: How can I do sniper binocular? [Re: DJBMASTER] #306757
01/24/10 18:41
01/24/10 18:41
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Hmm... I will try this. Thanks.

Re: How can I do sniper binocular? [Re: WickWoody] #306763
01/24/10 19:34
01/24/10 19:34
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
But now, bullets don't go to middle of crosshair.

Re: How can I do sniper binocular? [Re: WickWoody] #306799
01/25/10 01:05
01/25/10 01:05
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Quote:
bullets don't go to middle of crosshair.

They should, if you're putting them at a proper start position.


Eats commas for breakfast.

Play Barony: Cursed Edition!
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1