Weasel's Mods

In this forum, you can start an ongoing development diary detailing the progress on your latest mods in progress.

Moderator: wildweasel

MasterOFDeath
Posts: 125
Joined: Wed Jul 06, 2005 17:52

Post by MasterOFDeath »

wildweasel wrote:NO.
Thirded.
User avatar
Alter
Posts: 851
Joined: Wed Oct 05, 2005 8:55
Location: Poland, Lodz

Post by Alter »

wildweasel wrote:NO.
Fourthed
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

The AltFire method sucks ass and this is coming from the guy who did it in the first place.
User avatar
Doomed Soul
Posts: 203
Joined: Sun Apr 30, 2006 16:54
Location: In front of my monitor working on Hell Opps.
Contact:

Post by Doomed Soul »

Hold on, I think I thought you was talking about some thing else.......and I don't know what Action_Reload is. Is that a new GZDoom feature? Dammit, I feel stupid.
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

Action_Reload is a new kind of reloading that DoomRater came up with. It's not a new GZDoom feature (it actually works in ZDoom as well). Basically it involves a hidden inventory item that is used when the R key is pressed.
User avatar
Zeg-Vok
Posts: 233
Joined: Wed Sep 21, 2005 18:04
Location: Up the creek without a paddle
Contact:

Post by Zeg-Vok »

Please . . . go into further Detail :D
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

Sure thing.

The Action Reload system mainly depends on three actors - two usable CustomInventories and a dummy Inventory item.

Code: Select all

ACTOR Action_Reload : CustomInventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
   -INVBAR

   States
   {
       Use:
       TNT1 A 0 A_GiveInventory("IsReloading",1)
       Fail
   }
}

ACTOR Action_ReloadCancel : CustomInventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
   -INVBAR

   States
   {
       Use:
       TNT1 A 0 A_TakeInventory("IsReloading",1)
       Fail
   }
}

ACTOR IsReloading : Inventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
   -INVBAR
}
To make this work, the mod in question has to give the player both Action_Reload and Action_ReloadCancel through a script. These items are not used like other items (hence why they don't appear in the invbar). Rather, there is a special keyconf setup that must be used:

Code: Select all

addkeysection "Ransom - Stranger Pt. 2" strangerkeys                    
addmenukey "Reload" +ransom_reload                    
alias +ransom_reload "use Action_Reload"
alias -ransom_reload "use Action_ReloadCancel"
defaultbind r +ransom_reload
This setup allows both one-tap reloading (the type I'm sure everybody's used to) and Outlaws-style reloading (one bullet at a time as long as the reload key is held). In typical Doom mods, though, this would be best applied to weapons like shotguns (since I'm sure everybody has died at least once because they were stuck in the middle of a reload).

So now we have the "actions" - what we need now is how to apply this setup to a weapon. Well, that's easy!

Code: Select all

ACTOR PocketPistol : Weapon replaces Gauntlets
{
   Weapon.SelectionOrder 400
   Inventory.PickupSound "weapons/pgunout"
   Inventory.PickupMessage "Pocket pistol (2)"
   Weapon.AmmoType1 "PGunAmmo" //The guns magazine
   Weapon.AmmoType2 "PGunClips" //The real ammo
   Weapon.AmmoGive 0
   Weapon.AmmoGive2 1
   Weapon.AmmoUse 1
   Weapon.Kickback 70
   AttackSound "weapons/pgun"
   +AMMO_OPTIONAL
   +NOAUTOFIRE
   Scale 0.25
   States
   {
   Spawn:
      VP70 A -1 bright
      Loop
   Ready:
      BMKG A 1 A_WeaponReady
      BMKG A 0 A_JumpIfInventory("IsReloading",1,15)
      Goto Ready
   Deselect:
      BMKG A 1 A_Lower
      Goto Deselect
   Select:
      BMKG A 1 A_Raise
      Goto Select
   Fire:
      BMKG A 0
      BMKG A 0 A_JumpIfNoAmmo(6)
      BMKF A 1 BRIGHT A_FireBullets(3,3,-1,5.5,0,1)
      BMKF B 1 BRIGHT
      BMKG B 1
      BMKG CB 1
      Goto Ready
      BMKF A 1 A_Playsound("weapons/dryfire")
      BMKG BCB 1
      BMKG A 8
   //Reload:
      TNT1 A 0 A_JumpIfInventory("PGunAmmo",6,2)
      TNT1 A 0 A_JumpIfInventory("PGunClips",1,2)
      TNT1 A 0
      Goto Ready
      TNT1 A 0 A_TakeInventory("PGunAmmo",999)
      BMKR A 4
      BMKR B 3 A_PlaySound("weapons/pgunout")
      BMKR C 2
      BMKR DEFG 1
      BMKR H 18
      BMKR IJK 1
      BMKR L 1 A_PlaySOund("weapons/pgunin")
      TNT1 A 0 A_TakeInventory("PGunClips",1)
      TNT1 A 0 A_GiveInventory("PGunAmmo",999)
      BMKR MNOPQ 1
      BMKR R 2
      BMKR S 3
      BMKR T 4
      Goto Ready
   }
}
Notice how there are only two JumpIfInventories at the top of the "reload" section? The first one ensures that the player doesn't already have a relatively full clip (this weapon in particular will not reload if the player has more than half of the clip left). The second ensures that the player has an extra clip in reserve with which to load the weapon again. Then the game goes through the reloading animation, adding ammo to the clip and taking away one clip from reserve.

I also added some extra code in this example so that when the player fires the weapon on an empty clip, it plays an "empty" sound and goes through the reload sequence. If you don't like automatic reloading, all that needs to be done is to add a "Goto Ready" right before the marked Reload section.
User avatar
GentryXaties
Posts: 8
Joined: Thu Jun 29, 2006 14:22

Post by GentryXaties »

wildweasel wrote: 1. Paint Your Wagon
Does that mean that on the easiest skill level of the game, we get to watch the monsters sing and dance before they beat the piss out of you? =P
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

"Hey. You paintin' yer wagon?"
"Yeah. Got a problem with that?"
"You missed a spot."
User avatar
MaxPower8905
Posts: 39
Joined: Sat Nov 19, 2005 15:03

Post by MaxPower8905 »

"Well then, grab a brush and join in!"
"Gonna paint the wagon! Gonna paint it fine! Gonna use all this paint because the wood is pine!"

I just had to say that, since that was the exact same thing I thought when I read that. :P
User avatar
Doomed Soul
Posts: 203
Joined: Sun Apr 30, 2006 16:54
Location: In front of my monitor working on Hell Opps.
Contact:

Post by Doomed Soul »

Ahhh....BRILLIANT!!!!!!!!!!!!!!!!! That was concerning action_reload. Now, concerning the "Paintin' the Wagon" thing, can I import .jpg format abstract wall paper and have a pscychodelic(?) wagon? jk :P. AH-HAH!!!! Use ACS scripting to somehow change the texture of the wagon's sides if a jpg, bmp, png, or other format is also loaded with the, um, western thing. So you can "Paint" your "wagon"!!!! Or just add a "weapon" that is a paint brush who's decal is a paint brush stroke. That would be pretty cool.
User avatar
Marty Kirra
Posts: 364
Joined: Sat Jul 09, 2005 4:25

Post by Marty Kirra »

Er...it's just a difficulty setting.

Nice progress Weasel. I'm probley going to be on more again, like before. So if you need anything, I'm here :P
User avatar
Doomed Soul
Posts: 203
Joined: Sun Apr 30, 2006 16:54
Location: In front of my monitor working on Hell Opps.
Contact:

Post by Doomed Soul »

I still want to paint a wagon....
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

Then paint your damn wagon. =P
User avatar
wildweasel
DRD Team Admin (Inactive)
Posts: 2132
Joined: Wed Jun 29, 2005 22:00
Location: the Admincave!
Contact:

Post by wildweasel »

Ransom
  • Added the tomed dual revolvers - using modified Slug Pistol graphics by Paul.
  • Fixed more editor numbers into Replaces.
  • Fixed a major error with the tomed pocket shotgun.
  • Repaired a few minor organizational errors.
Locked

Return to “Development Journals”