In Bg1 (maeby in the bg2 too, but only with a bg1 avatars)when you throwing weapon (spear or axe) game start animation sequence choosed in weapon properties (backhand, overhand or thrust), But in bg2 it's always overhand sequence. It's ok with 1handed weapons (axe,dart...) but 2handed spear look awfull when throwned overhand (maeby that's why bioware not realised throwing ability for spear in game), thrusting sequence will look much better. Can it be done, as with bg1 avatars?
When item ability use ranged flag, engine looks what animation type should be played on atack (overhead or backslash or piercing), BUT
In BG2 only bg1's animations (Monk, skeleton, any bg1 character animation) has check for animation type, and all bg2 char & weapon animations hasn't. They always use overhead animation when "ranged" set for ability.
Many interesting things can be coded, if this can be fixed.
(Example: light weapons - dagger, rapier, short sword or even my custom animation "long spear" with very long reach, can logically use dexterity for thac0, as with 3ed feat)
I can fix this for 2handed weapon with my ugly code, but with 1handed one issue occur, some weapons need overhead, other piercing, and only one can be set for all sad.gif
Thanks for all Your work.
If I understand you correctly, the problem is that most BG2 animations ignore the percentages at item ability+0x2c when using a ranged ability?
However, there are some that do correctly evaluate these and you want me to add the check to the other animations.
By the way, try to give concrete examples of animations, so that I might look them up.
All bg2 characters [with prefix C, not NPCs with prefix N] do not check for anim type [npcs has own g24 animation for ranged weapon], maeby other character dedicated animations [shields, helms etc] need patching too, but I think that character animation couse this issue. So, I can leave without this patch, just thanks again.
p.s. I have a try to code my previous request (overweight speed percentage), but failed many times. So if you decide to code it, i'll be VERY thankfull.
This was an interesting one to look at, because the way the engine distinguishes ranged from non-ranged animations is extremely simple (noting that a ranged attack uses SEQ_SHOOT, while non-ranged uses SEQ_ATTACK):
void CCreatureObject::ValidateAttackSequence(char* pSeq) { //0x8D6D78 if (*pSeq == SEQ_SHOOT) { CItem* pItm = m_Inventory.items[m_Inventory.nSlotSelected]; if (pItm) { pItm->Demand(); ItmFileAbility& pAbility = pItm->GetAbility(m_Inventory.nAbilitySelected); if (pAbility) { if (pAbility->attackType != TYPE_RANGED) *pSeq == SEQ_ATTACK; } else { *pSeq == SEQ_READY; } pItm->Release(); } else { *pSeq == SEQ_READY; } } else if (*pSeq == SEQ_ATTACK) { CItem* pItm = m_Inventory.items[m_Inventory.nSlotSelected]; if (pItm) { pItm->Demand(); ItmFileAbility& pAbility = pItm->GetAbility(m_Inventory.nAbilitySelected); if (pAbility) { if (pAbility->attackType == TYPE_RANGED) *pSeq == SEQ_SHOOT; } else { *pSeq == SEQ_READY; } pItm->Release(); } else { *pSeq == SEQ_READY; } } return; }This is followed by void CCreatureObject::SetAnimationSequence(wSeq), where a switch on wSeq determines that only a wSeq == SEQ_ATTACK will look at the relevant SLASH, BACKSLASH, and JAB animations.
You'll need to clarify this for me, but I think the reason why certain animations can use other attack animations on 'shooting' is because the animation frames are designed to look like that.
Yes, it is possible to modify this procedure a bit so far that non-launcher ranged weapons that get equipped in the weapon slots will use the appropriate percentages (i.e. SEQ_SHOOT would change to SEQ_ATTACK for these animations). There is a bit of code I haven't fully reversed for such a change, so it will have to be a beta hack until I sort out how this change might affect animations.
Update: Took a while, but should work OK now. It took ages for me to find out that the above procedure was using a char* instead of a short*, and I was scratching my head wondering why the creature would suddenly lapse back into the SEQ_SHOOT animation for no apparent reason.
Anyway, this is now completed.
-----Use Animation Percentages for Throwing Weapons [M]
Enables the use of item ability slash %, backslash %, and jab % fields for ranged weapons equipped in a weapon slot that do not require a launcher
Because this hack makes the creature use of the SEQ_ATTACK_[] animations instead of SEQ_SHOOT, attacks play the SEQ_ATTACK and SEQ_ATTACK_[] animation sounds instead of the SEQ_SHOOT animation sound
Options:
-0: disabled
-1: enabled
Edited by Ascension64, 19 January 2011 - 04:00 AM.