home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


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, 5881 views, last view: 05/18/2024 20:41

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    Go to next 20 messagesGo to last 20 messages

#1: ..

by Julius on 08/27/2007 15:38

I am really just guessing here, as I havn't played with cubescript jet... but you could maybe "misuse" the 2D-gui system for that?

reply to this message

#2: ..

by SiCKO on 08/27/2007 17:52

I can't cubescript well, I would like some help from someone who knows cubescript well, but I do like your idea.
Thanks for posting.

reply to this message

#3: ..

by HashBox on 08/27/2007 20:47

Not that this is any help but I think 1024x1024 is a bit large for an OpenGL Texture

reply to this message

#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

   Board Index    Go to next 20 messagesGo to last 20 messages


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
54038949 visitors requested 71819545 pages
page created in 0.029 seconds using 9 queries
hosted by Boost Digital