Aller au contenu

Photo

Custom Weapon Properties


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
mchotdog33

mchotdog33
  • Members
  • 31 messages
A couple of questions

1.I made a script similar to the silver sword of gith(motb version) that gains charges as you score hits. Is there a way to script the weapon so that it gains bonus item properties (ie increasing bonus str) as the weapon gains charges from hits without having to requip the weapon?

2. Is there a function to see how much damage you did on each attack with a weapon? Trying to make a vampiric regen property and wounding property that heals/damages based on damage done, not set.

3. trying to create a cast spell: unique power property that creates the darkness vfx but with custom effects. I got the effects down but no globe of darkness. The code i'm using atm for this is 
effect eDarkcloud = EffectVisualEffect(VFX_DUR_WEB);		
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eDarkcloud ,lTarget, RoundsToSeconds(20));

Modifié par mchotdog33, 25 octobre 2011 - 10:44 .


#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
To create the darkness VFX, you will probably want to use an NWN2 special effect file. These are different than the special effect constants in the scripting assistant. To browse them, you will want to get the PowerBar plugin from the NWVault. Install the plugin to your toolset (instructions on the vault) and then you will have an icon on the bar which will allow you to browse all the special effect files. There is one that is the globe of darkness effect. The name is probably something like "fx_darkness" or something like that.

Once you know the name use this code:

effect eDarkcloud = EffectNWN2SpeicalEffectFile("name of effect here");

#3
mchotdog33

mchotdog33
  • Members
  • 31 messages
Oh thanks, any ideas about the first 2 questions?

#4
mchotdog33

mchotdog33
  • Members
  • 31 messages
New Question... How do i stop my weapon from being destroyed after i set the charge of the weapon to 0 via script?

#5
Dann-J

Dann-J
  • Members
  • 3 161 messages

mchotdog33 wrote...

New Question... How do i stop my weapon from being destroyed after i set the charge of the weapon to 0 via script?


You could try giving it a token once-per-day ability (like a Light spell). Per-day charges won't destroy the item once they reach zero.

#6
mchotdog33

mchotdog33
  • Members
  • 31 messages
Problem is, trying to make the script work off a charge based since i want to be able to cast indefinitely per day. I sorta hacked it and made the base charge always be 1 and offset all values regarding it by 1. Would be interested to hear better alternatives though.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

mchotdog33 wrote...

Problem is, trying to make the script work off a charge based since i want to be able to cast indefinitely per day. I sorta hacked it and made the base charge always be 1 and offset all values regarding it by 1. Would be interested to hear better alternatives though.


Maybe if you set the plot tag to true on the weapon, it wouldn't be destroyed at 0 charges.

Modifié par M. Rieder, 25 octobre 2011 - 11:58 .


#8
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

mchotdog33 wrote...

Problem is, trying to make the script work off a charge based since i want to be able to cast indefinitely per day. I sorta hacked it and made the base charge always be 1 and offset all values regarding it by 1. Would be interested to hear better alternatives though.


If you want it to be able to cast something indefinately per day, set it to "Unlimited Uses" where you select how often it can be used.

#9
mchotdog33

mchotdog33
  • Members
  • 31 messages

_Knightmare_ wrote...

If you want it to be able to cast something indefinately per day, set it to "Unlimited Uses" where you select how often it can be used.



That's casting at will, which is not what i want. I want to cast a unpredetermined number of times per day limited by the number of charges that the weapon has. Charges are gained through hitting stuff with the weapon. Anyways my workaround seems to work. 

I'm more interested on how to get the amount of damage you did per weapon hit.

Modifié par mchotdog33, 26 octobre 2011 - 01:06 .


#10
Dann-J

Dann-J
  • Members
  • 3 161 messages
The Hammer of Ironfist has an ability that counts the number of hits it takes before you can reuse its Call Lightning ability. You could try looking for the script it uses in the official campaign modules. It uses numbers of hits rather than damage done though (probably for a good reason).

I'm not sure there is any way to determine how much damage it does with each hit from the weapon's side. You could try giving every creature in the module a customised OnDamaged script that feeds into a global variable. Modifying every single placed creature and spawnable blueprint would be a right royal pain though.

#11
MasterChanger

MasterChanger
  • Members
  • 686 messages

mchotdog33 wrote...

_Knightmare_ wrote...

If you want it to be able to cast something indefinately per day, set it to "Unlimited Uses" where you select how often it can be used.



That's casting at will, which is not what i want. I want to cast a unpredetermined number of times per day limited by the number of charges that the weapon has. Charges are gained through hitting stuff with the weapon. Anyways my workaround seems to work. 

I'm more interested on how to get the amount of damage you did per weapon hit.


I think what _KM_ was getting at was that in your OnActivated script, you can determine whether it's permissable for the user to use the item, and exit the script if not. Of course, if you've found a different way to do it, that's cool.

Retrieving the amount of damage that was done on a hit, or whether that hit was a critical, or anything pertaining to that attack, is rather difficult. There are functions to retrieve damage dealt by type but I'm pretty sure they don't work correctly or return usable information.

Really the only way that I know how you'd get at that information would be to have determined the attack roll and damage yourself ahead of time outside the engine. This sounds like a major undertaking, but Drammel's Tome of Battle has entirely rebuilt attack and damage rolls that you could use if you wanted to do this. I doubt it would be a perfect solution for your problem, though, sorry.

#12
mchotdog33

mchotdog33
  • Members
  • 31 messages
Ah i get what he's saying now. Question tho, can a item that doesn't use charges still accumulate charges? The amount of charges is integral to my custom cast script. It reads the amount of charges and then determines's the spell's effect as well as eating all the charges at once.

I sorta hard coded the damage part. Is there a way to find out the bonus damage on a weapon from feats and/or stats? like the flat bonus weapon damage and any extra buffs show on the character screen.

Modifié par mchotdog33, 26 octobre 2011 - 10:46 .