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.
[DECORATE] Make weapon have laser sight?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- m8f
-
- Posts: 1445
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
- Contact:
Re: [DECORATE] Make weapon have laser sight?
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?
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.
- m8f
-
- Posts: 1445
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
- Contact:
Re: [DECORATE] Make weapon have laser sight?
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?
Would you know how I would only apply it to one weapon?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.
- m8f
-
- Posts: 1445
- Joined: Fri Dec 29, 2017 4:15 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Manjaro Linux
- Location: Siberia (UTC+7)
- Contact:
Re: [DECORATE] Make weapon have laser sight?
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.
If you can use ZScript, you can set CVars directly. See here.