Summon custom weapons

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!)
User avatar
superscrungus
Posts: 10
Joined: Thu Sep 27, 2018 9:30 pm

Summon custom weapons

Post by superscrungus »

Hiya, little problem with a custom weapon. Doesn't cause any errors, but it won't spawn in when using the "summon" command, and won't appear with the "give" command. Of note is that it's not part of the existing Doom 2 arsenal, and is a test weapon intended to share the 6th slot with the Plasma Rifle. Just an Unmaker that fires Super Shotgun blasts. Not a problem in and of itself, but if this issue persists to non-test weapons this will quickly get irritating.

Here's the code (no doubt amateurish and probably full of messy mistakes i missed).

Code: Select all

// --------------------------------------------------------------------------
//
// Unmaker
//
// --------------------------------------------------------------------------

actor Unmaker : Weapon 0666
{
	AttackSound "weapons/unmaker"
	Weapon.SelectionOrder 450
	Weapon.SlotNumber 6
	Weapon.SlotPriority 1
	Weapon.AmmoUse 40
	Weapon.AmmoGive 40
	Weapon.AmmoType "Cell"
	Inventory.PickupMessage "$GOTUNMAKER"
	Obituary "$OB_UNMAKERMP"
	Tag "$TAG_UNMAKER"
	States
	{
	Ready:
		UNMA A 1 A_WeaponReady
		Loop
	Deselect:
		UNMA A 1 A_Lower
		Loop
	Select:
		UNMA A 1 A_Raise
		Loop
	Fire:
		UNMA A 0 A_GunFlash
		UNMA A 4 A_FireShotgun2	
		UNMA A 0 A_ReFire
		Goto Ready
	Flash:
		UNMA B 2
		Goto LightDone
	Spawn:
		LGUN A -1
		Stop
	}
}
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed

Re: Summon custom weapons

Post by wildweasel »

Is the sprite UNMAA0 present in your file?
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell

Re: Summon custom weapons

Post by Tartlman »

Are you sure you placed markers in your wad?
You need to place a marker called S_START at the beginning of your sprite list and one called S_END at the ending. Marker should be the default data type when you make a new entry in SLADE3. Here's what it should look like:

DECORATE.txt
S_START
your sprites go here
S_END

If you don't do this, then doom will not know what the sprites it has to load are.
I hope this helps.
User avatar
TheMightyHeracross
Posts: 2100
Joined: Sun Aug 18, 2013 9:41 am
Location: Philadelphia, PA

Re: Summon custom weapons

Post by TheMightyHeracross »

Alternatively, if you are using a .pk3 file, sprites should be in the "Sprites" folder.
User avatar
superscrungus
Posts: 10
Joined: Thu Sep 27, 2018 9:30 pm

Re: Summon custom weapons

Post by superscrungus »

Tartlman wrote:Are you sure you placed markers in your wad?
You need to place a marker called S_START at the beginning of your sprite list and one called S_END at the ending. Marker should be the default data type when you make a new entry in SLADE3. Here's what it should look like:

DECORATE.txt
S_START
your sprites go here
S_END

If you don't do this, then doom will not know what the sprites it has to load are.
I hope this helps.
That was exactly what I needed! Thought it would've been a much bigger mess to fix lol. Thanks a bunch!

Return to “Scripting”