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

What's wrong with my zoom?

Question

Can someone help me figure out why my zoom is broken? I had already made this gun and then followed a tutorial to allow the player to aim down the sights. The sprites for the rifle getting closer to the camera, and for the zoomed rifle firing, will not show and instead are blank. Also once I zoom in the only way to zoom out is to switch weapons. If I right click it will zoom out and then back in right away and I can't figure out why it's doing this.

ACTOR Rifle : Pistol
{
inventory.pickupmessage "You got the Rifle!"
	weapon.bobstyle alpha
	weapon.bobrangex 0.5
	weapon.bobrangey 1.0
	weapon.bobspeed 2.5
decal "bulletchip"
	states
	{
	Spawn:
		Rifl a -1
		stop
	Ready:
		TNT1 A 0 A_JumpIfInventory("RifleZoomed",1,"ReadyZoomed")
		RIF2 A 1 A_WeaponReady
		Loop
	ReadyZoomed:
		RIFZ A 1 A_WeaponReady
		Goto Ready
	Deselect:
		TNT1 A 0 A_TakeInventory("RifleZoomed",1)
		TNT1 A 0 A_ZoomFactor(1)
		TNT1 AAAAAAAA 0 A_Lower
		RIFS ABCD 1
		Loop
	Select:
		TNT1 A 10
		TNT1 A 0 A_PlaySound("weapons/rifle/select")
		TNT1 AAAAAAAA 0 A_Raise
		RIFS ABCD 1 A_WeaponReady(WRF_NOFIRE)
		Goto Ready
	Fire:
		RIF2 A 0 A_JumpIfInventory("RifleZoomed",1,"FireZoomed")
		RIF2 A 1
		RIF2 B 1
		TNT1 A 0 A_PlaySound("weapons/rifle/fire", CHAN_WEAPON)
		RIF2 C 1 bright A_FireBullets (6.2, 7.0, 1, 3, "BulletPuff")
		TNT1 A 0 A_ReFire
		RIF2 D 2 bright
		RIF2 E 2		
		RIF2 F 2
		RIF2 G 2
		RIF2 H 1
		RIF2 A 2
		Goto Ready
	FireZoomed:
		TNT1 A 0 A_PlaySound("weapons/rifle/fire", CHAN_WEAPON)
		RIFZ FGH 2 bright A_FireBullets(0,0,1,5,"BulletPuff",1)
		TNT1 A 0 A_ReFire
		Goto Ready
	Altfire:
		RIF2 A 0 A_JumpIfInventory("RifleZoomed",1,"UnZoom")
		RIF2 A 0 A_GiveInventory("RifleZoomed",1)
		TNT1 A 0 A_ZoomFactor(2)
		RIFZ ABCDEFGH 1
		Goto Ready
	UnZoom:
		TNT1 A 0 A_TakeInventory("RifleZoomed",1)
		TNT1 A 0 A_ZoomFactor(1)
		Goto Ready
	Flash:
		TNT1 B 2 Bright A_Light2
		TNT1 A 1 Bright A_Light1
		Goto LightDone
	}
}

 

Share this post


Link to post

1 answer to this question

Recommended Posts

  • 0

The usual way to implement zoom is with a key binding, for example

 

alias zoomout "fov 105;  rebind zoomin;"
alias zoomin "fov 90;  rebind zoomout;"
bind \

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
×