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

Modifying pistol to shoot projectiles in Freedoom / GZdoom / Slade

Question

Posted (edited)

Hello. I know this is a very basic question but I've read tutorials and haven't exactly found an answer.

 

So I made my own sprites to replace the pistol. But I also want it to shoot avoidable projectiles.

 

PROBLEM ONE: Which file do I edit? I'm basing my mod on Freedoom / GZdoom, so there is no DECORATE file. I found the pistol file gzdoom.pak3 in zscript/actors/doom/weaponpistol

 

I basically copied a part of code from plasmagun and pasted it to pistol. I replaced this part:

 

Quote

Spawn:
        PIST A -1;
        Stop;

 

with this:

 

Quote

 

Spawn:
        PLAS A -1;
        Stop;
    }
}

class PlasmaBall : Actor
{
    Default
    {
        Radius 13;
        Height 8;
        Speed 25;
        Damage 5;
        Projectile;
        +RANDOMIZE
        +ZDOOMTRANS
        RenderStyle "Add";
        Alpha 0.75;
        SeeSound "weapons/plasmaf";
        DeathSound "weapons/plasmax";
        Obituary "$OB_MPPLASMARIFLE";
    }
    States
    {
    Spawn:
        PLSS AB 6 Bright;
        Loop;
    Death:
        PLSE ABCDE 4 Bright;
        Stop;
    }
}

 


PROBLEM 2:
I swapped the gzdoom.pak for my altered one but nothing has changed.

 

What do I do wrong?

I know how to change attributes of the projectile, its look etc., but I have no idea how to make pistol shoot the plasma projectile. Please help a noob.

 

 

Share this post


Link to post

10 answers to this question

Recommended Posts

  • 2
Posted (edited)

Ok, that's normal situation for anybody who only starts work with modding. Let's try very simple text tutorial for you:

1) Create a w.i.p. folder for your mod (no matter how you'll name it, it's just for your convenience).

2) Inside your new folder create a .txt file named "Decorate" (Decorate.txt)

3) Open Decorate.txt

4) Add this inside:

ACTOR PlasmaPistol : Pistol 30000
{
 Weapon.AmmoType "Cell"
  States
  {
  Fire:
    PISG A 4
    PISG B 6 A_FireCustomMissile("PlasmaBall")
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
  }
}

Now a little explanation:

"Pistol 30000" means "I want to use original Pistol as base of my NewPistol. 30000 is a ID number of this item. You can define "any" number, but I'll advice to use 30000 and above to avoid errors related to other items. Especially when you're a noob ;)

 

Weapon.AmmoType "Cell" means "I want to use plasmagun/bfg9000 ammo instead of pistol clips"

 

Well...States means Weapon states. You wanted to change Firing option, so I've changed only "Fire state". Instead of A_FirePistol I've added "A_FireCustomMissile". PlasmaBall is EXISTING already inside the Doom videogame (the Plasma Rifle uses Plasmaballs).

 

5) You can use it already in game (but you need to summon this weapon in console).

I suppose you want to get this pistol without any console commands, you just want "Run NewGame and use pistol from the start", I guess?

 

Inside the Decorate.txt add this:

 

ACTOR NewPlayer : DoomPlayer replaces DoomPlayer
{
  Player.StartItem "PlasmaPistol"
  Player.StartItem "Fist"
  Player.StartItem "Cell", 50
  Player.WeaponSlot 1, Fist, Chainsaw
  Player.WeaponSlot 2, PlasmaPistol
  Player.WeaponSlot 3, Shotgun, SuperShotgun
  Player.WeaponSlot 4, Chaingun
  Player.WeaponSlot 5, RocketLauncher
  Player.WeaponSlot 6, PlasmaRifle
  Player.WeaponSlot 7, BFG9000
  Player.ColorRange 112, 127
  Player.ColorSet 0, "Green",         0x70, 0x7F,  0x72
  Player.ColorSet 1, "Gray",          0x60, 0x6F,  0x62 // Called "Indigo" originally so as to have a unique initial
  Player.ColorSet 2, "Brown",         0x40, 0x4F,  0x42
  Player.ColorSet 3, "Red",           0x20, 0x2F,  0x22
  // Doom Legacy additions
  Player.ColorSet 4, "Light Gray",    0x58, 0x67,  0x5A
  Player.ColorSet 5, "Light Brown",   0x38, 0x47,  0x3A
  Player.ColorSet 6, "Light Red",     0xB0, 0xBF,  0xB2
  Player.ColorSet 7, "Light Blue",    0xC0, 0xCF,  0xC2
}

I could be wrong about making this NewPlayer as "simple code" just because last time I've used New Player Classes...it was many years ago when people forced to use Keyconf lump...nevermind, don't think about this. Really, it doesn't matter for your situation.

 

Anyway, THIS code works, though. We're changed inventory of Doomguy. Instead of Pistol he will start game with PlasmaPistol. And he will start game with Cell ammo instead of Pistol ammo.

 

The Decorate modding is done, but you need to do few things.

6) Create a second .TXT file named "Mapinfo" (Mapinfo.txt)
7) Open Mapinfo.txt

8) Add this:

GameInfo
{
   PlayerClasses = "NewPlayer"
}

This code means "I want to use my custom inventory".

 

9) We're almost done! Just select both .txt files and PACK IT INTO .ZIP FILE.

10) Rename your .ZIP file into .PK3 file.

11) Have fun!

 

 

I'll upload a working mod you've asking, you can also check all files inside:

https://www.mediafire.com/file/my0y44w2zb45iqz/PP.pk3/file

Share this post


Link to post
  • 1

It must work in both ways.

 

Remember that 35 tics = 1 second

 

If you wanted to last it more than 1 second, you need to use greater values than 35.

Share this post


Link to post
  • 1
1 hour ago, Szuran said:

You've been a lot of help. Thanks. I'll try not to ask anymore.:)

No, feel free to ask as many questions as you need, but first, make an attempt to figure it out yourself.  It is more rewarding for you if you figure it out yourself.  use the ZDoom Wiki as a reference tool, and open (but don't edit) other people's wads to see how they did it.  I have learned a lot that way, and you can, too.

Share this post


Link to post
  • 0
Posted (edited)

Hello.

 

Looks like you didn't read the ZDoom wiki. You need to check all editing moments here right now.

 

You must understand first that you are NOT ALLOWED to modify any sourceport and IWAD files (like gzdoom.pk3, Doom.wad, TNT.wad, Freedoom.wad, etc).

 

You must create your own files from scratch. For example, you need to use Slade3. And you can only work with your own files.

 

The code you've provided will never work as you want. Read this first.

Edited by Đeⓧiaz

Share this post


Link to post
  • 0

Hey. Thanks! I read it, I just still didn't understand if I am supposed to edit the original file or create new.


Ok, create a new file. So, do I create a DECORATE file in my WAD? Or just a weaponname text archive? Do I place it in the WAD (if so, should it be between SS_START and end)? Or should I somehow export it to a pak3 file?

I am aware these are the basics of the basics, but for a total noob who never coded it's really difficult, and I haven't found answers to this.

Share this post


Link to post
  • 0

One more question, however. Can I make a frame of animation last longer? I thought that in "PISG A 4" 4 means the length it's showed, but I changed it to 35 and see no difference. I also tried to repead a frame in the code but it doesn't register two same frames in a row, I think

Share this post


Link to post
  • 0

You've been a lot of help. Thanks. I'll try not to ask anymore.:)

Share this post


Link to post
  • 0

I am trying, believe me, I've spent the last weekend with my nose in the editors and asked only the questions above.:) But since I've never had anything to do with coding, even what you may consider super easy in the wiki is sometimes hard to understand for me. Right now I'm trying to figure out why my muzzle flash doesn't show even though the code should be right. I'll figure it out.

 

However, I'm having trouble understanding why I don't have the 181 line for creating slopes available in Doom Builder. Is that because I choose Doom 2 format for my map and it doesn't support slopes? I've watched tutorials, searched forums, looked for a plugin, but everyone just has it in the linedef menu.

Share this post


Link to post
  • 0
7 hours ago, Szuran said:

However, I'm having trouble understanding why I don't have the 181 line for creating slopes available in Doom Builder. Is that because I choose Doom 2 format for my map and it doesn't support slopes? I've watched tutorials, searched forums, looked for a plugin, but everyone just has it in the linedef menu.

 

You need to use only "UDMF" format for doing such things. But anyway, that's offtopic, for more info you should create another thread, because this question is no more related to Plasma Pistol.

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
×