Weapon name HUD
by Tasty Green Pees :-, · in General Discussion · 04/22/2006 (6:42 am) · 7 replies
I've used this resource http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1786
to get the ammo amount of my weapon to show on the screen.
I was wondering how I can also get my weapon name to show. Can someone help please.
to get the ammo amount of my weapon to show on the screen.
I was wondering how I can also get my weapon name to show. Can someone help please.
About the author
#2
04/23/2006 (9:15 am)
Thanks for the wisdom ;^)
#3
04/24/2006 (3:52 am)
I have noticed that the weapon Name and picture hud resources are not Dynamic I have one in my game that is dynamic I think i'll make a resource
#4
04/24/2006 (9:15 am)
That would be good, Brian. I've manage to hack something that achieves what I wanted but its rather crude. Works fine but it would be nice to have something clean and lean.
#5
04/29/2006 (4:36 pm)
Ok i'll post it sometime this week
#6
05/01/2006 (3:40 pm)
Here is the resource http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10382
#7
05/04/2006 (9:40 pm)
Bryce's tip for the day:Quote:Give a man a fire and he will be warm for a day. Set a man on fire and he will be warm for the rest of his life.
Torque Owner Tim Heldna
It's quick and easy to throw in and will serve as a good example of how one can alter code to meet specific requirements.
If an image representation is not for you and you'd prefer to stick with text, it wouldn't be hard to duplicate and alter the ammo resource you're using to allow for weapon names. The only real difference would be checking for the mounted weapon image directly as opposed to ammo inventory.
The basic steps would be:
- create a new weapon text profile
- create a new text control within your playGui
- add some code to your onMount function in weapon.cs that makes a call to a server side function which jumps to a clientCmd
- create the clientCmd function that will determine what text to display in your text control based on the mounted weapon image
I haven't just spewed out the exact code that you'll need as I feel this is an easy task to accomplish and will serve as a good leraning experience for you. As the old Chinese proverb says...
-------------------------------
**Tim's tip for the day**
-------------------------------
If you want to refer people to a url, rather than just pasting the whole thing in use tags to create a hyperlink like I have at the top of this thread. It gives you a greater chance of people actually going to the page you're trying to direct them to, you won't believe how lazy some people can be. When you create a new forum post, there's a link you can click if you don't know the correct syntax to use.
It reads (Want to use bold, italics and add links to your text? Click here to learn how)