Thirded.wildweasel wrote:NO.
Weasel's Mods
Moderator: wildweasel
- TheDarkArchon
- Posts: 1000
- Joined: Wed Jul 06, 2005 11:58
- Location: What's that fucking smell
- Contact:
- Doomed Soul
- Posts: 203
- Joined: Sun Apr 30, 2006 16:54
- Location: In front of my monitor working on Hell Opps.
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- Zeg-Vok
- Posts: 233
- Joined: Wed Sep 21, 2005 18:04
- Location: Up the creek without a paddle
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
Sure thing.
The Action Reload system mainly depends on three actors - two usable CustomInventories and a dummy Inventory item.
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:
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!
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.
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
}
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
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
}
}
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.
- GentryXaties
- Posts: 8
- Joined: Thu Jun 29, 2006 14:22
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- MaxPower8905
- Posts: 39
- Joined: Sat Nov 19, 2005 15:03
- Doomed Soul
- Posts: 203
- Joined: Sun Apr 30, 2006 16:54
- Location: In front of my monitor working on Hell Opps.
- Contact:
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
. 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.

- Marty Kirra
- Posts: 364
- Joined: Sat Jul 09, 2005 4:25
- Doomed Soul
- Posts: 203
- Joined: Sun Apr 30, 2006 16:54
- Location: In front of my monitor working on Hell Opps.
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact: