Author Topic: Bind to open text/image?  (Read 4074 times)

Shifty

  • Posts: 75
  • Turrets: +0/-0
Bind to open text/image?
« on: July 16, 2010, 12:11:48 pm »
Does anyone know a way of using a bind to open an image, or text? Like a chatmenu for example where you have down 1 side of the screen

1.Buy
2.General
3.admin
...etc

OR

an image, which could be used to display text in a image for a chat menu, OR (yes its pretty trivial) for example, right click is md scope, so have right click binded (when on human team) to +button5;[open image], the image being a scopy outline surrounding the screen so it actually looks like you are looking through a scope, not just using your super human zoomy powers.


I dont mind if this is done within the cfg, by execing another cfg, or by opening a menu file (while still able to move and shoot and all). Anyone know a way of doing this?

F50

  • Posts: 740
  • Turrets: +16/-26
Re: Bind to open text/image?
« Reply #1 on: July 16, 2010, 03:22:33 pm »
What you'll need to do in order to make this work is essentially build a custom HUD. The hud will check cvars and show the appropriate message or picture when the cvars are set by your binds.

Here's a tutorial on HUD making, but I haven't read it, so I don't know if it is any good.

http://tremulous.net/forum/index.php?topic=9425.0
"Any sufficiently advanced stupidity is indistinguishable from malice." -- Grey's Law


Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Bind to open text/image?
« Reply #2 on: July 16, 2010, 11:53:25 pm »
Hmmm....I've read that before, it kind of outlines what you need but lacks the skills like...wtf do things mean by rect, and all that (so you understand what you are writing, not just copying other peoples work and editing it till it works your way). It is a good tutorial though, thanks for the help. I think I'll start by taking the volt hud appart, as I noticed he created several cvars in that.

F50

  • Posts: 740
  • Turrets: +16/-26
Re: Bind to open text/image?
« Reply #3 on: July 17, 2010, 12:17:29 am »
Yeah, I did some fiddling with superpie's HUD. rect if you don't know already creates a rectangle for your picture or text to go into, the first two digits IIRC are x and y, and the second two are height and width (actually I think its width and then height, but I'm not sure anymore). It will take a lot of experimenting though. But yeah, the best way to do figure things out for lack of an explanatino is to edit until you know what the other guys work does, then build something of your own. You might consider posting all the answers you find from this project, to help future newbies.
« Last Edit: July 17, 2010, 12:19:20 am by F50 »
"Any sufficiently advanced stupidity is indistinguishable from malice." -- Grey's Law


Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Bind to open text/image?
« Reply #4 on: July 17, 2010, 01:44:28 am »
Yeah, well I am now using the volt hud as it had the hud i was using, in it anyway. Im editing out the parts I dont like and all. I found a file in ui/hud/common called common.cfg, in this volt made several of his cvars so Ill just add in mine =D. Im having problems with a few other things about the hud though im gonna start a new topic about them as it isnt really anything to do with what this topic is about.

EDIT:

Oh, and with the rect thing....with the x-y thing..what point of the box does this point to? Is the box made with the corner to the x-y co-ordinates? or with the center there? And what are the limits of the co-ordinates? is the max 600x800 and if you use a bigger screen size its scaled up? or what?
« Last Edit: July 17, 2010, 02:54:12 am by Shifty »