Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Foxhead

Help with Iron-Sights/ Aim

Recommended Posts

How do i Create a Iron-sight (that need to be hold down) on a custom weapon? i Trying to make a Kar98 in doom, with Slade, and i am struggling understanding all those codes :( (I Very new at Coding but i manage to make one custom weapon using the Tutorials from GUNLABS.) 

 

File for help:
help please - kar98.zip

Share this post


Link to post

First of all, NEVER use DECORATE if you can help it. It is deprecated and will no longer see development. ZScript is the newer, and more preferred, approach to coding weapons. Only use DECORATE for backwards compatibility.

 

Attached is a WAD (well, a zip with the WAD in it) with newly implemented iron sight code. The iron sights will only stay up as long as the alt-fire button is held, like you requested. Here's how I did it.

 

-Converted your weapon code to ZScript. You're welcome.

-Implemented a custom state that handles the actual bullet called "AltFireShot"

-Had the Altfire state check whether the alt-fire button is being held and, if it isn't, go back to Ready. Otherwise, if the player presses the fire button while the alt-fire button is being held, jump to AltFireShot.

 

EZ PZ Lemon Squee-ZScript. Plug the wad into Doom 2, type "Summon Kar98" and have fun. :)

 

KAR98Fixed.zip

Share this post


Link to post

Omg thank you so much man, i've being using Decorate but im going to try to understand this zscript format that you say. Thanks again!

Share this post


Link to post
18 hours ago, Thfpjct said:

Omg thank you so much man, i've being using Decorate but im going to try to understand this zscript format that you say. Thanks again!

No problem. This was kind of fun actually. Hadn't really done iron sights myself. A good little test of my abilities, I must say. :3
 

The ZDoom wiki actually has a guide on how to convert DECORATE code to ZScript. It's mostly syntax differences, but I know from experience that syntax can trip people up. And by "people" I mean "me." XD

Here's the guide. Don't have TOO much fun now. :P

Share this post


Link to post
On 7/21/2019 at 6:36 AM, Johnny B. Getgoode (The Guy) said:

First of all, NEVER use DECORATE if you can help it. It is deprecated and will no longer see development. ZScript is the newer, and more preferred, approach to coding weapons. Only use DECORATE for backwards compatibility.

That might be good advice if it weren't for the fact that zandronum doesn't support zscript as far as I know, and probably never will. Unfortunately, if you want your mod to be viable for multiplayer, you can't use zscript.

Share this post


Link to post
11 hours ago, Seidolon said:

That might be good advice if it weren't for the fact that zandronum doesn't support zscript as far as I know, and probably never will. Unfortunately, if you want your mod to be viable for multiplayer, you can't use zscript.

That's sort of what I was going for by saying "backwards compatibility", since Zandro is literally just an older version of GZDoom with better multiplayer. Though in retrospect, I should have been more direct about that.

OP didn't specifically say he was targeting Zandro, so I assumed he was just going for GZ. So I made an assumption, and again, that's on me.

To be fair, though, ZScript is well worth investing in, at least for single-player mods. Maybe even multiplayer as well, when GZ eventually gets C/S support.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×