Soldak Home   Drox Operative   Din's Curse   Depths of Peril   Zombasite  

Go Back   Soldak Entertainment Forums > Zombasite > Zombasite modding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 01-07-2017, 06:15 AM
Exovi Exovi is offline
Join Date: Jan 2017
Posts: 13
Default Switching from Melee to Ranged Basic Attacks According to Weapon

I've followed the advice of Tigrath in this recent thread and created a ranged magical attack for my magical classes, and it works great! Unfortunately, when using a character who can wield both melee weapons AND newly ranged staves/wands (Healer class), they're stuck with either a melee attack OR a ranged attack. With a healer they will either melee with both staves and maces like in the vanilla game or attempt to use the modded ranged attack [SkillBowAttackMagician] with all weapons (succeeding with staves, failing with maces) - whether the ranged or melee attack triggers depends on whether [SkillAttackHealer] is enabled (overrides [SkillBowAttackMagician]).

The behavior I would like to create is like that of the Hunter class, able to switch between melee (daggers) and ranged (bows) freely. Equipping a bow changes the default skill between [SkillAttackHunter] and [SkillBowAttackHunter], and I'm not sure how - this doesn't occur when swapping between between maces and staves. Any advice/suggestions would be greatly appreciated!

Last edited by Exovi : 01-07-2017 at 06:26 AM.
Reply With Quote
Old 05-18-2017, 12:53 AM
MovingShadows MovingShadows is offline
Join Date: May 2017
Posts: 1

I would like this as well but I couldn't figure it out. in the end I just made the ranged staff attack a non basic skill that you could buy for 0 points, requires a staff/wand equipped, doesn't need mana and added it to the mage classes.
Reply With Quote
Old 05-18-2017, 11:12 PM
Destro*'s Avatar
Destro* Destro* is offline
Join Date: Jul 2013
Posts: 310

I just tested this out and all I can say is... very interesting!

There is most likely some hard coded interaction for this. I can't imagine any change that could be made to make this work as its not even a setting within a functional block.

edit: Tested a bit over an hour today. In the end, here is my conclusion: Bows are read and interpreted as a secondary attack option if they are ordered second in the skill list for a skill tree. Nothing else has this capability.

The proof is really just this:

ModSkillAttackBase overrides SkillAttackBase
Base BaseSkillOffense
BaseName $$Attack$$
Name $$Attack$$
BaseCost 0
ShowAttackTime 1
Animation attack
WaitForAnim 1
LowPriority 1
BasicAttack 1
Attack 1
CanAutoAttack 1
BasicSkill 1
MaxRange 100.0

WeaponType WeaponDagger
WeaponType WeaponAxe
WeaponType WeaponAxeTwoHanded
WeaponType WeaponSword
WeaponType WeaponSwordTwoHanded
WeaponType WeaponMace
WeaponType WeaponMaceTwoHanded

StandStillToCast 1
ModSkillBowAttackBase overrides SkillBowAttackBase
Base BaseSkillOffense
BaseName $$BowAttack$$
Name $$BowAttack$$
BaseCost 0
ShowAttackTime 1
Animation attackBow
WaitForAnim 1
LowPriority 1
BasicAttack 1
Projectile ProjRangerBaseBolt
ProjectileDamage 1
ProjNormalAttack 1
BasicSkill 1
WeaponType WeaponBow
WeaponType WeaponStaff
WeaponType WeaponWand
StandStillToCast 1

I added both blocks to weaponmaster skill tree and tested in both orders.

Regardless of the order, bows are the only item that can be placed second and won't give the 'you don't meet the item requirements' message. Everything else does. This is why I believe there is a hardcoded exception to let bows be read or exclude everything else. Whether it's a bug, feature or incomplete feature, only a developer could really answer for sure.

Last edited by Destro* : 05-21-2017 at 12:05 PM.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -4. The time now is 11:50 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright 2007 - 2019 Soldak Entertainment, Inc.