Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sniper rifle scope

Author
Message
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 5th Mar 2003 23:48
does anyone know how to make a aiming scope that can zoom and pan I can't understand how you would do something like that.
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Mar 2003 00:01
Someone else may have a better solution, but this is what I use when coding scopes.

Call the function like this:

Zoom(3.14159,20)

rem /* Zoom (scope) */
rem /* Quake style zoom effect by Electron */

function Zoom(pi#,zoom_num)
rem /* Returnkey held down */
if ReturnKeyPressed<>1
if returnkey()=1
ReturnKeyPressed=1
for n=1 to zoom_num step 1
set camera fov (pi#/n)
sync
next n
endif
endif

rem /* Returnkey released */
if ReturnKeyPressed<>0
if returnkey()=0
ReturnKeyPressed=0
set camera fov (pi#*zoom_num)
endif
endif
endfunction

If you don't work for it, how do you expect to get it?
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 6th Mar 2003 00:27
I'll try the scope and tell you how it works. Thanxs for the code.

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 6th Mar 2003 00:53
when I try to use the code as a function it starts up then crashes why is this

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 6th Mar 2003 01:01
use field of view:

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 6th Mar 2003 01:21
Id use a sprite and zoom in the camera

Current - RPG: Eternal Destiny
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy! Oh ya, and Tat has a plugin for that!
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 6th Mar 2003 01:46
thanx flashingblade your scope really helped me out.

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 6th Mar 2003 03:41
flashingblade what is the actual zooming part I cant seem to find out.

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 6th Mar 2003 03:44
Murdock743 - the "set camera fov" command is doing the actual "zooming".

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 6th Mar 2003 11:17
yep camera fov
also curvevalue makes it zooooooooooom rather than go from unzoomed to zoomed
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Mar 2003 11:58
well... i'm soooooooooooo bloody sorry my code didn't help you out, that's the last time I help anyone out!!! BTW - it doesn't crash on my system, maybe u should have used sync on at the start of your code before trying to run it.

cheers!

If you don't work for it, how do you expect to get it?
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Mar 2003 12:25
Murdock743, have you EVER heard of SYNC? maybe you should use it in your main loop, LOL that'll help

If you don't work for it, how do you expect to get it?
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Mar 2003 14:08
I apologise for that last post Rich

If you don't work for it, how do you expect to get it?
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 6th Mar 2003 22:56
yes I am quite aware of the sync and I also had that in it so yes I know what it is

Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 6th Mar 2003 23:58
whatever!

If you don't work for it, how do you expect to get it?
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 7th Mar 2003 04:03
Electron your not very nice I cant do any thing about the fact that your program snipplet wouldn't work for me. I'm also not a very good programmer so even if I wanted to try and fix it I pry couldn't. Plus you dont have to get mad at me if I can't do something correctly I still have to use the reference manual to code because I haven't memorized the whole langage(and I'm still learning)

CarlTaylor
21
Years of Service
User Offline
Joined: 13th Jan 2003
Location: United States
Posted: 7th Mar 2003 07:04
yeah lay off a bit please, electron

baseball = life
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 7th Mar 2003 12:18
Murdock743, yeah, I do apologise, sorry please forgive me

seriously, it does work on my system, although flashingblades code looks good it was very slow and buggy on my system, did you find that? or did it work fine?

cheers and respect!

If you don't work for it, how do you expect to get it?
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 8th Mar 2003 02:43
Flashing blades is not buggy it works perfect as a different program so I had to ask for what is doing the acuall zooming.

Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 8th Mar 2003 13:44
just saying that I tried flashingblades code out and it didn't zoom properly sorry, just what I noticed.

If you don't work for it, how do you expect to get it?
Electron
21
Years of Service
User Offline
Joined: 28th Feb 2003
Location: United Kingdom
Posted: 8th Mar 2003 13:45
my specs:

Pentium 3 450 MHz
192 MB SDRAM
Geforce 2 MX 400

If you don't work for it, how do you expect to get it?
o0o0The Code Keeper0o0o
21
Years of Service
User Offline
Joined: 3rd Mar 2003
Location:
Posted: 8th Mar 2003 21:06
lets jess get along people...we're jess here to learn...

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 00:04
I have this code but I did some thing wrong can you fix it so the scope will zoom.

I know I did some ting wrong because it wont work and rich the link for patch 3.1 wont work for me.

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 01:14
1st you gotta have a loop
2nd make sure do..loop not got the x#=0,y#=0 fov#=90 inside it
3rd you gotta set camera fov to fov#
4th sync on..sync?
5th rotate camera to x#,y#

post your complete code if you can't get it to work.
I assuming ^that aint your complete code.
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 01:15
6th gotta make fov# curve back to 90 when button released
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 15:00
no its not my complete code its the sub
Christian

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 15:00
I'll give it a try

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 15:09
I'm so confused on how to do this!!!!!

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 17:25
post your complete code
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 9th Mar 2003 18:13
I know this is probably a stupid question, but have you just played with 'set camera fov' to see what you can do, then just playaround with 'curvevalue' etc...

I find it's best to work with one reserved word at a time to get the hang of it.
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Mar 2003 18:24
yes do what xoid said

get my origional snippet and tinker with it until you fully understand what each command does.
Xoid
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location:
Posted: 9th Mar 2003 18:28
Murdock743, playaround with FlashingBlades code and break it down, try one section at a time, change values etc... well worth doing, use your imagination, don't rush and your get there
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 20:07
Thanxs I will amd I'll tinker with the snipplet I give you my whole sniper scope code when I get it finished if I still cant get it to work I see what you can do with it.
Christian

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 9th Mar 2003 20:14
sorry about the typos I retype what I was saying here:
Thanx I will tinker with the snipplet I'll give you my whole sniper rifle scope code once I finish tinkerin' and remake the code. If I still have problems I have you figure out whats wrong.

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 10th Mar 2003 00:09
I got it to work I think here is the code for the scope I made I used all the same peramiters as flashing blades.


Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 10th Mar 2003 00:11
I also have another question concering the scope how would I make it toggle as if I push the key once it stays on and I push it again to return to the regular veiw.
Christian

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 10th Mar 2003 02:23
like this:



I bet you could of figured that out.
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 10th Mar 2003 02:34
one more thing how do you make is zoom right away not zooooom.
Christian

Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 10th Mar 2003 02:53
I just found a BIG BUG I am still making my game so I was using the DBPro tutorial as my parent program and my code for the scope will not work. Well it will but I freeze every thing and can zoom and move the camera or I can zoom and my camera wont move what should I do???[img][/img]

Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 10th Mar 2003 03:17
one more thing how do you make is zoom right away not zooooom.

i posted snippet at 12.23 GMT - you asked this question at 12.34 GMT. I think it might be good for you to try to figure this one out (heres a clue CURVALUE makes it ZOOM).

As for the bug - you mean my snippet or a program of yours that uses the snippet code?
'cus the snippet works fine for me.
Murdock743
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location:
Posted: 11th Mar 2003 02:48
my code not yours I have some ideas how to fix it I'll try that.
Christian

Login to post a reply

Server time is: 2024-09-19 23:13:30
Your offset time is: 2024-09-19 23:13:30