Making a Plasma Gun (Mucking with Decorate)

Archive of the old editing forum
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.
User avatar
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)

Post by TootsyBowl »

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?
User avatar
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)

Post by Jekyll Grim Payne »

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.

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
  }
}
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 :)

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...
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Voros »

Since Jekyll already gave an answer, I must ask:

A truck? What's that supposed to mean?
User avatar
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)

Post by TootsyBowl »

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.
Image
User avatar
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)

Post by Jekyll Grim Payne »

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?
Last edited by Jekyll Grim Payne on Wed Jul 19, 2017 4:23 am, edited 1 time in total.
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Voros »

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.
User avatar
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)

Post by TootsyBowl »

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.
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Voros »

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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Nevander »

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.
User avatar
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)

Post by TootsyBowl »

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...
Image
User avatar
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)

Post by Jekyll Grim Payne »

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.
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Voros »

Ninja'd again.

You really should read the ZDoom wiki. It has all the answers to your questions.
User avatar
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)

Post by TootsyBowl »

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
}
Okay, what am I doing wrong this time? It keeps complaining about the bracket in line 4. Is it misplaced or something?
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: Making a Plasma Gun (Mucking with Decorate)

Post by Voros »

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
}
User avatar
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)

Post by Jekyll Grim Payne »

IMO you should really take generic questions to "How do I..." thread and mark this one as solved since the OP question is answered.
Locked

Return to “Editing (Archive)”