Trouble Summoning Custom Weapons with commands.

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
SellDemApplez
Posts: 5
Joined: Sun Jun 01, 2025 2:41 pm
Preferred Pronouns: He/Him

Trouble Summoning Custom Weapons with commands.

Post by SellDemApplez »

Hello! As it says in the title, I cannot summon a custom weapon via a command. When I try to summon it, it throws the error "Unknown Actor or Visual Thinker". Is there something I am missing?

Apolocheese if this is a easy fix, I am relatively new to Gzdoom/Slade.
SellDemApplez
Posts: 5
Joined: Sun Jun 01, 2025 2:41 pm
Preferred Pronouns: He/Him

Re: Trouble Summoning Custom Weapons with commands.

Post by SellDemApplez »

class HolyShotgun : Weapon
{
Default
{
Weapon.SelectionOrder 400;
Weapon.AmmoUse 2;
Weapon.AmmoGive 20;
Weapon.AmmoType "Shell";
Inventory.PickupMessage "The Chosen Soldier wields their blade.";
Weapon.SlotNumber 1;
Obituary "$OB_MPSSHOTGUN";
Tag "ShieldShotgun";
}
States
{
Spawn:
Sgun A -1;
Stop;
Ready:
Sgun A 1 A_WeaponReady;
Loop;
Select:
Sgun A 1 A_Raise;
Loop;
Deselect:
Sgun A 1 A_Lower;
Loop;

}
}

By the way, here is the code for the weapon I am trying to summon in question.
User avatar
Enjay
 
 
Posts: 26995
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trouble Summoning Custom Weapons with commands.

Post by Enjay »

Despite the fact that you have posted your code, you're not giving us much to go on.

Anyway, the error message that you are getting indicates that GZDoom doesn't know about the actor that you are trying to summon. So, perhaps the first thing to do would be to open the console and scroll up to the bit that tells you which files have loaded and confirm that your file with the weapon code has loaded properly.
Post Reply

Return to “Scripting”