PDA

View Full Version : Weapon displays



flyingmonkey3
February 26th, 2011, 10:53 AM
I have a question about how weapon displays (like the AR ammo display) work. I can see that there is a function for ammo display in the weapon itself, but when I look at the numbers shader I don't see anything that uses the function.

Donut
February 26th, 2011, 12:38 PM
its really wierd the way it works. you know you have to put actual planes on the model for the numbers texture, right? when you do that, each plane for the number texture (each digit, so the ar has 2 planes) has a material name thats exactly the same except theres a number at the end of the name, usually 0 or 1 or something. i cant remember exactly how to do it, but import the model into 3dsmax and look at the material names.

i can tell you this: the assault rifle.weapon tag has these fields ABCD out. those are functions that correspond to various weapon states. loaded ammo is one of the states. the assault rifle puts that state out (i think its C), and the shader for the numbers has a field where you specify the source for the numbers (which would be C, if thats the output function). from there it comes down to the number at the end of the material name.

again, import the assault rifle model and look at the planes on the screen and their material names. that should help greatly.

flyingmonkey3
February 26th, 2011, 12:42 PM
Alright. Thanks for the info.

E: Well I can't seem to find any field where I could specify the source for the numbers. Or at least, I don't see a field that has one of the states from the weapon specified.
2003

flyingmonkey3
February 26th, 2011, 06:05 PM
Double post, but I've found that the numbers shader takes states from function A even though this doesn't appear to be specified anywhere. I also looked at the CMT AR and the numbers shader behaves the same way there. What is peculiar though, is that the color changing of their display seems to be independent from the numbers. In fact, at one point I had changed all the functions so that none of them had anything to do with primary ammunition and yet the CMT AR display still knew when to change colors. Clearly it's changing colors through some other method.

E: After a bit of lurking I came across a post that said that the color changing was done through animations.

Donut
February 26th, 2011, 06:22 PM
oh yeah the color change IS done through animations. the model actually has 3 separate screens on it, all with their own nodes. the fp animations use the "ammunition" animation to know when to change screens. you know how the needles disappear on the needler as you fire? the same principle applies to the ar screen.

flyingmonkey3
February 26th, 2011, 06:25 PM
So I'm still confused as to how the numbers shader knows what function to take states from. Does anyone know where this would be specified?