[Solved]Parentclass Unrecognized?

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.

[Solved]Parentclass Unrecognized?

Postby r3v3n93 » Tue Apr 06, 2021 7:58 am

I'm made an actor which is similar to DoomWeapon, but it doesn't work. Whenever I apply this to my weapons, it spits "'@property@weapon.ammogive' is an unknown actor property" instantly. In general, it may happen when you didn't applied Classes:Weapon Parentclass to your weapon, but it happens to me even I already added it on the actor!

Code: Select allExpand view
ACTOR PDYWeapon : Weapon
{
    Weapon.BobRangeX 0.2
   Weapon.BobRangeY 0.2
   Weapon.BobSpeed 2
}


Code: Select allExpand view
Actor Car4 : PDYWeapon
{
        Weapon.AmmoGive 30
   Weapon.AmmoType1 "Car4Bul"
   Weapon.AmmoType2 "Car4Mag"
   Weapon.AmmoUse1 1
   Weapon.AmmoUse2 1
   Weapon.SlotNumber 1
   Tag "PDY_CAR4"
   Inventory.PickupMessage "You got CAR-4"
   Obituary "%k killed you with CAR-4"
   +NOALERT
   +WEAPON.NOAUTOAIM
   +WEAPON.AMMO_OPTIONAL
   +WEAPON.ALT_AMMO_OPTIONAL
   +WEAPON.PRIMARY_USES_BOTH //Shortened for your eyes


Any solutions?
Last edited by r3v3n93 on Tue Apr 06, 2021 8:33 am, edited 1 time in total.
r3v3n93
 
Joined: 09 Jun 2020
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: Parentclass Unrecognized?

Postby Jarewill » Tue Apr 06, 2021 8:10 am

Seems to work fine for me.
Are the base class and weapon in separate DECORATE files?
If so, make sure the base class is loaded first.
If they are in the same file, make sure the base class is defined before the weapon.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Parentclass Unrecognized?

Postby r3v3n93 » Tue Apr 06, 2021 8:24 am

Jarewill wrote:Seems to work fine for me.
Are the base class and weapon in separate DECORATE files?
If so, make sure the base class is loaded first.
If they are in the same file, make sure the base class is defined before the weapon.


Worked! Thanks.
r3v3n93
 
Joined: 09 Jun 2020
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: bjork and 1 guest