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

How to edit damage on decorate lump for pistol?

Recommended Posts

Its got to be in the decorate lump if i'm not mistaken.

 

Quote

ACTOR Pistol : DoomWeapon
{
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Clip"
  Obituary "$OB_MPPISTOL"
  +WEAPON.WIMPY_WEAPON
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED"
  Tag "$TAG_PISTOL"
  States
  {
  Ready:
    PISG A 1 A_WeaponReady
    Loop
  Deselect:
    PISG A 1 A_Lower
    Loop
  Select:
    PISG A 1 A_Raise
    Loop
  Fire:
    PISG A 4
    PISG B 6 A_FirePistol
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
  Flash:
    PISF A 7 Bright A_Light1
    Goto LightDone
    PISF A 7 Bright A_Light1
    Goto LightDone
  Spawn:
    PIST A -1
    Stop
  }
}

Please tell me where,specifically, i should edit and any further knowledge about how it works will be greatly appreciated.

Share this post


Link to post

See the line in the Fire sequence that has A_FirePistol after it? You need to replace that with your own custom A_FireBullets action, which lets you set custom damage, bullet puff type, etc.

 

Also, editing player weapons is a bit tricky. You're going to have to replace the weapon with a nearly identical copy, rather than just editing one line of it. You'll want to start your new Decorate actor with something like this:

Actor Pistol2 : Pistol replaces Pistol

 

In other words, your new actor is named Pistol2, it inherits all properties from the Pistol, and it replaces the Pistol in-game. Your Decorate code for this actor doesn't need to include all the code for the Pistol, because it inherits from it. The easiest thing to do is just add in the States, because that's what you're editing.

 

Then, in order for you to actually be able to use Pistol2, you need a new PlayerPawn (e.g., Actor DoomPlayer2 : DoomPlayer replaces DoomPlayer). This is easy; just copy in the code from Doom's PlayerPawn where it shows the weapons, and change "Pistol" to "Pistol2."

Edited by Not Jabba

Share this post


Link to post
43 minutes ago, Not Jabba said:

See the line in the Fire sequence that has A_FirePistol after it? You need to replace that with your own custom A_FireBullets action, which lets you set custom damage, bullet puff type, etc.

 

Also, editing player weapons is a bit tricky. You're going to have to replace the weapon with a nearly identical copy, rather than just editing one line of it. You'll want to start your new Decorate actor with something like this:

Actor Pistol2 : Pistol replaces Pistol

 

In other words, your new actor is named Pistol2, it inherits all properties from the Pistol, and it replaces the Pistol in-game. Your Decorate code for this actor doesn't need to include all the code for the Pistol, because it inherits from it. The easiest thing to do is just add in the States, because that's what you're editing.

 

Then, in order for you to actually be able to use Pistol2, you need a new PlayerPawn (e.g., Actor DoomPlayer2 : DoomPlayer replaces DoomPlayer). This is easy; just copy in the code from Doom's PlayerPawn where it shows the weapons, and change "Pistol" to "Pistol2."

Thank you for the detailed reply.

 

This is probably completely off so please forgive me, even though i understand what your saying.

Quote

Actor Pistol2 : Pistol replaces Pistol
{
   Player.StartItem "Pistol2"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 1, Fist, Chainsaw
  Player.WeaponSlot 2, Pistol
  Player.WeaponSlot 3, Shotgun, SuperShotgun
  Player.WeaponSlot 4, Chaingun
  Player.WeaponSlot 5, RocketLauncher
  Player.WeaponSlot 6, PlasmaRifle
  Player.WeaponSlot 7, BFG9000
  
  states
  {
    Fire:
    PISG A 4
    TRIF A 5 Bright A_FireBullets(0, 0, 1, 45, "RiflePuff", FBF_USEAMMO|FBF_NORANDOM) A_FirePistol
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
  }
}

Understandably an error pups up when i try and play a map with a query on the 3rd line.

 

Quote

Script error, "DOOM2(For builder).WAD:DECORATE" line 3:
"player.startitem" requires an actor of type "PlayerPawn"

Can you let me know how to rectify this and if there are any other errors in the script. 

If you could be a superman for me and write out the script :) but i understand that might take time so worry not if you don't have the time or patience ill try to suss it out if by any means.

Share this post


Link to post

The weapon and the playerpawn are two separate actors, and you have both codes pasted into one actor (this is the cause of your error message). I also see that you gave Pistol2 as a start item, but didn't change it in the actual weapon list. Finally, you should remove A_FirePistol from your attack line, because it's being replaced by the new attack. It should look like this:

 

Actor DoomPlayer2 : DoomPlayer replaces DoomPlayer
{
   Player.StartItem "Pistol2"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 1, Fist, Chainsaw
  Player.WeaponSlot 2, Pistol2
  Player.WeaponSlot 3, Shotgun, SuperShotgun
  Player.WeaponSlot 4, Chaingun
  Player.WeaponSlot 5, RocketLauncher
  Player.WeaponSlot 6, PlasmaRifle
  Player.WeaponSlot 7, BFG9000

}
  

Actor Pistol2 : Pistol replaces Pistol

{
  States
  {
    Fire:
    PISG A 4
    TRIF A 5 Bright A_FireBullets(0, 0, 1, 45, "RiflePuff", FBF_USEAMMO|FBF_NORANDOM)
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
 }

}

Edited by Not Jabba

Share this post


Link to post
4 minutes ago, Not Jabba said:

The weapon and the playerpawn are two separate actors, and you have both codes pasted into one actor. It should look like this:

 

Actor DoomPlayer2 : DoomPlayer replaces Doomplayer
{
   Player.StartItem "Pistol2"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 1, Fist, Chainsaw
  Player.WeaponSlot 2, Pistol2
  Player.WeaponSlot 3, Shotgun, SuperShotgun
  Player.WeaponSlot 4, Chaingun
  Player.WeaponSlot 5, RocketLauncher
  Player.WeaponSlot 6, PlasmaRifle
  Player.WeaponSlot 7, BFG9000

}
  

Actor Pistol2 : Pistol replaces Pistol

{
  States
  {
    Fire:
    PISG A 4
    TRIF A 5 Bright A_FireBullets(0, 0, 1, 45, "RiflePuff", FBF_USEAMMO|FBF_NORANDOM) A_FirePistol
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
 }

}

Thankyou for the write up Superman! :)

 

only i get this error on load up.

 

Quote

 line 21:
Sprite names must be exactly 4 characters

 

Share this post


Link to post

I just made another edit to the post above, sorry for the late catch. I'm pretty sure you're getting this error because you need to delete "A_FirePistol" from where you left it in after your A_FireBullets attack.

 

ANOTHER EDIT: Also, you shouldn't be using the TRIF sprite, which you copied from the example on the A_FireBullets page. This is an example for some completely different weapon with a set of sprites that you don't have in your wad. You should change TRIF to the correct Pistol sprite, which is probably PISG B. You should also change "RiflePuff" to "BulletPuff," and you probably do not need "FBF_USEAMMO|FBF_NORANDOM."

Edited by Not Jabba

Share this post


Link to post

Ah right silly me.

Haha no need to apologise your reply was super fast anyway :)

Thank you Jabba, it works like a charm. 

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×