I've been working through the tutorials and how-tos on equipment and combat and am trying to work out how to do something.

Say I have two types of weapons: physical (clubs etc) and projectile (guns etc). I want the damage value for physicals to be calculated using character strength (as in the tutorial). But for projectile weapons I want the damage to be a fixed amount dependant purely on the weapon.

I can see how to define different attack types using Attack Attributes. I guess I'd then change the damage calculation formula to branch according to the weapon's attack type. What I can't work out is how to assign an Attack Attribute to weapons. The tutorial defines Cut, Stab etc but I can't see where it attaches these to weapons.

Have I missed something obvious or am I going about it in entirely the wrong way?
  • Inventory > Weapons > Add Attack Attributes Bonus for assigning to weapons.

    Switch dropdown from Element to Attack Type.
  • Thanks, I hadn't dug all the way down to that!

    My original thought was to branch the formula dependent on a flag but this isn't a flag so there's no way to test it.

    So I guess the best thing for me to do is have a sub formula for 'Physical damage' which multiplies character strength bonus by the Physical attribute value - Projectile weapons will have 0 for the attribute so this will effectively ignore it. Then another sub formula for Projectile damage etc then add them all together in the main damage formula.

    Similarly I'd use sub formulae to build up the Hit Chance formula.

    Looks like I'm going to have to get used to thinking in terms ofsub-formulae and multiplying by zero rather than branching!
  • edited November 2015
    Or would I be better defining two types of attack ability, Hit and Fire Weapon, then assigning the appropriate one to each weapon under Equipment Abilities?

    My head hurts...
    Post edited by Trevinburgh on
  • Well, I've gone down the 'Abilities' route and think I've sorted myself out. Basically I've crated two Abilities, Attack - Melee and Attack - Gun with different hit chance and damage formulae. I then give these abilities to the relevant weapons. I've also changed the Battle Menu so that it doesn't have the default Attack option but only Abilities. Thus if the player is armed with a sword he gets 'Attack - Melee' as an option, if armed with a rifle he gets 'Attack - Gun'. I've then used damage types to define additional damage for each weapon depending on power.

    It seems to work, but I feel a bit guilty about effectively removing a whole chunk of functionality (the basic Attack mechanism). Please let me know if I've done something really stupid!
  • Equipment Abilities are for adding/learning abilities when a weapon is equipped. You want to use the Override Attack and Override Counter settings of weapons to use a different ability when attacking with different weapons.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks, will investigate that further
Sign In or Register to comment.