Hello!
What exactly does the "Additional Property" under item properties do, and how the heck do I use it?
Can it be put on an item to "do something" when a weapon is used to attack?
Thanks for your time!
Michael
HELP...again? Additional Property [Unknown]
Débuté par
Michael_Patty
, sept. 02 2010 04:51
#1
Posté 02 septembre 2010 - 04:51
#2
Posté 02 septembre 2010 - 06:16
It does nothing, it is just placeholder for custom script systems.
Sure it can do something when attack, or when (un)equiped, but you need to script it.
Sure it can do something when attack, or when (un)equiped, but you need to script it.
#3
Posté 02 septembre 2010 - 03:13
How do I script something to "do such and such" on attack?
It has been my (admittedly poor) understanding that for a script to fire, you need an event. To what event would I attach the script to make it fire on attack? (there is no OnAttack event that I know if).
Thank you patience regarding my ignorance.
Michael
It has been my (admittedly poor) understanding that for a script to fire, you need an event. To what event would I attach the script to make it fire on attack? (there is no OnAttack event that I know if).
Thank you patience regarding my ignorance.
Michael
Modifié par Michael_Patty, 02 septembre 2010 - 03:16 .
#4
Posté 02 septembre 2010 - 03:59
If you are using tag-based scripting:
Add this to your weapon:
On Hit Cast Spell: Unique Power (OnHit)
Add a script with the same tag as your weapon. There are numerous templates available for this. You'll be looking for the X2_ITEM_EVENT_ONHITCAST: section of that script.
You can also do this with armor.
Tag-based scripting opens countless doors for custom items. I personally have several hundred such scripts in my PW. Very versatile.
Add this to your weapon:
On Hit Cast Spell: Unique Power (OnHit)
Add a script with the same tag as your weapon. There are numerous templates available for this. You'll be looking for the X2_ITEM_EVENT_ONHITCAST: section of that script.
You can also do this with armor.
Tag-based scripting opens countless doors for custom items. I personally have several hundred such scripts in my PW. Very versatile.
#5
Posté 02 septembre 2010 - 05:17
The Amethyst Dragon:
Won't that work only when they HIT? I would think it would not fire when they miss. Is there any way to make a script fire when they attack, regardless of whether they hit or miss?
Won't that work only when they HIT? I would think it would not fire when they miss. Is there any way to make a script fire when they attack, regardless of whether they hit or miss?
#6
Posté 02 septembre 2010 - 05:20
Yes, using npcs OnPhysicalAttack event, however this event fires few milisecond before the weapon reaches target, so it do not need to be realiable. Also Players do not have this event.Michael_Patty wrote...
The Amethyst Dragon:
Won't that work only when they HIT? I would think it would not fire when they miss. Is there any way to make a script fire when they attack, regardless of whether they hit or miss?
Also NWNX has OnAttack event but it fires when player click at enemy, not good. Why you want to do something when player attack anyway?
#7
Posté 03 septembre 2010 - 04:56
ShaDoOoW:
To generate effects and sounds from a weapon when it fires. It would need to be on attack because it would happen whether they hit or not.
To generate effects and sounds from a weapon when it fires. It would need to be on attack because it would happen whether they hit or not.
#8
Posté 03 septembre 2010 - 06:32
hmm that could be onphysical event used for, however as I said already, players dont have this, if player uses the weapon at another player, you can catch only ondamaged and only with intensive scripting, this event is not default, must be workarounded
#9
Posté 03 septembre 2010 - 11:27
I believe all this was covered in the other thread. You were correct from the start -- you do indeed need an event to attach your script to, and there is no such event that fires when a weapon is used to attack. The OnHit event is pretty much all you have -- and as you quite correctly observed, that won't meet the requirements here.
If PCs cannot be attacked with your custom weapon, you could theoretically set up a custom OnPhysicalAttacked script for every single possible target in your module (creatures, placeables, doors, everything) to check for that weapon and play a sound. However, that is preposterously convoluted, and most likely not very practical.
If PCs cannot be attacked with your custom weapon, you could theoretically set up a custom OnPhysicalAttacked script for every single possible target in your module (creatures, placeables, doors, everything) to check for that weapon and play a sound. However, that is preposterously convoluted, and most likely not very practical.
Modifié par Invisig0th, 03 septembre 2010 - 11:35 .





Retour en haut







