Setting weapon health using MWSE or otherwise?

Post » Thu May 31, 2012 9:15 am

I was messing around with TheLys' Resources Enhanced. I really like mining by attacking the ore with a miner's pick, but it would be nice if the pick's health decreased as you mined. Is there a way to do it? All I could see from the MWSE documentation is that there's a GetWeaponCondition function, but no ModWeaponCondition function.
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm

Post » Wed May 30, 2012 8:47 pm

I think you would need a NPC/creature as container to hit. A setparalysis 1 / skipanim invisible race NPC dressed with a rock mesh, or a minimal animation rock creature similar to some training dummy creature could do.
User avatar
Chris Ellis
 
Posts: 3447
Joined: Thu Jul 26, 2007 10:00 am

Post » Thu May 31, 2012 5:23 am

Something I don't remember and have no way to check without the game installed:

In the Construction Set, is it possible to create a weaponn with partial health? I.e., have it start with 75 out of 100 health, for example?

If so, you could create a set of miner's picks, each with a different amount of health, and swap the current weapon with a more damaged weapon periodically.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Thu May 31, 2012 7:44 am

In the Construction Set, is it possible to create a weaponn with partial health? I.e., have it start with 75 out of 100 health, for example?

Yes.
But only a reference : An object placed in the world, not in an inventory or container.
Example : The silver staff sold by Arrile

Inusable feature for scripting purpose...
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Thu May 31, 2012 12:27 am

A method I have used to track wear on an item (lock picks used in an unconventional way) is to check Random100 for a possible chance of breaking (for me 20 uses per pick therefore 5% chance of breaking). Then I removed the item with a message explaining it was broken. I like the realistic uncertainty of when the item will be worn out. If you prefer an absolute number of uses, then you could have a counter keep track of the number of uses and then 'break it'. The challenge would be in either case to know when the player is using the item. Perhaps you could check for the sound of the pick striking the rock when it is equipped by the player.
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Post » Thu May 31, 2012 9:12 am

Thanks everyone! I tried out both of these suggestions.

A method I have used to track wear on an item (lock picks used in an unconventional way) is to check Random100 for a possible chance of breaking (for me 20 uses per pick therefore 5% chance of breaking). Then I removed the item with a message explaining it was broken. I like the realistic uncertainty of when the item will be worn out. If you prefer an absolute number of uses, then you could have a counter keep track of the number of uses and then 'break it'. The challenge would be in either case to know when the player is using the item. Perhaps you could check for the sound of the pick striking the rock when it is equipped by the player.
The original script does indeed check for the sound of the weapon swing, so that part's been taken care of for me. Using the random counter, this method works well. The only thing I think it's missing is that you can't repair the pick after mining a bit.

I think you would need a NPC/creature as container to hit. A setparalysis 1 / skipanim invisible race NPC dressed with a rock mesh, or a minimal animation rock creature similar to some training dummy creature could do.
This seems like it would work really well. I modified the script to check for OnPCHitMe rather than the sound of the weapon swing, but for some reason after a random number of hits hits it now skips over to the end of the script where the rock is mined out and disappears (displays messagebox "There's nothing more to get from this rock" and then disables). The NPC will no longer provide random gems but it doesn't disappear after the first hit so I'm confused as to what happened. If you'd like to look at the scripts, here's the original one that worked for the rock as a container:

Nevermind, turns out I forgot to add any diamonds to the NPC's inventory :blush:. Now I've just got to adjust the models so they're not floating over the original rocks. This is a long shot, but is there a way to stop the bleeding texture from appearing?
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am

Post » Wed May 30, 2012 7:01 pm

This is a long shot, but is there a way to stop the bleeding texture from appearing?

You'd need to define a new blood texture in the [Blood] section of the .ini and assign it to the NPC/creature. You would need a new blood mesh and texture, but it just needs to be invisible, so maybe an editor marker would work.

Now, looking at the mod, it looks like the pick's health is supposed to decrease with a disintegrate weapon effect, but this effect doesn't seem to work on self.
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Thu May 31, 2012 6:50 am

Oh wow, why didn't I think of that? It seems like the disintegrate weapon effect is a bit buggy though (I think I had heard that was the case). It actually works as long as the weapon's health isn't full as far as I can tell. Heh, I'm not that great at Morrowind scripting yet, so it took me a lot of attempts just now before I could successfully remove the spell with a auxiliary script and stop that script from endlessly recurring.
User avatar
Juanita Hernandez
 
Posts: 3269
Joined: Sat Jan 06, 2007 10:36 am


Return to III - Morrowind