Scripting Direction

Post » Mon May 02, 2011 2:11 am

I was looking for a specific mod to perform a specific task, but as I have not been able to find it I have decided to try creating it myself. I’m unfamiliar with the Morrowind CS so I’m hoping some kind person can spin me around and point me in the right direction.

I would like to create a script that, when the player is over encumbered, adds a few points of feather but damages Speed and Agility by one point each, but if one is at zero the other drops by 2 (just as a starting point, the exact numbers will come from playtesting). This process repeats until either the player is no longer over encumbered or Speed and Agility are both at zero. I figured I could create a simple loop to accomplish this, but I haven’t figured out how to undo this once the player starts dropping items. Maybe have the effect last only for a short time and then recalculate the magnitudes?
User avatar
Queen Bitch
 
Posts: 3312
Joined: Fri Dec 15, 2006 2:43 pm

Post » Sun May 01, 2011 10:03 pm

The problem with scripts like this is that there is no way to tell the base value of an attribute. When you use getSpeed and getAgility, it will report the number that you can see in your stats menu. Now, whether that number is in fact your base stat, drained, or fortified- a script cannot tell. So your enchanted robe of awesome that has a constant effect fortify agility 50 points will cause the script to think that your Agility is actually 50 points higher than what it should be.

Another complication would be that there is no function for getting the player's encumbrance. That kind of puts a damper on your situation right there.
User avatar
Chrissie Pillinger
 
Posts: 3464
Joined: Fri Jun 16, 2006 3:26 am

Post » Mon May 02, 2011 3:15 am

Another complication would be that there is no function for getting the player's encumbrance. That kind of puts a damper on your situation right there.

I am fairly sure a script extender had one somewhere. MWE probably.
User avatar
Louise Lowe
 
Posts: 3262
Joined: Fri Jul 28, 2006 9:08 am

Post » Sun May 01, 2011 4:17 pm

Oh yea.. I was typing that response and I thought of the fact that maybe MWSE or MWE had that.. but then I forgot about adding it before I posted. Hehe. But yea, the script extenders might have it.
User avatar
Emily Graham
 
Posts: 3447
Joined: Sat Jul 22, 2006 11:34 am

Post » Sun May 01, 2011 9:57 pm

Thanks for the replys.

So the one issue is that, in theory, the player can pickup a bunch of stuff and become over encumbered. They then strap on the Boots of Blinding Speed and they can now be on thier merry way with the breakneck speed of 20. Well I'd hate be the guy to introduce some sort of exploitable game mechanic to Morrowind, but I think I could live with how that works. I suppose if someone really didn't want to be over encumbered they could fortify strength anyway.

I'll take a look at MWSE, it seems like the kind of thing that a script extender would add. It does seem odd that it's not in there to begin with, so much happens when you become overencumbered it seems that somehow a script should be able to check for it.
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Sun May 01, 2011 6:43 pm

if you don't find any scripts checking for overencumbering, you may also check if any walk-key is pressed (with MWSE) but the player doesn't move anymore.
User avatar
Francesca
 
Posts: 3485
Joined: Thu Jun 22, 2006 5:26 pm


Return to III - Morrowind