Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Gonubax

[ZDoom] (Decorate) Cannot spawn or equip custom weapon.

Recommended Posts

Hey guys,

it is my first time to make weapons, and i cannot equip or spawn the one i created (ShellChaingun). No bugs and when i type "Summon ShellChaingun" it does nothing. What am i doing wrong?

 

Here's the code of the Decorate :

ACTOR ShellChaingun: DoomWeapon 22222{
	Weapon.SelectionOrder 2500
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "Shell"
	Weapon.SlotNumber 3
	
	Inventory.PickupSound "weapon/getshellchaingun"
	Inventory.PickupMessage "You got the shell chaingun! Now you're in the big leagues!"
	Obituary "%o was slaughtered with a fucking shell chaingun."
	Tag "ShellChaingun"
	States {
		Spawn:
		SCGN A -1
		Stop
		
		Select:
		SCGG A 1 A_Raise
		Loop
		
		Deselect:
		SCGG A 1 A_Lower
		Loop
		
		Ready:
		SCGG A 0 A_WeaponReady
		Loop
		
		Fire:
		SCGG A 0 A_FireBullets (5.6, 0, 7, 5, "BulletPuff")
		SCGG A 0 A_PlaySound ("weapon/fireshellchaingun", CHAN_WEAPON)
		SCGG AB 4 
		SCGG B 1 A_ReFire
		Goto Ready
	}
}

 

Share this post


Link to post

You have a runaway loop in your ready state.  Make its duration 1 or more tics to fix that problem.

 

About it not appearing when you summon it, do you have its sprites in the correct name space (between SS_START and SS_END in a wad, or the Sprites folder in a pk3)?

 

You will also need to make a custom player class inheriting from DoomPlayer with that weapon in its list.

https://zdoom.org/wiki/Creating_new_player_classes

Share this post


Link to post

Is what you're saying should look like this ? Sorry if i look dumb: it is my very first time with modding, but i once started making a map for freedoom.

 

ACTOR LethalWeaponsDude: DoomPlayer {

	Player.DisplayName "Lethal weapons dude"
	Player.WeaponSlot 1, Fist, Chainsaw
	Player.WeaponSlot 2, Pistol
	Player.WeaponSlot 3, Shotgun, SuperShotgun, ShellChaingun
	Player.WeaponSlot 4, Chaingun
	Player.WeaponSlot 5, RocketLauncher
	Player.WeaponSlot 6, PlasmaRifle
	Player.WeaponSlot 7, BFG9000
}

ACTOR ShellChaingun: DoomWeapon 22222{
	Weapon.SelectionOrder 2500
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType "Shell"
	Weapon.SlotNumber 3
	
	Inventory.PickupSound "weapon/getshellchaingun"
	Inventory.PickupMessage "You got the shell chaingun! Now you're in the big leagues!"
	Obituary "%o was slaughtered with a fucking shell chaingun."
	Tag "ShellChaingun"
	States {
		Spawn:
		SCGN A -1
		Stop
		
		Select:
		SCGG A 1 A_Raise
		Loop
		
		Deselect:
		SCGG A 1 A_Lower
		Loop
		
		Ready:
		SCGG A 1 A_WeaponReady
		Loop
		
		Fire:
		SCGG A 0 A_FireBullets (5.6, 0, 7, 5, "BulletPuff")
		SCGG A 0 A_PlaySound ("weapon/fireshellchaingun", CHAN_WEAPON)
		SCGG AB 4 
		SCGG B 1 A_ReFire
		Goto Ready
	}
}

Edit : I tested that and it still doesn't work somehow

Edited by Gonubax : Didn't tested, but now i have

Share this post


Link to post

Did you make the Gaminfo section in Mapinfo, like it said to do on that page I linked?  If you don't, the player will be playing the regular DoomPlayer class, not your custom class.

 

Are your sprites in the right place (between SS_START and SS_END in a wad, or the Sprites folder in a pk3)?  If the sprites can't be found, the actor will either be invisible, or it won't work at all.

Share this post


Link to post

You could try "Give ShellChaingun" rather than "Summon ShellChaingun", as that will give it to you directly rather than having to spawn it first to see if you can pick it up.  At least that way you can start to narrow down what the issue is.

 

On 2/10/2019 at 1:38 PM, Empyre said:

You will also need to make a custom player class inheriting from DoomPlayer with that weapon in its list.

https://zdoom.org/wiki/Creating_new_player_classes

 

You do?  I've added a few new weapons and never knowingly done that.  Are you sure you need to?

Share this post


Link to post
19 hours ago, Bauul said:

You could try "Give ShellChaingun" rather than "Summon ShellChaingun", as that will give it to you directly rather than having to spawn it first to see if you can pick it up.  At least that way you can start to narrow down what the issue is.

 

 

You do?  I've added a few new weapons and never knowingly done that.  Are you sure you need to?

If you don't, the player could have trouble switching to and/or from the custom weapon.  I don't think it is necessary if you are simply replacing a weapon, only when adding a new one.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×