Problem with aiming

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!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Problem with aiming

Re: Problem with aiming

by Jekyll Grim Payne » Sun Dec 17, 2017 9:50 am

Two things I can tell you right away. First, man, this formatting is really hard to read. Second, it's not a good idea to make the zooming state a 0-tic one (and in your case your zoom out state's length is 0). If you hold a button even for a bit, it'll zoom out, go into ready state and then right into zoom in state. Can't say anything else definite , but I threw together this and it works fine:

Code: Select all

actor PistolZoom : Pistol
{
Weapon.SlotNumber 2
states
		{
		AltFire:
			TNT1 A 0 A_JumpIfInventory("Zoomed",1,3)
			PISG A 5 A_ZoomFactor(3)
			TNT1 A 0 A_GiveInventory("Zoomed",1)
			goto ready
			TNT1 A 0 A_ZoomFactor(1)
			PISG A 5 A_TakeInventory("Zoomed",1)
			goto ready
		}
}
			


Actor Zoomed : Inventory
{
	inventory.maxamount 1
	-COUNTITEM
}

Problem with aiming

by DenTheUA » Sat Dec 16, 2017 2:48 am

So I am actually working on a project, and I've done a weapon with sights.

The problem is that when I press the altfire button first time, gun becames aimed, but when I press Altfire second time, it doesn't go to Ready state, but instead it flickers and stays aimed.

Here's my lump:
Spoiler:

Top