Page 1 of 1

[DECORATE] Make weapon have laser sight?

Posted: Mon Sep 24, 2018 11:52 am
by Graaicko
Hello. I was wondering if it would be possible to make a hitscan weapon have a laser dot similar to the photos below. It would use a small sprite that is separate from the weapon sprite itself.




Re: [DECORATE] Make weapon have laser sight?

Posted: Thu Sep 27, 2018 10:41 am
by m8f
Is this solution ok? It uses ACS + ZScript, and ZScript part can be easily converted to Decorate if you don't need customizable color and size.

Re: [DECORATE] Make weapon have laser sight?

Posted: Thu Sep 27, 2018 10:47 am
by Graaicko
Yes, This is actaully what I'm looking for. But I would like the sight to be automatically be toggled on a certain weapon when selected.

Re: [DECORATE] Make weapon have laser sight?

Posted: Thu Sep 27, 2018 10:56 am
by m8f
In this mod, there is a user CVar named m8f_wm_ShowLaserSight. Set it to 1 whenever you want the Laser Sight to be shown, and to 0 when you want the Laser Sight to be hidden.

Re: [DECORATE] Make weapon have laser sight?

Posted: Thu Sep 27, 2018 11:17 am
by Graaicko
m8f wrote:In this mod, there is a user CVar named m8f_wm_ShowLaserSight. Set it to 1 whenever you want the Laser Sight to be shown, and to 0 when you want the Laser Sight to be hidden.
Would you know how I would only apply it to one weapon?

Re: [DECORATE] Make weapon have laser sight?

Posted: Thu Sep 27, 2018 11:26 am
by m8f
If you have to use Decorate, you have to create simple ACS script like here, using SetUserCVar instead of GetCVar(), and call this ACS script from weapon's Select state if you want to enable Laser Sight, and in Deselect state to disable it.

If you can use ZScript, you can set CVars directly. See here.