[DECORATE] I'm having trouble with custom shotguns.

Discuss all aspects related to modding Zandronum here.
User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] I'm having trouble with custom shotguns.

#1

Post by SuperPCGamer » Wed Jan 16, 2019 8:55 am

Me: *works on All-Out War mod*

Me: *creates keyconf saying this:*

clearplayerclasses
addplayerclass USMarine nomenu



Me: *creates DECORATE saying this:*

//===========================================================================
//
// Player
//
//===========================================================================
ACTOR USMarine : PlayerPawn
{
Speed 1
Health 100
Radius 16
Height 56
Mass 100
PainChance 255
+THRUSPECIES
+MTHRUSPECIES
Player.DisplayName "James"
Player.StartItem "AngledPistol"
Player.StartItem "Machete"
Player.StartItem "Clip", 50
Player.WeaponSlot 1, Machete, Chainsaw
Player.WeaponSlot 2, AngledPistol
Player.WeaponSlot 3, DukeShotgun, Coachgun
Player.WeaponSlot 4, HMachineGun
Player.WeaponSlot 5, MP40
Player.WeaponSlot 6, MP60
Player.WeaponSlot 7, QuadShotgun
}



The DukeShotgun won't replace the regular shotgun in my maps.



DukeShotgun DECORATE:

actor DukeShotgun : DoomWeapon replaces Shotgun
{
Weapon.SelectionOrder 1300
Weapon.AmmoUse 1
Weapon.AmmoGive 8
Weapon.AmmoType "Shell"
Inventory.PickupMessage "You got the shotgun! Time to fuck up those Plutonians!"
Obituary "%o was murdered by %k's shotgun, yikes."
Attacksound "DukeShotgun/Fire"
Decal "BulletChip"
States
{
Ready:
DNSG A 1 A_WeaponReady
Loop
Deselect:
DNSG A 1 A_Lower
Loop
Select:
DNSG A 1 A_Raise
Loop
Fire:
DNSG A 3
DNSG B 1 A_FireBullets (6, 4, 7, 5, "BulletPuff")
DNSG B 0 radius_quake(2, 2, 0, 1, 0)
DNSG B 0 A_GunFlash
DNSG CDEDCB 1 bright
DNSG A 3
DNSG FGH 1
DNSG I 2 A_PlaySound ("DukeShotgun/Pump")
DNSG JKLKJI 2
DNSG HGF 1
DNSG A 7 A_ReFire
Goto Ready
Flash:
TNT1 A 4 Bright A_Light1
TNT1 A 3 Bright A_Light2
Goto LightDone
Spawn:
DNSP A -1
Stop
}
}


Somebody, please help me
:igor:

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

[DECORATE] Re: I'm having trouble with custom shotguns.

#2

Post by Empyre » Wed Jan 16, 2019 5:05 pm

The code looks fine to me, but some indentation would make it easier to read. Is there nothing there instead of a shotgun, or is the original Doom shotgun there instead of the Duke shotgun? Are all of the sprites for the Duke shotgun present in the correct namespace and named the same as in the DECORATE?

Is radius_quake was available to be used in DECORATE, and not just ACS? It must be, or the game would fail to load, throwing an error message about radius_quake being not recognized.

Also, Speed 1? PainChance 255? Both are strange decisions that will make the game unfun.
"For the world is hollow, and I have touched the sky."

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#3

Post by madcat » Wed Jan 16, 2019 7:07 pm

The DukeShotgun replaces Shotgun indeed - so the problem must be elsewhere.
I can think of three possible things that cause the normal shotgun appear:

1 - There is another weapon defined, a weapon that also replaces shotgun - and looks/behaves like a shotgun - and this weapon overrides your DukeShotgun ( possibly by being later than the DukeShotgun )

2 - The Shotgun on Doom maps is replaced by some other weapon ( replaced by changing the maps, not the shotgun itself )

3 - the DukeShotgun coding is not loaded at all ( this can be if the DECORATE lump is placed between SS_START and SS_END markers or if the lump that contains the coding is not named DECORATE at all ).

To check whether is the DukeShotgun coding loaded, type "summon DukeShotgun" in the console. If it is not being loaded, the DukeShotgun wont appear.

User avatar
-Jes-
Frequent Poster Miles card holder
Posts: 975
Joined: Fri Aug 03, 2012 9:55 am
Location: Void Zone

[DECORATE] Re: I'm having trouble with custom shotguns.

#4

Post by -Jes- » Thu Jan 17, 2019 3:33 pm

Empyre wrote:
Wed Jan 16, 2019 5:05 pm
Also, Speed 1? PainChance 255? Both are strange decisions that will make the game unfun.
Those are the defaults for both playerpawn and doomplayer.

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

[DECORATE] Re: I'm having trouble with custom shotguns.

#5

Post by Empyre » Thu Jan 17, 2019 5:09 pm

-Jes- wrote:
Thu Jan 17, 2019 3:33 pm
Empyre wrote:
Wed Jan 16, 2019 5:05 pm
Also, Speed 1? PainChance 255? Both are strange decisions that will make the game unfun.
Those are the defaults for both playerpawn and doomplayer.
Oh really? Thanks! I like learning new things.
"For the world is hollow, and I have touched the sky."

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#6

Post by SuperPCGamer » Mon Jan 28, 2019 3:16 am

madcat wrote:
Wed Jan 16, 2019 7:07 pm
The DukeShotgun replaces Shotgun indeed - so the problem must be elsewhere.
I can think of three possible things that cause the normal shotgun appear:

1 - There is another weapon defined, a weapon that also replaces shotgun - and looks/behaves like a shotgun - and this weapon overrides your DukeShotgun ( possibly by being later than the DukeShotgun )

2 - The Shotgun on Doom maps is replaced by some other weapon ( replaced by changing the maps, not the shotgun itself )

3 - the DukeShotgun coding is not loaded at all ( this can be if the DECORATE lump is placed between SS_START and SS_END markers or if the lump that contains the coding is not named DECORATE at all ).

To check whether is the DukeShotgun coding loaded, type "summon DukeShotgun" in the console. If it is not being loaded, the DukeShotgun wont appear.
For number one:
No. I didn't do that.
For number two:
I didn't do anything to the shotgun in the maps alone, they're just vanilla maps with a few extra wall/floor/ceiling/door/sky textures.
For number three:
It's called DECORATE. It's not directly placed between SS_START and SS_END.
I checked by using the IDKFA code, and the vanilla shotgun wasn't coming up, the DukeShotgun was, but in the maps, where the shotgun was, it still displays the vanilla shotgun, and if I play without IDKFA code it gives me vanilla shotgun.
:igor:

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

[DECORATE] Re: I'm having trouble with custom shotguns.

#7

Post by Empyre » Mon Jan 28, 2019 6:04 am

I just noticed that your DukeShotgun is missing this:
Weapon.SlotNumber 3
That might not fix it not appearing, but that should be in the code anyway.
"For the world is hollow, and I have touched the sky."

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#8

Post by madcat » Mon Jan 28, 2019 7:49 am

Empyre wrote:
Mon Jan 28, 2019 6:04 am
I just noticed that your DukeShotgun is missing this:
Weapon.SlotNumber 3
That might not fix it not appearing, but that should be in the code anyway.
It does not need to be there. "Player.WeaponSlot 3, DukeShotgun," is enough to make the DukeShotgun selectable by the player.

Do the other special weapons have similar problems or is it only the DukeShotgun?

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#9

Post by SuperPCGamer » Sat Feb 02, 2019 8:14 am

madcat wrote:
Mon Jan 28, 2019 7:49 am
Do the other special weapons have similar problems or is it only the DukeShotgun?
so glad you asked
The MP60 is able to be picked up, but once you select a different weapon you can't select it again even if you still have ammo for it.

The same exact thing that's happening with the DukeShotgun is happening with the HMachinegun

The machete is just GONE

Other than that my weapons work.

DECORATES FOR OTHER BROKEN WEAPONS:

M60 DECORATE:


Actor M60 : weapon replaces PlasmaRifle
{
Decal BulletChip
Weapon.SelectionOrder 500
inventory.pickupsound "misc/w_pkup"
Inventory.PickupMessage "You found an M60. This does not belong to you. You do not belong here in the US."
Obituary "%o was sexually assaulted by %k's MP60 that he doesn't own."
Weapon.AmmoType "clip"
Weapon.AmmoGive 10
Weapon.AmmoUse 1
Weapon.Kickback 100
attacksound "MG60FR"
scale 0.5
States
{
Spawn:
MC60 A 1
Loop
Select:
MG60 A 1 A_RAISE
NULL AA 0 A_RAISE
Loop
Deselect:
MG60 A 1 A_Lower
NULL AA 0 A_Lower
loop
Ready:
MG60 A 1 A_WeaponReady
loop
Fire:
NULL A 0 A_Jump(150,"fire1")
NULL A 0 A_Jump(150,"fire2")
NULL A 0 A_Jump(150,"fire3")
NULL A 0 A_Jump(150,"fire4")
NULL A 0 A_Jump(150,"fire5")
loop
Fire1:
NULL A 0 A_GunFlash
RICO AB 1 bright
NULL A 4
goto ready
Fire2:
NULL A 0 A_GunFlash
RICO CD 1 bright
NULL A 4
goto ready
Fire3:
NULL A 0 A_GunFlash
RICO EF 1 bright
NULL A 4
goto ready
Fire4:
NULL A 0 A_GunFlash
RICO GH 1 bright
NULL A 4
goto ready
Fire5:
NULL A 0 A_GunFlash
RICO IJ 1 bright
NULL A 4
goto ready
Flash:
MG60 B 2 BRIGHT A_FireBullets(1,1,1,10,"BulletPuff",1)
MG60 CD 1
//NULL A 0 A_PlaySound("M60RL")
MG60 EF 1
stop
}
}


MACHETE DECORATE:

actor Machete : Weapon replaces Fist
{
Weapon.SelectionOrder 3800
Weapon.Kickback 100
+WEAPON.WIMPY_WEAPON
+WEAPON.MELEEWEAPON
+NOEXTREMEDEATH
Obituary "%o was cut up by %k's machete."
States
{
Spawn:
MHTE A -1
loop
Ready:
MHTG G 1 A_WeaponReady
loop
Deselect:
MHTG G 1 A_Lower
loop
Select:
MHTG G 1 A_Raise
loop
Fire:
TNT1 A 0 A_Jump(128,"Fire4")
TNT1 A 0 A_Jump(128,"Fire3")
TNT1 A 0 A_Jump(128,"Fire2")
MHTG A 2 A_PlayWeaponSound("MacheteSwing")
MHTG B 2
MHTG C 4 A_CustomPunch (30,0,0,"MachetePuff")
MHTG D 2
MHTG E 2
MHTG F 2
MHTG G 2
MHTG H 2
MHTG I 2
goto Ready
Fire2:
MHT2 A 2 A_PlayWeaponSound("MacheteSwing")
MHT2 B 2
MHT2 C 4 A_CustomPunch (20,0,0,"MachetePuff")
MHT2 D 2
MHT2 E 2
MHT2 F 2
MHT2 G 2
MHT2 H 2
goto Ready
Fire3:
MHT3 A 2 A_PlayWeaponSound("MacheteSwing")
MHT3 B 2
MHT3 C 4 A_CustomPunch (10,0,0,"MachetePuff")
MHT3 D 2
MHT3 E 2
MHT3 F 2
MHT3 G 2
TNT1 A 0 A_ReFire
goto Ready
Fire4:
MHT4 A 2 A_PlayWeaponSound("MacheteSwing")
MHT4 B 2
MHT4 C 4 A_CustomPunch (10,0,0,"MachetePuff")
MHT4 D 2
MHT4 E 2
MHT4 F 2
MHT4 G 2
TNT1 A 0 A_ReFire
goto Ready
}
}

ACTOR MachetePuff
{
+NOBLOCKMAP
+NOGRAVITY
+NOEXTREMEDEATH
+PUFFONACTORS
RenderStyle Translucent
Alpha 0.6
SeeSound "MacheteHitThing"
AttackSound "MacheteHitWall"
ActiveSound "MacheteSwing"
VSpeed 1
States
{
Spawn:
PUFF ABCD 4
Stop
}
}


HMACHINEGUN DECORATE:

ACTOR HMachinegun : Weapon replaces Chaingun 602
{
//$Category Weapons
//$Sprite HVMGW0
//$Title "Heavy Machinegun"
Weapon.Kickback 5
Weapon.AmmoType "Clip"
Weapon.AmmoGive 75
Weapon.AmmoUse 1
Weapon.SlotNumber 4
Inventory.PickupSound "misc/w_pkup"
Inventory.PickupMessage "Time to MOW 'EM DOWN, MOTHERFUCKER!"
Obituary "%o was torn a new ass by %k and his machine gun."
AttackSound "weapons/Machinegun"
Decal BulletChip
States
{
Ready:
HVMG A 1 A_WeaponReady
Loop
Deselect:
HVMG A 1 A_Lower
Loop
Select:
HVMG A 1 A_Raise
Loop
Fire:
HVMG B 0 A_GunFlash
HVMG B 1
HVMG C 1 A_FireBullets(5, 3, 1, 8, "BulletPuff", 1)
HVMG A 1
TNT1 A 0 A_refire
goto Ready
Flash:
HVMG B 1 Bright A_Light1
HVMG C 1 Bright A_Light0
Goto LightDone
Hold:
HVMG B 0 A_GunFlash
HVMG B 1
HVMG C 1 A_FireBullets(5, 3, 1, 13, "BulletPuff", 1)
HVMG A 1
goto Ready
Spawn:
HVMG W -1
Stop
}
}
:igor:

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#10

Post by madcat » Sat Feb 02, 2019 10:45 am

so many different problems...if you send me the wadfile I would try to fix them.

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#11

Post by SuperPCGamer » Mon Feb 04, 2019 6:14 am

madcat wrote:
Sat Feb 02, 2019 10:45 am
so many different problems...if you send me the wadfile I would try to fix them.
Really? You'd do that? Thank you sooo much! :) How kind of you.

https://drive.google.com/open?id=1IO9qQ ... SnDZv7txgu
:igor:

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#12

Post by madcat » Mon Feb 04, 2019 9:16 am

SuperPCGamer wrote:
Mon Feb 04, 2019 6:14 am
madcat wrote:
Sat Feb 02, 2019 10:45 am
so many different problems...if you send me the wadfile I would try to fix them.
Really? You'd do that? Thank you sooo much! :) How kind of you.

https://drive.google.com/open?id=1IO9qQ ... SnDZv7txgu
I believe I have managed to fix all the problems - https://www.dropbox.com/s/lxqhn01i2cbbl ... .wad?raw=1

Is it good now? ( The problems were caused by three different errors so I might have overlooked something )

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#13

Post by SuperPCGamer » Mon Feb 04, 2019 11:32 pm

madcat wrote:
Mon Feb 04, 2019 9:16 am
SuperPCGamer wrote:
Mon Feb 04, 2019 6:14 am
madcat wrote:
Sat Feb 02, 2019 10:45 am
so many different problems...if you send me the wadfile I would try to fix them.
Really? You'd do that? Thank you sooo much! :) How kind of you.

https://drive.google.com/open?id=1IO9qQ ... SnDZv7txgu
I believe I have managed to fix all the problems - https://www.dropbox.com/s/lxqhn01i2cbbl ... .wad?raw=1

Is it good now? ( The problems were caused by three different errors so I might have overlooked something )

There is one problem I forgot to mention since it's not about special guns. The player sprites (Doomguy sprites, not weapon sprites) won't show. I tested this by turning on CHASECAM and it was just I N V I S I B L E. Also I have DEATH CAMERA on.


other than that it's all fixed :) thanks :igor:
:igor:

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#14

Post by madcat » Tue Feb 05, 2019 7:25 am

Okay, the player is not invisible anymore - https://www.dropbox.com/s/wlgasjalb2zy2 ... .rar?raw=1

All these errors were caused by the following:

1 - On the very bottom of the entry list, there was a DECORATE lump with a different player class ( which caused no troubles at all ) and weapons that replace the vanilla doom weapons ( which caused troubles ) - this was enough to override the DukeShotgun, replacing it with DDShotgun ( So first the "Shotgun" got replaced with "DukeShotgun" and then the "DukeShotgun" got replaced with "DDShotgun" )

I have fixed that problem by removing the whole DECORATE lump because I thought it was left there by mistake.

2 - In the USMarine weapon slots, I could see "Player.WeaponSlot 6, MP60" - However, the name of the heavy machinegun is "M60" - so it didnt load the M60 at all.

I have fixed that problem by changing the string to "Player.WeaponSlot 6, MP0".

3 - In the M60 machinegun, there was "Decal BulletChip" written in the ACTOR properties. This was enough to remove the weapon from the player's weapon list.

I have fixed that by removing that string.

4 - The USMarine did not have any actor states defined at all. No "spawn" state, no "see" , "missile" , "melee" , "death" , "xdeath" states either.
So the player was invisible ( had no sprites to load ).

I have fixed that by copy/pasting the original DoomPlayer states.


I hope I have not overlooked anything else.

If you ever have any other modding-related problem, feel free to ask me for help.

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

[DECORATE] Re: I'm having trouble with custom shotguns.

#15

Post by Empyre » Tue Feb 05, 2019 3:10 pm

If the USMarine class inherited from DoomPlayer, wouldn't it inherit it's parent actor's states? If it doesn't inherit from DoomPlayer, why not? It has to inherit from PlayerPawn or from an actor (like DoomPlayer) that inherits from PlayerPawn, or it won't work as a player class.

https://zdoom.org/wiki/Classes:PlayerPawn
"For the world is hollow, and I have touched the sky."

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#16

Post by madcat » Tue Feb 05, 2019 3:50 pm

Empyre wrote:
Tue Feb 05, 2019 3:10 pm
If the USMarine class inherited from DoomPlayer, wouldn't it inherit it's parent actor's states? If it doesn't inherit from DoomPlayer, why not? It has to inherit from PlayerPawn or from an actor (like DoomPlayer) that inherits from PlayerPawn, or it won't work as a player class.

https://zdoom.org/wiki/Classes:PlayerPawn
That's the problem - originally it was like this "USMarine : PlayerPawn" - inheriting the PlayerPawn, not the DoomPlayer

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#17

Post by SuperPCGamer » Wed Feb 06, 2019 3:48 am

madcat wrote:
Tue Feb 05, 2019 7:25 am
Okay, the player is not invisible anymore - https://www.dropbox.com/s/wlgasjalb2zy2 ... .rar?raw=1

All these errors were caused by the following:

1 - On the very bottom of the entry list, there was a DECORATE lump with a different player class ( which caused no troubles at all ) and weapons that replace the vanilla doom weapons ( which caused troubles ) - this was enough to override the DukeShotgun, replacing it with DDShotgun ( So first the "Shotgun" got replaced with "DukeShotgun" and then the "DukeShotgun" got replaced with "DDShotgun" )

I have fixed that problem by removing the whole DECORATE lump because I thought it was left there by mistake.

2 - In the USMarine weapon slots, I could see "Player.WeaponSlot 6, MP60" - However, the name of the heavy machinegun is "M60" - so it didnt load the M60 at all.

I have fixed that problem by changing the string to "Player.WeaponSlot 6, MP0".

3 - In the M60 machinegun, there was "Decal BulletChip" written in the ACTOR properties. This was enough to remove the weapon from the player's weapon list.

I have fixed that by removing that string.

4 - The USMarine did not have any actor states defined at all. No "spawn" state, no "see" , "missile" , "melee" , "death" , "xdeath" states either.
So the player was invisible ( had no sprites to load ).

I have fixed that by copy/pasting the original DoomPlayer states.


I hope I have not overlooked anything else.

If you ever have any other modding-related problem, feel free to ask me for help.
Thanks so much. I cannot thank you enough for this. What may I do to repay you? (idk what I can do so I asked you what I can do)
:igor:

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#18

Post by madcat » Wed Feb 06, 2019 9:03 am

There is only one thing you could do - whenever you find out about anyone else who has troubles with his/her own modding, you can tell them about me - that my door is always open.

User avatar
SuperPCGamer
 
Posts: 23
Joined: Thu Jan 10, 2019 9:39 am

[DECORATE] Re: I'm having trouble with custom shotguns.

#19

Post by SuperPCGamer » Sat Feb 09, 2019 3:25 am

madcat wrote:
Wed Feb 06, 2019 9:03 am
There is only one thing you could do - whenever you find out about anyone else who has troubles with his/her own modding, you can tell them about me - that my door is always open.
Now that I think about it........I've got an older WAD with problems. Can we discuss it via PMs? It's called Robo-DooM and All-out waR was a prequel.
:igor:

User avatar
madcat
Forum Regular
Posts: 359
Joined: Mon Jul 08, 2013 7:16 pm
Location: Czech republic
Clan Tag: [Sun]

[DECORATE] Re: I'm having trouble with custom shotguns.

#20

Post by madcat » Sat Feb 09, 2019 7:24 am

sure :)

Post Reply