|
|
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
Expert
|
Expert
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
|
there was an example in the aum  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  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
OP
Junior Member
|
OP
Junior Member
Joined: Oct 2009
Posts: 90
|
I have a code, look this:
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: Rei_Ayanami]
#306667
01/23/10 22:43
01/23/10 22:43
|
Joined: Mar 2009
Posts: 40
DR_Black
Newbie
|
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: WickWoody]
#306672
01/23/10 23:56
01/23/10 23:56
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
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.
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: WickWoody]
#306799
01/25/10 01:05
01/25/10 01:05
|
Joined: Dec 2008
Posts: 1,660 North America
Redeemer
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,660
North America
|
bullets don't go to middle of crosshair. They should, if you're putting them at a proper start position.
|
|
|
|