I'm just having a wee go at scripting for Oblivion and I'm finding some of the referencing difficult to figure out, and I've not been able to find anything online addressing this area of scripting.
Basically, I thought to give myself something straight forward-ish to work on I would attempt to do something with one of my pet annoyances - that every time I get into a fight I turn into a human pincushion with 10-30 arrows sticking out of me whether I'm in linens or plate. I started looking at some code online and I could see that there were 'blocks' starting with begin and end that are a bit like functions that get called when the game has a specific event such as someone being hit with a weapon. I saw that there was one that I could apply for each of the arrows available in the game and therefor cover all of them. I don't know how I'm going to get the reference to the arrows once I'm in that block but I'm just trying out one problem at a time. The issue is that I can't seem to get a block that applys to the player. I've been looking at some of the code in other people's mods and they seem to do things like adding a global quest which in turn adds what ever spells or equipment is to be used, so I took that approach. I can add a spell (ability) or an object to the player with a script attached but these scripts although allowing functions like 'beging OnHitWith Arrow1Iron' don't seem to be called when the player is actually hit.
It's occurred to me that perhaps I need to set the target of the script within the script itself somehow but I'm not sure.
http://www.2shared.com/file/F58Dds4G/pincussion.html