Quick Kick in Doom. Is this possible?
Moderator: wildweasel
- DuduKrazy
- Posts: 402
- Joined: Sun Dec 25, 2005 18:59
Quick Kick in Doom. Is this possible?
In Duke Nukem 3D, you could use the mighty kick regardless of which weapon you're using by pressing a button. now i want to recreate this in Doom but i don't know if this is possible. if it's really possible, is there a way to do this?
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
Well, from a practicality standpoint you're going to have to create an awful lot of graphics - versions of your weapon with the mighty foot inserted into them. To actually get it to work, you're probably going to need to use the AltFire states in Decorate - unfortunately, this pretty much won't work if your weapon already has an altfire, or if you planned on having altfires for your weapons that did not involve the mighty foot.
Alternatively, though, you could set up a key to switch firing modes for the weapon to make up for the loss of the AltFire state.
Alternatively, though, you could set up a key to switch firing modes for the weapon to make up for the loss of the AltFire state.
- DoomRater
- Posts: 397
- Joined: Tue Jul 19, 2005 4:14
- Location: Programmer's Room, talking to Will Harvey
- Contact:
Quick steps to making a quick melee change:
1. code your melee weapon with a trigger (an inventory item that acts as a flag, two inventory items to control whether it's on or off, and a keybinding that uses the on state on press and uses the off state when let go, see "Adding Reloading to Weapons" for how to do that) that if set will raise the weapon very quickly and then throw an attack. It should then go to the Deselect state with A_SelectWeapon depending on what weapon was in use at the time.
2. Create a second inventory item for the use of remembering what weapon was selected at the time. Each of your weapons should change this value when selected and should not change it on deselect. Make sure each weapon changes it to a specific number! (the easiest way to do this is to take the maximum amount from the inventory item and then give the appropriate number back)
3. Add code to check for your new trigger in each weapon. It'll look about the same each time- it calls A_SelectWeapon(melee weapon) and the code in the melee weapon takes it from there.
Another way is to code the melee attack into each weapon (and if you don't want to superimpose the graphics, you can use the flash states if you're not already using them to picture the gun while you run through the melee animation using the regular gun frames so that it appear underneath the gun). Which method to use really depends on whether you want that Duke Nukem style or not.
1. code your melee weapon with a trigger (an inventory item that acts as a flag, two inventory items to control whether it's on or off, and a keybinding that uses the on state on press and uses the off state when let go, see "Adding Reloading to Weapons" for how to do that) that if set will raise the weapon very quickly and then throw an attack. It should then go to the Deselect state with A_SelectWeapon depending on what weapon was in use at the time.
2. Create a second inventory item for the use of remembering what weapon was selected at the time. Each of your weapons should change this value when selected and should not change it on deselect. Make sure each weapon changes it to a specific number! (the easiest way to do this is to take the maximum amount from the inventory item and then give the appropriate number back)
3. Add code to check for your new trigger in each weapon. It'll look about the same each time- it calls A_SelectWeapon(melee weapon) and the code in the melee weapon takes it from there.
Another way is to code the melee attack into each weapon (and if you don't want to superimpose the graphics, you can use the flash states if you're not already using them to picture the gun while you run through the melee animation using the regular gun frames so that it appear underneath the gun). Which method to use really depends on whether you want that Duke Nukem style or not.
- Nick_Perrin
- Posts: 29
- Joined: Thu Jul 28, 2005 2:09
- DoomRater
- Posts: 397
- Joined: Tue Jul 19, 2005 4:14
- Location: Programmer's Room, talking to Will Harvey
- Contact:
For layering purposes, I'd have it the other way around (flash states show the weapon and the regular animations use the kick). That way the weapon appears overtop the leg.
If the other method is used it's more like Duke Nukem, though. The weapon deselects, goes into a quick kick, and then reselects the weapon being used.
If the other method is used it's more like Duke Nukem, though. The weapon deselects, goes into a quick kick, and then reselects the weapon being used.
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- DoomRater
- Posts: 397
- Joined: Tue Jul 19, 2005 4:14
- Location: Programmer's Room, talking to Will Harvey
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- TheDarkArchon
- Posts: 1000
- Joined: Wed Jul 06, 2005 11:58
- Location: What's that fucking smell
- Contact:
- wildweasel
- DRD Team Admin (Inactive)
- Posts: 2132
- Joined: Wed Jun 29, 2005 22:00
- Location: the Admincave!
- Contact:
- NeoWorm
- Posts: 29
- Joined: Sat Nov 05, 2005 0:13
- Location: Czech republic
- Contact:
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47