Author Topic: Silvered/cold steel weapon material vs. DR?  (Read 628 times)

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« on: August 25, 2010, 05:43:16 pm »


               Has anyone implemented silver and cold steel weapons (using the Material item property) in conjunction with a DR or some comparable property on the respective creatures (lycanthropes, vampires, etc.)?  If so, exactly how did you do it, and why did you choose that particular approach versus other options?

I understand that there are several ways to script this, and I'm not really asking for a scripting tutorial here from people who haven't tried this themselves. I'm instead looking for input from people who actually do have experience with implementing systems using the Material item property, regarding what they found to be the best technique.

For the record, I also did not find any system on NWVault which uses the Material item property. That strikes me as strange, since this is apparently one of the main reasons why Brian Chung added the Material item property. I also suspect quite a few PWs use something like what I'm asking about here. Info pointing me to any existing and available systems that already use item Material in this way would also be helpful here.

Thanks in advance!
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 04:50 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #1 on: August 25, 2010, 07:30:17 pm »


               I am skeptic about material property. I dont know why it was added, but the material can be recognize from name or description, builder only had to add variable to the item. So why bother with itemproperty?

The Quality itemproperty is mostly the same... You can just add variable and declare the item as masterwork in name which I would recommend even if you would bother to add it as itemproperty.

EDIT: Also its less efficient to check if the item has itemproperty than to check local variable
               
               

               


                     Modifié par ShaDoOoW, 25 août 2010 - 09:35 .
                     
                  


            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #2 on: August 25, 2010, 09:23:29 pm »


               As I said, I understand that there are several ways to script this, and I'm not really asking for a scripting tutorial here from people who haven't tried this themselves.

The item property was added so that the player can see this special item property in the item description, listed alongside any other item properties. You personally may not prefer to do it this way. If that is the case, this thread is not for you. I do wish to do it this way, and this thread is for discussing how to do it this way.
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 08:27 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #3 on: August 25, 2010, 09:50:35 pm »


               Now I know you are asking for comments from people who have implemented this. But I just want to say that I would like to hear comments on this too. I also like the idea of seeing the material in the item description by adding the item property.

The only way I thought to implement it was to check for the weapons material item property in the creatures OnDamaged script and add/take extra damage there. If there are other methods I'd like to know about them too.
               
               

               
            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #4 on: August 25, 2010, 10:31:11 pm »


               Yes, that's definitely the most likely starting point. It's fairly easy to add damage there. In this particular case, using racial group "shapechanger" might work well also.

The real problem is the Damage Resistance. As far as I know that is all hard coded. And onDamaged does not allow you to intercept the initial damage done, since that damage is applied before the event fires. It only lets you add more damage after the fact.

In other systems (prior to 1.69), people have gotten around this by giving a weapon a +1 damage bonus (I think) against racial type, and then given the creatures a DR. The race-based bonus apparently tricks the game engine into disregarding the damage resistance which would otherwise be used. But that's where practical knowledge from someone who has actually tried this would be very useful, because that isn't well documented.
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 09:41 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #5 on: August 25, 2010, 10:39:39 pm »


               For monsters use OnPhysicalAttacked, for PC I have done OnDamaged event which fires 0.1 second before the PC is harmed using custom OnHit spell on armor (and I got special armor which does looks like no armor in case that player has no armor on himself. If you want I can share this approach.
               
               

               
            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #6 on: August 25, 2010, 10:43:18 pm »


               The onPhysicalAttack event runs after the attack, even if no damage occurs. So no,that is not the right way to do this.
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 09:57 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #7 on: August 25, 2010, 10:46:43 pm »


               

invisig0th wrote...

onPhysicalAttack runs even if no damage occurs, so it is not the right way to do this. OnDamaged is the event to use here.

This should not affect anything. Just add DR in OnPhysicalAttack for short ammount of time like 0.3 - maybe less - further testing is required. This should be for players thought, shouldn't it? The OnDamaged on players will allow to do it correctly.
               
               

               


                     Modifié par ShaDoOoW, 25 août 2010 - 10:56 .
                     
                  


            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #8 on: August 25, 2010, 10:47:47 pm »


               This is for monsters only, not players.

[Edit: Shadoow is right -- DR is about preventing the damage , not the attack itself. So using the OnPhysicalAttacked event would be the right event to use if someone was inclined to do what he is suggesting. See below for why it won't work.]
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 11:07 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #9 on: August 25, 2010, 10:59:33 pm »


               

invisig0th wrote...

This is for monsters only, not players.

I'll say it again -- BOTH of these events run AFTER the attack has already been processed by the game engine. There is NOTHING you can do to prevent or alter the attack or damage AFTER the game has already processed the attack and applied any applicable damage. Your suggestion above 100% useless because it assuming things work the other way around.

ShaDoOoW wrote...
If you want I can share this approach.

No thank you -- I'd rather you did not. I would like input from people who have tried this and KNOW how it works. You clearly do not.

You should stop echoing the NWN Lexicon and try things on your own '<img'>. OnPhysicalAttacked fires before the damage is given.
               
               

               


                     Modifié par ShaDoOoW, 25 août 2010 - 10:02 .
                     
                  


            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #10 on: August 25, 2010, 11:10:10 pm »


               You are correct, one of my statements above was incorrect.  OnPhysicalAttacked is processed after the attack happens but before the OnDamaged event fires and damage is applied. Since Damage Reduction is about preventing the damage and not the attack, I will admit that considering what can be done during the OnPhysicalAttacked event is very reasonable.

Regardless, the technique you suggested above won't actually work. Applying a momentary DR is a terrible idea. If the creature has one opponent with a silver weapon and several other opponents with normal weapons, the temporary DR would apply to all opponents. Completely wrong.

Even if your technique did what it was supposed to here, I'm certainly not going to implement a solution which involves applying momentary effects based on guesswork regarding the exact timing of game engine events firing. That's just plain sloppy coding.

Based on the questionable quailty of your suggestion above, it is likely that you have a lot to learn before you will have the expertise necessary to tackle anything as complicated as rewriting the entire NWN spell engine. One needs to walk before one can run.
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 11:21 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #11 on: August 26, 2010, 12:22:32 am »


               

I have to admit, an unworkable suggestion like this
coming from the guy who says he wants to rewrite the NWN spell engine is
a bit distressing.

LOL, said the man who never shared anything with community, just few screenshots of githzerai which he never finished.

Instead you get idea and try it, you spitting anger on only person that want to help you. I would be surprised if anyone else would want to help you with this further.

You should not judge the man based on one his statement, I got many scripts at vault and I helped many peoples. Do you even understand my new spell engine concept?

As I said. If you followed my ideas and hints, instead of damned them, you would know how to do it. Between lines, I suggested you the working solution, now I just tested it and it works. But I won't take effort to repeat it for someone who thinks he knows better.':sick:'
               
               

               
            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #12 on: August 26, 2010, 12:30:50 am »


               Your suggestion to apply a momentary DR will not actually work. If you don't want people telling you when your suggestion won't work, then you will need to post better suggestions.

Your posts in this thread do also call into question your general knowledge level of the subject matter, and it is perfectly valid to say that you might have a few things to learn. I know I certainly have things to learn about all this, which is exactly why I started this thread.

You may feel free to share any personal feelings you have towards me via  private messages. That sort of thing doesn't belong in a thread.

You have made it quite clear that you have no intention of providing any actual assistance here. Please stop spamming this thread.
               
               

               


                     Modifié par invisig0th, 25 août 2010 - 11:43 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #13 on: August 26, 2010, 12:38:05 am »


               deleted, sorry for spamming
               
               

               


                     Modifié par ShaDoOoW, 25 août 2010 - 11:39 .
                     
                  


            

Legacy_Guest_invisig0th_*

  • Jr. Member
  • **
  • Posts: 97
  • Karma: +0/-0
Silvered/cold steel weapon material vs. DR?
« Reply #14 on: August 26, 2010, 02:09:08 am »


               Getting back to the topic, applying a standard DR effect, even for a very short duration, using the OnPhysicalAttacked script will not be useful here, since other attackers using normal weapons during that period would also have damage reduction applied. Since the built in armor/skin DR item property cannot be selectively applied versus a specific attacker, this is simply not a workable solution for the problem I have described here.

Any other suggestions as to how to apply a DR-like effect using scripting? Using either the OnPhysicalAttacked or OnDamaged event, I don't see any way to *selectively* reduce the damage that the game engine will apply based on the weapon of the attacker.  It may not be possible. Can anyone confirm this?
               
               

               


                     Modifié par invisig0th, 26 août 2010 - 03:00 .