Projectile will not fire

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

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!)
Post Reply
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Projectile will not fire

Post by TIIKKETMASTER »

Hi all, im wondering why my weapon will not fire a projectile at all.

If i use the console, i can directly summon the projectile with no problems and the projectile does as intended.

The second i try to use A_FireCustomMissile (...) in a DECORATE weapon however, it just does not seem to work.

I am using a blank-slate .IPK3 File, so if there is anything else i need to add besides the core functions of the projectile (and weapon), please tell me.

Thanks! :D
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Projectile will not fire

Post by ramon.dexter »

Sorry, my crystalball is not working right now. Can you post the weapon's code, at least?

Does your projectile has sprites?
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Projectile will not fire

Post by Player701 »

Note that A_FireCustomMissile is deprecated, and you should use A_FireProjectile instead.
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Re: Projectile will not fire

Post by TIIKKETMASTER »

ramon.dexter wrote: Mon Nov 27, 2023 3:58 am Sorry, my crystalball is not working right now. Can you post the weapon's code, at least?

Does your projectile has sprites?
yeah i got sprites for my stuff. like i said i can summon it through the console and it works just fine but it does not want to be summoned through a weapon :( :(

the reason why the weapon is a fist is cuz i needed something to copy off of. curious if that is why its breaking.

Code: Select all

ACTOR Fist : DoomWeapon
{
  Weapon.SelectionOrder 3700
  Weapon.Kickback 100
  Obituary "died"
  Tag "testweapon"
  States
  {
  Ready:
    PUNG A 1 A_WeaponReady
    Loop
  Deselect:
    PUNG A 1 A_Lower
    Loop
  Select:
    PUNG A 1 A_Raise
    Loop
  Fire:
    PUNG B 4
    PUNG C 4 A_FireCustomMissile("playproj",0,0,0,32,0)
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    Goto Ready
  }
}

Code: Select all

ACTOR playproj
{
  Radius 6
  Height 8
  Speed 25
  Damage 3
  Projectile
  +RANDOMIZE
  RenderStyle Add
  Alpha 1
  States
  {
  Spawn:
    EBAL A 4 Bright
    Loop
  Death:
    EBAL A 6 Bright
    Stop
  }
}
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Projectile will not fire

Post by Player701 »

Your weapon is named Fist, but this name is already in use by GZDoom. This is technically an error, but due to backwards-compatibility reasons GZDoom will rename your actor to something else to avoid name collisions. You should see a warning message during startup, something like the following:

Code: Select all

Script warning, "decorate.txt:decorate.txt" line 1:
Tried to define class 'Fist' more than once. Renaming class to 'Fist@decorate.txt@decorate.txt'
So what is happening here? Whenever you try to use your weapon, you're actually using the built-in Fist instead - which of course is not coded to fire any projectiles.

You should rename Fist to something else (e.g. MyFist) and re-test. And please do pay attention to warning messages produced by the engine.
User avatar
TIIKKETMASTER
Posts: 32
Joined: Thu Jul 29, 2021 2:02 pm

Re: Projectile will not fire

Post by TIIKKETMASTER »

Player701 wrote: Wed Nov 29, 2023 11:56 pm Your weapon is named Fist, but this name is already in use by GZDoom. This is technically an error, but due to backwards-compatibility reasons GZDoom will rename your actor to something else to avoid name collisions. You should see a warning message during startup, something like the following:

Code: Select all

Script warning, "decorate.txt:decorate.txt" line 1:
Tried to define class 'Fist' more than once. Renaming class to 'Fist@decorate.txt@decorate.txt'
So what is happening here? Whenever you try to use your weapon, you're actually using the built-in Fist instead - which of course is not coded to fire any projectiles.

You should rename Fist to something else (e.g. MyFist) and re-test. And please do pay attention to warning messages produced by the engine.
oh my god, you're right. i was so caught up in believing that all the doom-related stuff wouldn't be there anymore but i guess not. thank you! :D
Post Reply

Return to “Scripting”