Binding a key to show a 2d image? |
by SiCKO
on 08/27/2007 07:44, 23 messages, last message: 09/01/2007 07:39, 5861 views, last view: 05/04/2024 19:56 |
|
I want to add a simple zoom in feature, that causes an image to appear on the screen, that is basically a sniper scope.
I so far have this code:
bind "Mouse2" [fov 75; hudgun 0; sensitivity 2; onrelease[fov 120; hudgun 1; sensitivity 7]]
It works, but it doesn't do what I want it to do, which is basically open an image from a path, and close it.
The image is a 1024 x 1024 2d image of a sniper scope.
I just don't know how I can make Sauer directly open that image onto the screen, so I can use it for better aiming.
|
|
Board Index
|
|
#4: Re: .. |
by Julius
on 08/27/2007 21:01, refers to #3
|
|
Not if it is ment to cover most of the screen... actually 1024 might be even a bit too small for that.
reply to this message
|
|
#5: gui |
by fjlkdsfjlksdfjconorfjdsfjdshfkjs
on 08/27/2007 22:33
|
|
Yeah, use the 3d gui, but call
gui2d 1 when zooming in
and gui2d 0 when zooming back out
reply to this message
|
|
#6: Re: .. |
by SheeEttin
on 08/28/2007 01:28, refers to #4
|
|
You don't need (nor want) such a large image. You'll want to make it smaller and scale it up.
Anyway, to display it, I'd suggest tweaking the source to display a different crosshair on command. It shouldn't be too hard if you can figure out the syntax of COMMAND().
If you do it, try making a patch, and it might be added to Sauerbraten as a whole.
reply to this message
|
|
#7: .. |
by Acord
on 08/28/2007 01:31
|
|
That is a very, very good idea.
reply to this message
|
|
#8: Re: .. |
by SheeEttin
on 08/28/2007 01:42, refers to #7
|
|
Why thank you. :D
reply to this message
|
|
#9: Re: .. |
by SanHolo
on 08/28/2007 08:55, refers to #6
|
|
Problem with this is that the max crosshair size currently is 50, which does not cover the screen.
And if you want to have needle-thin crosshairs within the scope, you'll need a big sized image, otherwise it will look blurry.
reply to this message
|
|
#10: Re: .. |
by Drakas
on 08/28/2007 11:24, refers to #9
|
|
.... and using the same image for all resolutions wouldn't give the best results, either ^_^
reply to this message
|
|
#11: Re: .. |
by SiCKO2
on 08/29/2007 02:47, refers to #10
|
|
For some reason the resend cookie thing doesn't work on my real email, so I used a random one and a different name...
Anyway, my problem isn't the image or crosshair size, I can do that. Even if I have to go through trial and error, it is not something I will have to go back here about.
#9, I will only make it for 1 resolution, since it is personal.
I just want to know the syntax for showing an image in a bind, that is all.
reply to this message
|
|
#12: .. |
by Sicko3
on 08/29/2007 03:00
|
|
Yeah, the resend cookie thing isn't working at all. I don't feel like numbering my post after my name. What is up with this?
reply to this message
|
|
#13: AC |
by dkfsdfhjskdhfconorfjkdhfkjsdhjk
on 08/29/2007 09:02
|
|
AssaultCube has this.
It really doesn't fit in with sauer
(simplicity, gameplay, etc)
But, AC has one sized image.
It works from 640x400 -> 1280x800 although, with my widescreen, the scope does look a bit squashed.
reply to this message
|
|
#14: .. |
by makkE
on 08/29/2007 09:41
|
|
Script to display an image on screen: there is no such thing in Sauerbraten or AC or Cube.
reply to this message
|
|
#15: re:.. |
by SiCKO4
on 08/31/2007 01:51
|
|
I don\\\\\\\\\\\\\\\'t know the syntax to show an image even in a script still.
Can anyone at least tell me that?
reply to this message
|
|
#16: .. |
by makkE
on 08/31/2007 01:56
|
|
You can not show an image using script.
reply to this message
|
|
#17: Re: showing images |
by MeatROme
on 08/31/2007 02:15, refers to #16
|
|
not quite true ... you can -
inside gui-menus - use guiimage for it.
There's also possibilities that have opened up since the fonts went cfg-style ... but I bet this isn't what is required.
Oh ... the sniper-zoom ... heh, no - no way, jose - just can't do that with scripting. You'll need to learn C/C++ and start modding your own game for it.
reply to this message
|
|
#18: .. |
by Acord
on 08/31/2007 07:33
|
|
So say you made a function in the code that would allow the script to call up an image...
reply to this message
|
|
#19: Re: showing images |
by Quin
on 08/31/2007 08:32, refers to #17
|
|
This has since changed in CVS. Scripts will be able to change crosshairs in the next release.
reply to this message
|
|
#20: Re: showing images |
by Muki Hyena
on 08/31/2007 09:46, refers to #19
|
|
Oh dude script-based crosshairs? I love you guys, I was just talking about this... I wouldn't have happened to have influenced the idea eh? ;p
reply to this message
|
|
#21: .. |
by SanHolo
on 08/31/2007 16:03
|
|
Is the max-crosshair-width of 50 also gone in CVS? That'd help a lot.
reply to this message
|
|
#22: Re: showing images |
by SheeEttin
on 08/31/2007 16:23, refers to #20
|
|
And in other news, you can lift the restriction on crosshairsize by changing line 794 in src/engine/rendergl.cpp. Just change the current max, 50, into something like 1000 and recompile.
I don't know if it'll be helpful or not, but with the default crosshair, a crosshairsize value of 900 is about right to fill the width of the screen. On a resolution of 1280x1024, anyway. Dunno if anything else will affect it.
reply to this message
|
|
#23: .. |
by sicko5@yahoo.com
on 09/01/2007 07:39
|
|
Ohhh, next release? I'll just have to wait then.
reply to this message
|
|
|
Board Index
|
|