Light activated by zooming

Post Reply
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Light activated by zooming

Post by CaptainPoopface »

Does anyone know how to make a light attached to a weapon only work when the weapon is zoomed? There is a bit for "enables integrated night vision" but I think it's meaningless. I was wondering if there is a string id that can be set to the primary scale of an attached [ligh] tag so it only is activated when zoomed. Darkshallfall made a "night vision" HUD for the zoomed sniper rifle, but I think it was just a translucent green mask on the HUD, not anything that would illuminate a dark area.

I could make it work if I give up a trigger or crouch or melee, but I would prefer to use the zoom.
User avatar
JacksonCougar
Huurcat
Posts: 2460
Joined: Thu Dec 06, 2007 11:30 pm
Location: Somewhere in Canada

Re: Light activated by zooming

Post by JacksonCougar »

I would start by looking into the zoom bitmap and shader and see if it lists a SID that would be interchangeable for your goals. Then see about linking a light source to the weapon attachments with that SID.

However even if that did work I still would think you would have an issue because I would imagine that all the players would be able to see the light as well.
User avatar
Grimdoomer
Admin
Posts: 1835
Joined: Sun Dec 09, 2007 9:09 pm

Re: Light activated by zooming

Post by Grimdoomer »

There use to be an old tutorial on how to add night vision to the sniper rifle by swapping some effects to that of the plasma rifle charging effects, it only worked when zoomed in iirc. If you can find that tutorial on the halomods archive it may provide some useful information.
Don't snort the magic, we need it for the network.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: Light activated by zooming

Post by XZodia »

I don't know the details but to clarify, you want to make the light only visible to the user.
And for the primary scale you could just search the list for related SIDs in entity, try searching zoom or r_thumb
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
CaptainPoopface
Posts: 714
Joined: Sat Feb 16, 2008 5:47 am

Re: Light activated by zooming

Post by CaptainPoopface »

Grim's post rings a bell in the back of my mind, but I can't find the tutorial on halomods. I know effects and lights can be set to only be visible in first or third person. I was hoping it was some kind of string ID I could link an attachment to. My last hope is the string right_zoom, which comes up in the suggestion box. But that thing pulls strings out of everywhere, including jmads and bitmaps and everywhere else. I'll just have to try it.

The idea of a shader is also plausible. There is one map in the campaign where you're underwater and reflections of light on the water are cast on the biped from above. It's a really cool shader trick that I've never understood (or seen used in a mod). But as Jackson says, I don't think a shader can be set to render only in 1st or 3rd person.
User avatar
Gary
Posts: 1946
Joined: Thu Feb 14, 2008 10:17 pm
Location: USA, FL
Contact:

Re: Light activated by zooming

Post by Gary »

CaptainPoopface wrote:Grim's post rings a bell in the back of my mind, but I can't find the tutorial on halomods. I know effects and lights can be set to only be visible in first or third person. I was hoping it was some kind of string ID I could link an attachment to. My last hope is the string right_zoom, which comes up in the suggestion box. But that thing pulls strings out of everywhere, including jmads and bitmaps and everywhere else. I'll just have to try it.
Yeah. I remember it was used the plasma pistol's FP charging light.
CaptainPoopface wrote: The idea of a shader is also plausible. There is one map in the campaign where you're underwater and reflections of light on the water are cast on the biped from above. It's a really cool shader trick that I've never understood (or seen used in a mod). But as Jackson says, I don't think a shader can be set to render only in 1st or 3rd person.
I think that's probably just a light projecting a shader/animated texture.
User avatar
troymac1ure
Keeper of Entity
Posts: 1282
Joined: Sat Aug 09, 2008 4:16 am
Location: British Columbia, Canada, eh
Contact:

Re: Light activated by zooming

Post by troymac1ure »

I did a mod on Warlock for SWAT where the BR had a green colored flashlight attached that was only visible in first person (and I was never good at mods, so I'm sure it was something simple), however never touched the only when zoomed thing. I believe it was just a check box or something.
I think I still have it, I'll check and post back.

EDIT:
In the [ligh] tag under the first set of flags there is a checkbox for "Only render in 1st person".
Also, in the [weap] attachments I have a 3p flashlight attahced to a marker called "weapon_background_zoomed". Not sure why, but meh.

Hopefully some of this helps.
Post Reply