Making a Plasma Gun (Mucking with Decorate)
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- TootsyBowl
- Posts: 78
- Joined: Wed Jun 21, 2017 12:03 am
- Location: Somewhere far off in the East
Making a Plasma Gun (Mucking with Decorate)
So I'm trying to make a custom plasma gun that is basically a carbon copy of the vanilla gun, but with no cooldown after firing, doubled damage, and a slower fire rate. My experience with Decorate is only changing the stats of existing actors so I kind of need help.
Also how can I make a truck in GzDoom builder?
Also how can I make a truck in GzDoom builder?
- Jekyll Grim Payne
- Global Moderator
- Posts: 1118
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Making a Plasma Gun (Mucking with Decorate)
Look at the code of default [wiki=Classes:PlasmaRifle]Plasma Rifle[/wiki]. There's a line with [wiki]A_ReFire[/wiki] function. When you stop shooting, it shows the sprite that this function is attached to; in this case it's PLSG B, which is the "cooldown" sprite. (As long as you keep pressing the fire button, this sprite is skipped.) If you change its length from 20 (default) to 0, the cooldown will be instant.
To do that you need to learn how to [wiki=Using_inheritance]use inheritance[/wiki]. It's very straightforward.
And changing damage requires making a custom [wiki]PlasmaBall[/wiki] and replacing the default one, inheriting everything but changing the damage. I guess you know understand how from the above example 
Now, as for making a truck, that's a completely different thing. Depends on what you want to make. A static object that looks like a truck? That could be some sectors and textures or a 3D model. Something that can actually move around? Again, depends on the complexity of driving; could be a DECORATE actor and a 3D model. Something you could drive yourself? That would be a wholly different and a much more complicated story...
To do that you need to learn how to [wiki=Using_inheritance]use inheritance[/wiki]. It's very straightforward.
Code: Select all
ACTOR FastPlasmaRifle : PlasmaRifle replaces PlasmaRifle //this inherits from default plasmarifle and also replaces it in the game
{
Weapon.SlotNumber 6 //without this you won't be able to select your custom plasmarifle because default plasmarifle will be bound to slot 6
states
{
Fire: //you only include the state you want to change, everything else is inherited
PLSG A 3 A_FirePlasma //changing the length of this frame will change the firerate
TNT1 A 0 A_ReFire //TNT1 means empty sprite; since its length is 0, it doesn't matter which sprite is used
Goto Ready
}
}

Code: Select all
Actor StrongPlasmaBall : PlasmaBall replaces PlasmaBall
{
damage 10
}
Now, as for making a truck, that's a completely different thing. Depends on what you want to make. A static object that looks like a truck? That could be some sectors and textures or a 3D model. Something that can actually move around? Again, depends on the complexity of driving; could be a DECORATE actor and a 3D model. Something you could drive yourself? That would be a wholly different and a much more complicated story...
Re: Making a Plasma Gun (Mucking with Decorate)
Since Jekyll already gave an answer, I must ask:
A truck? What's that supposed to mean?
A truck? What's that supposed to mean?
- TootsyBowl
- Posts: 78
- Joined: Wed Jun 21, 2017 12:03 am
- Location: Somewhere far off in the East
Re: Making a Plasma Gun (Mucking with Decorate)
Just a little sector-based truck. Also the WAD I'm making keeps spitting out something about errors in line 3 of Decorate.
Edit: The exact problem.

Edit: The exact problem.

- Jekyll Grim Payne
- Global Moderator
- Posts: 1118
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Making a Plasma Gun (Mucking with Decorate)
I don't know what to tell you about the truck; you just make a sector and cover its sides with truck textures. There were some simple examples in Evilution, iirc. Depends on what kind of truck you have in mind, of course.
That's a weird error, though, I haven't seen anything like it. What does the beginning of your DECORATE there looks like?
That's a weird error, though, I haven't seen anything like it. What does the beginning of your DECORATE there looks like?
Last edited by Jekyll Grim Payne on Wed Jul 19, 2017 4:23 am, edited 1 time in total.
Re: Making a Plasma Gun (Mucking with Decorate)
Whats line 3 of your decorate file? In fact, copy paste your whole decorate file here.
Last edited by Voros on Wed Jul 19, 2017 4:30 am, edited 1 time in total.
- TootsyBowl
- Posts: 78
- Joined: Wed Jun 21, 2017 12:03 am
- Location: Somewhere far off in the East
Re: Making a Plasma Gun (Mucking with Decorate)
Alright, the thing is that there are multiple Decorate files. I followed a tutorial by Chubzdoomer, and it resulted in files upon files stacked on top of each other. I have throughly checked that each actor has an editor number in the Decorate files. I'll try Voros' solution first though.
Re: Making a Plasma Gun (Mucking with Decorate)
If what you state in OP is all your trying to do, then only 1 DECORATE file is needed, and it would be an extremely simple one too.
Re: Making a Plasma Gun (Mucking with Decorate)
Even in a complex project you still only need 1 DECORATE lump. In my Doom 64 port I only have 1 lump for DECORATE and it has all the definitions in the one lump. I actually find it easier to manage if everything is in one place so I can go actor to actor without changing from lump to lump.
- TootsyBowl
- Posts: 78
- Joined: Wed Jun 21, 2017 12:03 am
- Location: Somewhere far off in the East
Re: Making a Plasma Gun (Mucking with Decorate)
The WAD has stuff I've downloaded from Realm 667. The error is in one of those files. I haven't actually gone around to making the plasma gun yet.
Edit: I would give screenshots but Imgur is being a pain in the ass, so I'll give them if you want them.
Edit 2: Okay, now that I've actually gone around to making the plasma gun, GzDoom complains of there being an unexpected { in line 4.
Edit 3: Alright, as for the Realm667 asset errors, I think it might be this one that's causing trouble...

Edit: I would give screenshots but Imgur is being a pain in the ass, so I'll give them if you want them.
Edit 2: Okay, now that I've actually gone around to making the plasma gun, GzDoom complains of there being an unexpected { in line 4.
Edit 3: Alright, as for the Realm667 asset errors, I think it might be this one that's causing trouble...

- Jekyll Grim Payne
- Global Moderator
- Posts: 1118
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Making a Plasma Gun (Mucking with Decorate)
If various DEOCRATE lumps are combined using #include, it's perfectly fine to use many of them if you want to.
Unless I'm missing something, those actor definitions are missing their first opening bracket, {. At least I can't see it here.
Unless I'm missing something, those actor definitions are missing their first opening bracket, {. At least I can't see it here.
Re: Making a Plasma Gun (Mucking with Decorate)
Ninja'd again.
You really should read the ZDoom wiki. It has all the answers to your questions.
You really should read the ZDoom wiki. It has all the answers to your questions.
- TootsyBowl
- Posts: 78
- Joined: Wed Jun 21, 2017 12:03 am
- Location: Somewhere far off in the East
Re: Making a Plasma Gun (Mucking with Decorate)
Code: Select all
Actor PlasmaGun : PlasmaRifle replaces PlasmaRifle
{
Weapon.SlotNumber 6
{
Ready:
PLGN A 0 A_WeaponReady
Loop
Deselect:
PLGN A 0 A_Lower
Loop
Select:
PLGN A 0 1 A_Raise
Loop
Fire:
PLGN C 3 A_FirePlasma
TNT1 A 0 A_ReFire
Goto Ready
Flash:
PLGN B 0 Bright A_Light1
Goto LightDone
PLGN B 0 Bright A_Light1
Goto LightDone
Spawn:
PLGP A -1
Stop
}
}
Actor StrongPlasmaBall : PlasmaBall replaces PlasmaBall
{
damage 10
}
Re: Making a Plasma Gun (Mucking with Decorate)
Add the word "States", then the bracket.
Code: Select all
Actor PlasmaGun : PlasmaRifle replaces PlasmaRifle
{
Weapon.SlotNumber 6
States
{
Ready:
PLGN A 0 A_WeaponReady
Loop
Deselect:
PLGN A 0 A_Lower
Loop
Select:
PLGN A 0 1 A_Raise
Loop
Fire:
PLGN C 3 A_FirePlasma
TNT1 A 0 A_ReFire
Goto Ready
Flash:
PLGN B 0 Bright A_Light1
PLGN B 0 Bright A_Light1
Spawn:
PLGP A -1
Stop
}
}
Actor StrongPlasmaBall : PlasmaBall replaces PlasmaBall
{
Damage 10
}
- Jekyll Grim Payne
- Global Moderator
- Posts: 1118
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Making a Plasma Gun (Mucking with Decorate)
IMO you should really take generic questions to "How do I..." thread and mark this one as solved since the OP question is answered.