Page 1 of 1

Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 6:34 pm
by vAethor
Today I started making my first custom weapon, a rocket launcher replacement complete with original sprites (placeholders though, WAY too ugly to show here :P)

I have the following DECORATE code that currently just replaces the sprites with the new ones, and enables my own smoother, more varied animation:

Code: Select all

Actor GaussLauncher : RocketLauncher replaces RocketLauncher
{
   States
   {
      Ready:
      GAUS A 1 A_WeaponReady
      Loop
      
      Deselect:
      GAUS A 1 A_Lower
      Loop
      
      Select:
      GAUS A 1 A_Raise
      Loop
      
      Fire:
      GAUS B 4
      GAUS C 12 A_FireMissile
      GAUS B 8
      GAUS D 8
      GAUS A 4
      GAUS B 4
   }   
}


But when I run GZdoom and test it out by entering IDKFA and pressing the rocket launcher slot, absolutely nothing happens. It's as if both my original weapon and the vanilla rocket launcher have disappeared from existence.

I really need this fixed. Any help would be appreciated.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 6:47 pm
by Matt
Where are the sprites within the pk3?

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 6:48 pm
by vAethor
They're in the Sprites directory. I see no reason why this isn't working.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 7:03 pm
by Voros
Not sure why it's not appearing. In other news, add a

Code: Select all

Goto Ready
at the end of the Fire state.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 7:17 pm
by vAethor
Well I am officially frustrated. I don't know where to go next.

But what does Goto Ready do?

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 7:19 pm
by Voros
It goes to the Ready state eg I fire weapon (Fire state) and then it goes back to Ready state, ready to be fired again. If you hold down the fire button, it'll just loop the Fire state (by default).

Who knows? That one missing line might be the problem.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 7:30 pm
by vAethor
Voros wrote:It goes to the Ready state eg I fire weapon (Fire state) and then it goes back to Ready state, ready to be fired again. If you hold down the fire button, it'll just loop the Fire state (by default).

Who knows? That one missing line might be the problem.


I actually solved the problem. I needed to put Weapon.SlotNumber for Doom to recognize it. It's 5 in this case, since that is the one used by the rocket launcher.

And thanks for telling me about Ready.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 10:53 pm
by Voros
Seriously? Weapon.SlotNumber is already defined in RocketLauncher, so why was that needed? You're inheriting everything from RocketLauncher, including Weapon.SlotNumber.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 10:58 pm
by wildweasel
Voros wrote:Seriously? Weapon.SlotNumber is already defined in RocketLauncher, so why was that needed? You're inheriting everything from RocketLauncher, including Weapon.SlotNumber.

Weapon slots do not get inherited.

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 11:37 pm
by Voros
wildweasel wrote:
Voros wrote:Seriously? Weapon.SlotNumber is already defined in RocketLauncher, so why was that needed? You're inheriting everything from RocketLauncher, including Weapon.SlotNumber.

Weapon slots do not get inherited.

That's a shame. What else doesn't get inherited?

Re: Custom weapon not showing up at all

Posted: Thu Aug 31, 2017 11:44 pm
by Nevander
Voros wrote:That's a shame. What else doesn't get inherited?

Decals don't either. Like when you shoot a hitscan at a wall.