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

Need Help with this Decorate

Question

I am trying to get the red dot sight to zoom and fire but it just zooms and nothing else?? i am new with modding

 

 

 

actor 416 : Weapon 16001
{
  
  attacksound "Weapons/416GFIR"
  inventory.pickupmessage "You got the 416!"
  weapon.selectionorder 1
  weapon.slotnumber 4
  Weapon.Kickback 100
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 30
  Decal "bulletChip"
  states
  {
  Ready:
    416G A 0 A_TakeInventory("416Token1",1)
    416G A 1 A_WeaponReady
    416G A 0 A_TakeInventory("416Token2",1)
    loop
  Deselect: 
    416G A 1 A_Lower
    loop
  Select:
    416G A 0 A_JumpIfInventory("416Token1",1,"Ready")
    416G A 1 A_Raise
    loop
  Fire:
    416F AB 3 bright A_FireBullets (3,1.6,1,4,"BulletPuff")
    416F A 1 A_ReFire
    Goto Ready
 Flash:
    TNT1 A 3 bright
    Stop
  Spawn:
    416P A -1
    stop
  AltFire:
    416G A 0 A_JumpIfInventory("416Token2",1,"Ready")
    416G A 0 A_GiveInventory("416Token2")
    416G A 0
    416G A 0 A_GiveInventory("RedDotSight")
    416G A 0 A_SelectWeapon("RedDotSight")
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    goto AltFire+3
    }
}

Actor RedDotSight: Weapon //NOT TO BE SPAWNED

  obituary "%o was Picked-Off By %k's 416 RedDotSight."
  weapon.kickback 80
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  +DONTBOB
  
  States
  {
  Spawn:
    416P A -1
    Loop
  Ready:
    416G T 0
    416G T 2 A_WeaponReady
    416G T 0 A_TakeInventory("416Token2",1)
    Loop
  Deselect:
    416G T 0
    416G T 0 
    Goto AltFire+2
  Select:
    416G T 0 A_ZoomFactor(1.0)
    416G T 0
    416G T 0 A_Raise
    Loop
  Fire:
    416G T 0 A_AlertMonsters
    416G T 0
    416G T 0 A_PlayWeaponSound("Weapons/416GFIR")
    416G T 0 A_FireBullets (0.1, 0.1, -1, 25, "NoRedDotSightGibPuff") 
    416G T 0 A_Refire
    Goto Ready
  AltFire:
    416G T 0 A_JumpIfInventory("416Token2",1,"Ready")
    416G T 0 A_JumpIfInventory("416Token3",2,"AltFireDeselect")
    416G T 0 A_ZoomFactor(3.0)
    416G T 0 A_GiveInventory("416Token2")
    416G T 0 A_JumpIfInventory("416Token3",1,"AltFire2")
    416G T 0 A_GiveInventory("416Token3")
    Goto Ready
    AltFire2:
    416G T 0 A_ZoomFactor(6.0)
    416G T 0 A_GiveInventory("416Token3")
    Goto Ready
  AltFireDeselect: 
    416G T 0 A_TakeInventory("416Token3")
    416G T 0 A_TakeInventory("416Token3")
    416G T 0 A_GiveInventory("416Token1")
    416G T 0 A_GiveInventory("416Token2")
    416G T 0 A_ZoomFactor(1.0)
    416G T 0 A_SelectWeapon("416")
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0
    goto AltfireDeselect+7
  }
}

ACTOR 416Token1 : Ammo
{
    Inventory.MaxAmount 1
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 1
}

ACTOR 416Token2 : Ammo
{
    Inventory.MaxAmount 1
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 1
}

ACTOR 416Token3 : Ammo
{
    Inventory.MaxAmount 2
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 2
}

ACTOR NoRedDotSightGibPuff : BulletPuff
{
  +NOEXTREMEDEATH
}
 

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

The first potential problem I can see is that some of your actor names have a number instead of a letter as their first character.

Quote

https://zdoom.org/wiki/DECORATE_format_specifications said:

classname

The name this new actor is referenced by in the game. While ZDoom will accept a much larger range of values for the name, this should for best compatibility be a valid identifier (alphanumeric plus underscores, but not starting with a digit).

 

Share this post


Link to post
  • 0

Ok so now i changed all the actors to have ASSAULT416token1 and so on. I can now fire one bullet and then it takes all the ammo. I really would like the weapon to switch to red dot sight with minimal zoom maybe not the 2 zooms i have now and slight accuracy improvement. I used real667 huntingrifle and tried to fill in the blanks but i think that was a bad plan. Any help with simplifying the decorate and helping me learn would be greatly appreciated.

Share this post


Link to post
  • 0

The "takes all the ammo" issue is caused by the fact that all frames in the firing animation have duration 0, so that when you press the fire button, the weapon fires one shot, then A_Refire immediately checks if the fire button is still pressed, which it always is, since zero time passed since you pressed it, and so the fire animation immediately restarts, the weapon fires another shot, then A_Refire immediately checks if the fire button is still pressed, and so on until you run out of ammo. To prevent this, at least one frame strictly before the frame with A_Refire should have a non-zero duration.

Share this post


Link to post
  • 0
7 hours ago, scifista42 said:

The "takes all the ammo" issue is caused by the fact that all frames in the firing animation have duration 0, so that when you press the fire button, the weapon fires one shot, then A_Refire immediately checks if the fire button is still pressed, which it always is, since zero time passed since you pressed it, and so the fire animation immediately restarts, the weapon fires another shot, then A_Refire immediately checks if the fire button is still pressed, and so on until you run out of ammo. To prevent this, at least one frame strictly before the frame with A_Refire should have a non-zero duration.

actor 416 : Weapon 16001
{
  
  attacksound "Weapons/416GFIR"
  inventory.pickupmessage "You got the 416!"
  weapon.selectionorder 1
  weapon.slotnumber 4
  Weapon.Kickback 100
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 30
  Decal "bulletChip"
  states
  {
  Ready:
    416G A 0 A_TakeInventory("ASSAULT416Token1",1)
    416G A 1 A_WeaponReady
    416G A 0 A_TakeInventory("ASSAULT416Token2",1)
    loop
  Deselect: 
    416G A 1 A_Lower
    loop
  Select:
    416G A 0 A_JumpIfInventory("ASSAULT416Token1",1,"Ready")
    416G A 1 A_Raise
    loop
  Fire:
    416F AB 3 bright A_FireBullets (3,1.6,1,4,"BulletPuff")
    416F A 1 A_ReFire
    Goto Ready
 Flash:
    TNT1 A 3 bright
    Stop
  Spawn:
    416P A -1
    stop
  AltFire:
    416G A 0 A_JumpIfInventory("ASSAULT416Token2",1,"Ready")
    416G A 0 A_GiveInventory("ASSAULT416Token2")
    416G A 0
    416G A 0 A_GiveInventory("RedDotSight")
    416G A 0 A_SelectWeapon("RedDotSight")
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    416G A 0 A_Lower
    goto AltFire+3
    }
}

Actor RedDotSight: Weapon //NOT TO BE SPAWNED

  obituary "%o was Picked-Off By %k's 416 RedDotSight."
  weapon.kickback 80
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  +DONTBOB
  
  States
  {
  Spawn:
    416P A -1
    Loop
  Ready:
    416G T 0
    416G T 2 A_WeaponReady
    416G T 0 A_TakeInventory("ASSAULT416Token2",1)
    Loop
  Deselect:
    416G T 0
    416G T 0 
    Goto AltFire+2
  Select:
    416G T 0 A_ZoomFactor(1.0)
    416G T 0
    416G T 0 A_Raise
    Loop
  Fire:
    416G T 0 A_AlertMonsters
    416G T 0
    416G T 0 A_PlayWeaponSound("Weapons/416GFIR")
    416G T 3 A_FireBullets (0.1, 0.1, -1, 25, "NoRedDotSightGibPuff") 
    416G T 0 A_Refire
    Goto Ready
  AltFire:
    416G T 0 A_JumpIfInventory("ASSAULT416Token2",1,"Ready")
    416G T 0 A_JumpIfInventory("ASSAULT416Token3",2,"AltFireDeselect")
    416G T 0 A_ZoomFactor(1.0)
    416G T 0 A_GiveInventory("ASSUALT416Token2")
    416G T 0 A_JumpIfInventory("ASSAULT416Token3",1,"AltFire2")
    416G T 0 A_GiveInventory("ASSAULT416Token3")
    Goto Ready
    AltFire2:
    416G T 0 A_ZoomFactor(1.0)
    416G T 0 A_GiveInventory("ASSAULT416Token3")
    Goto Ready
  AltFireDeselect: 
    416G T 0 A_TakeInventory("ASSAULT416Token3")
    416G T 0 A_TakeInventory("ASSAULT416Token3")
    416G T 0 A_GiveInventory("ASSAULT416Token1")
    416G T 0 A_GiveInventory("ASSAULT416Token2")
    416G T 0 A_ZoomFactor(1.0)
    416G T 0 A_SelectWeapon("416")
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0 A_Lower
    416G T 0
    goto AltfireDeselect+7
  }
}

ACTOR ASSAULT416Token1 : Ammo
{
    Inventory.MaxAmount 1
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 1
}

ACTOR ASSAULT416Token2 : Ammo
{
    Inventory.MaxAmount 1
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 1
}

ACTOR ASSAULT416Token3 : Ammo
{
    Inventory.MaxAmount 2
    Ammo.BackpackAmount 0
    Ammo.BackpackMaxAmount 2
}

ACTOR NoRedDotSightGibPuff : BulletPuff
{
  +NOEXTREMEDEATH
}
 

 

 

 

 

 

ok i have solved the ammo problem and i got rid of the over zoom by just making them all 1.o but now i am not getting my firing sound when looking through sights. i see it is there not sure why it wont play?? 

 

 

 

 

ok i fixed my sound problem it was only at 0 so i put a 1 now to work on the flash and weapon movement when in the red dot sight. any help from you great doom modding masters with making this decorate more simple and straight to the point would be much appreciated. 

 

Edited by Raymond Farr : update

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
×