Author Topic: Multiple damage types in a single effect  (Read 360 times)

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
Multiple damage types in a single effect
« on: May 07, 2011, 10:11:54 pm »


               I assume this is a no but it's worth asking for the sake of being sure. Is there any way of applying multiple EffectDamage functions in a method that looks like this in-game?

'Image

The only method I've used results in it spanning over several lines, which isn't game-breaking but a little annoying. '<img'>
               
               

               


                     Modifié par Rubies, 07 mai 2011 - 09:13 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #1 on: May 08, 2011, 02:44:32 am »


               I have come up blank on any way to change the display.  

There my be ways useing nwnx,  but short of that there is no way I know of.  

Just as a side note, most of the feed back messages are given  by setting Custom tokens 0 through 7 and then displaying an entry from Dialog.tlk.  

exmple  talktalbe entry 10466 is:
< CUSTOM0> damages < CUSTOM1>: < CUSTOM2>

I do not know if that will help you chase down a solution or not.  

L8
               
               

               
            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #2 on: May 08, 2011, 06:05:06 am »


               Haven't had any progress fiddling with the SetCustomToken function, but I might resort to some exe tinkering in the end. Thanks for clearing it up. '<img'>
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #3 on: May 08, 2011, 06:51:28 am »


               I'm a little perplex as to why anyone would want to alter the core game damage on items...

Wouldn't it be 10 X easier to just edit the Base Item 2da if you wanted to alter base damage?

If you want to increase damage without screwing with 2das, then simply use the property OnHit Cast Spell Flaming Hide, where you can control damage from just one script!  Edit the Flaming Hide script and be done with it all...

Just some thought, I know I"m probably way off base on this..
               
               

               


                     Modifié par _Guile, 08 mai 2011 - 05:52 .
                     
                  


            

Legacy_Rubies

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #4 on: May 08, 2011, 07:28:10 am »


               You're slightly off, yeah. For instance, a scripted method of Whirlwind Attack would have to deal the character's base damage + bonus damage + modifiers. In NWN's hardcoded method the combat log records this as:


x damages y (- physical, - negative, - sonic)

However, from a scripted method it results in several outputted combat lines:


x damages y (- physical)
x damages y (- negative)
x damages y (- sonic)

Just a minor readability difference, but something I found rather annoying. '<img'>
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #5 on: May 08, 2011, 03:14:03 pm »


               Its not only readability. There is also resist/immunity issue. First any physical damage applied from effect is subject to damage_power bug. Second I wanted to implement a special OnCriticalHit damage for Stormlord class. He gets electric one. But he already got electrical damage in normal hit. This means that correctly it should stack in case of critical hit, but since I cant add it into weapon damage as the script fires after its done and I have to apply the critical damage separately it can be blocked by a low ammount of electrical resist completely :/

I guess both issues could be workarounded via increasing the damage ammount based on character resists/immunities/spell effects but thats almost impossible to make correctly and surely not worth. It would be really bad workaround anyway. So answer is no, I don't know any way to do that neither with NWNX though HG has even new damage type, psyonic so maybe something in linux nwnx plugin may do that...
               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #6 on: May 12, 2011, 09:32:51 pm »


               this is possible with nwnx_structs (linux only) you'd have to modify the plugin slightly tho.  I'm at a loss as to how to describe it all succinctly.  i'd elaborate if nwnx on linux is a path that you're taking.  Other than that i don't know of any what to do it.
               
               

               
            

Legacy_Werehound

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #7 on: May 14, 2011, 11:46:34 pm »


               

pope_leo wrote...

this is possible with nwnx_structs (linux only) you'd have to modify the plugin slightly tho.  I'm at a loss as to how to describe it all succinctly.  i'd elaborate if nwnx on linux is a path that you're taking.  Other than that i don't know of any what to do it.

I'm currently moving my server over to Linux right now, and am curious as to how to do this. It would make weapon buffs much nicer.
               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
Multiple damage types in a single effect
« Reply #8 on: May 15, 2011, 09:28:22 pm »


               In the game engine all effects have an array integers specifying properties.  It's length varies depending on effect's type.  In the case of EffectDamage there are 20 integers.  For some reason Acaos hardcoded a limit of 15 integers, so you need to edit in nwnx_structs are f_GetInteger.c & f_SetInteger.c.  Change the following lines in each from
     if (idx < 0 || idx > 15)
to
     if (idx < 0 || idx > eff->eff_num_integers)
Not sure if this was intentional or not.

The Integers at these indexes specify the following
0 - 12: These are the Damage amounts in the exact same order as the DAMAGE_TYPE_* constants in nwscript.
13: Set to 1 on a melee damage.
14: Seems usually be 1000, I think it's some action duration.
15: DAMAGE_TYPE_* - This is whatever the damage used to create the effect was.
16: DAMAMGE_POWER_*  -- Doesn't seem to work.
17: This seems also seems to flag that the damages are from melee attack when set to 1.  If you don't set this to one it will add up all the damages then apply that much for every type that was set.
18: Seems to be set to 1 on a Ranged attack
19: not sure.

My original testing was somewhat limited, having looked at it again it seems this sadly might share the same issuses as Divine Wrath, Divine Favor, etc.  I.e. The damage is all unblockable and respects no soak, immunity, resists, etc, which in most cases probably isn't what you'd want.  But maybe there is a way, it's a place to start, since it doesn't make much sense that an effect with one damage type would respect defenses and one with two would not.
               
               

               


                     Modifié par pope_leo, 15 mai 2011 - 08:29 .