Switching Weapons with Different Animations
- The_Spartan
- Posts: 79
- Joined: Fri Oct 12, 2012 1:12 pm
- Location: Italy
- Contact:
Switching Weapons with Different Animations
Hi guys,
I need serious help with something, because i'm out of ideas. I have a weapon that has multiple animations for deselection (unwielding) depending on the next weapon that is selected.
An example: if i'm using weapon A, and i'm switching to weapon B, I want another animation to be played instead of the regular one for the deselection/selection states.
This happens in Hexen 2, when using the necromancer and switching from weapon 2 to weapon 3 (having the player just turning page to the next spell). Any ideas on this?
I need serious help with something, because i'm out of ideas. I have a weapon that has multiple animations for deselection (unwielding) depending on the next weapon that is selected.
An example: if i'm using weapon A, and i'm switching to weapon B, I want another animation to be played instead of the regular one for the deselection/selection states.
This happens in Hexen 2, when using the necromancer and switching from weapon 2 to weapon 3 (having the player just turning page to the next spell). Any ideas on this?
Re: Switching Weapons with Different Animations
Perhaps you can check if the next weapon on the weapon wheel exists by calling a script that knows the order of your weapons, and have it set your weapon state to the corresponding one.
- The_Spartan
- Posts: 79
- Joined: Fri Oct 12, 2012 1:12 pm
- Location: Italy
- Contact:
Re: Switching Weapons with Different Animations
"Exists"? That's not what I'm aiming at. I want to change the animation depending on the nextly selected weapon.
Re: Switching Weapons with Different Animations
You don't have information of the weapon being selected until the select state is entered on the said weapon. In order for that state to be entered your weapon should be done with it's deselect state. I don't think it's very possible to do.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
Re: Switching Weapons with Different Animations
Lot's of work but maybe you can use a A_giveinventory WeaponName for each gun when you select it. Have the select state check what item you have to jump to a custom raise, remove the previous WeaponnameINV and add a the current one.Ivan wrote:You don't have information of the weapon being selected until the select state is entered on the said weapon. In order for that state to be entered your weapon should be done with it's deselect state. I don't think it's very possible to do.
Re: Switching Weapons with Different Animations
The weapon must have fully lowered before doing that, so you require the Deselect state lower the weapon fully.Frits wrote:Lot's of work but maybe you can use a A_giveinventory WeaponName for each gun when you select it. Have the select state check what item you have to jump to a custom raise, remove the previous WeaponnameINV and add a the current one.Ivan wrote:You don't have information of the weapon being selected until the select state is entered on the said weapon. In order for that state to be entered your weapon should be done with it's deselect state. I don't think it's very possible to do.
Additionally implement your own weapon selection / deselection mechanism.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===
- The_Spartan
- Posts: 79
- Joined: Fri Oct 12, 2012 1:12 pm
- Location: Italy
- Contact:
Re: Switching Weapons with Different Animations
Basically, I need a way of knowing which specific weapon a player has currently selected, as a "pending weapon". Unfortunately, DECORATE does not implement such a possibility nor an event handler. I don't really know how to do this.
Re: Switching Weapons with Different Animations
Give a checker item ("Actor LoweringKnife : CustomInventory") in the Deselect state of Weapon A.
Do something like "TNT1 AAAAAAAAAAAAAAAA 0 A_Lower" so that it disappears instantly. (But keep the "Loop" at the end of this state.)
in the Select state of Weapon B, have several "sub-states" like Select.FromShotgun or Select.FromPistol. jump to them using a A_JumpIfInventory and the checker item you made in step 1. These sub-states contain the actual lowering animations of Weapon A. Don't forget to do A_TakeInventory and take the checker item ("LoweringKnife", etc), followed by "TNT1 AAAAAAAAAAAAAAAA 0 A_Lower" at the beginning of that sub-state. Then you will have to manually animate the lowering animation of Weapon A followed by the raising animation of Weapon B, using duplicate versions of your weapon's sprites each with different sprite offsets (or you can even the "Offset" DECORATE frame property on your existing sprites but I hate doing that). when everything is done just do "Goto Ready".
that's what I would do if I was in your situation. the upside to my method is that you can animate your weapon switches however you want if you know how to position sprites, meaning you can sling weapons in from the side or top of the screen, instead of Doom's boring "scroll from bottom" animation. you can also make it as fast or slow as you like depending on which weapon you're switching to or from, and you can play sounds too for a nice effect.
Do something like "TNT1 AAAAAAAAAAAAAAAA 0 A_Lower" so that it disappears instantly. (But keep the "Loop" at the end of this state.)
in the Select state of Weapon B, have several "sub-states" like Select.FromShotgun or Select.FromPistol. jump to them using a A_JumpIfInventory and the checker item you made in step 1. These sub-states contain the actual lowering animations of Weapon A. Don't forget to do A_TakeInventory and take the checker item ("LoweringKnife", etc), followed by "TNT1 AAAAAAAAAAAAAAAA 0 A_Lower" at the beginning of that sub-state. Then you will have to manually animate the lowering animation of Weapon A followed by the raising animation of Weapon B, using duplicate versions of your weapon's sprites each with different sprite offsets (or you can even the "Offset" DECORATE frame property on your existing sprites but I hate doing that). when everything is done just do "Goto Ready".
that's what I would do if I was in your situation. the upside to my method is that you can animate your weapon switches however you want if you know how to position sprites, meaning you can sling weapons in from the side or top of the screen, instead of Doom's boring "scroll from bottom" animation. you can also make it as fast or slow as you like depending on which weapon you're switching to or from, and you can play sounds too for a nice effect.
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- The_Spartan
- Posts: 79
- Joined: Fri Oct 12, 2012 1:12 pm
- Location: Italy
- Contact:
Re: Switching Weapons with Different Animations
Unfortunately, i cannot do this, since i'm working with 3d models, and i cannot call an external frame outside the base model of the weapon. In other words, i cannot reproduce the movement of a weapon inside another weapon, i can't emulate Weapon A deselection phase into Weapon B...
Re: Switching Weapons with Different Animations
Damn. Sorry then. :/
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community