Locational Damage Script Available?

Post » Sun May 27, 2012 1:09 am

OOOOoooh! So this script could easily be conditionalized to not operate on power attacks, and you could do a locational damage mod where one of the benefits of power attacks is consistent damage rather than variable. Cool cool.
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Sun May 27, 2012 1:52 am

Although the concept works, I don't think I can implement it. It's been years since I've taken a math class, and I've not needed to use anything beyond trigonometry. I've forgotten almost everything beyond that.

To figure out the point of impact, we would need to figure out the intersection point between our vector (given by DeltaX, DeltaY, and DeltaZ in the script) and the plane representing the victim. For the simple case of the victim standing up straight, he/she can be represented by a plane with a normal vector that's just his/her Z rotation.

I tried reading the wiki article on http://en.wikipedia.org/wiki/Line-plane_intersection but it looks like gibberish to me.
User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm

Post » Sun May 27, 2012 2:13 pm

I don't think we need to do that luckily. Now that we have the vector from our earlier experiment, we can make three linked lists of global floats that represent, lets say, the XYZ coordinates of four points along the vector going from the finger node to the WeaponTip node. The script that manages keeping activators in place at certain nodes on the body can then have an OnUpdate event that iterates through all three of these lists to fetch the XYZ coordinates one at a time and take that point and compare it with the the location of all the nodes to get a CurrentDistance. Then there is a variable called ShortestDistance that gets changed every time CurrentDistance < ShortestDistance. The same if statement that handles this also memorizes which body node was involved. Once it has iterated through every weapon node/ body node combination it will return the correct body node, at which point you can do what you will with that information.
User avatar
Iain Lamb
 
Posts: 3453
Joined: Sat May 19, 2007 4:47 am

Post » Sun May 27, 2012 7:35 am

Well, searching through the internet, I've found out how to determine the intersection point of a vector and a plane. However, it wouldn't work, and it took me a while to find out why.

I was wrong before when I said the method of extending a line from the nodes work. I did another test, this time creating three nodes. One node (the light projectile) is placed at the attacker's wrist node. The second node (paralyze projectile), is placed 128 units from the wrist node, in the direction of the wrist node towards the finger node. The third node (fireball projectile) is placed 256 units from the wrist node, in the same direction.

http://youtu.be/FOn6yCGVVS0

As you can see, the line created by the three nodes is not the same as the position of the weapon at time of impact. I have tried with a couple of different nodes, including the weapon node. There are some changes in trajectory, but the end result is still that the line is not the same as the weapon's position.

The positions of the nodes seem to be static and unmoving when the attack takes place. As in, when I place the light projectile at the attacker's hand during the OnHit event, it's actually placed where the hand was after the weapon is raised, but before it is swung. It appears that the attack animation doesn't actually move the skeleton.
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Sun May 27, 2012 7:13 am

It looks like its working fine to me, it just looks wonky because the activators are really far apart. Try using five activators at points at fractions of the weapons length, rather than just extending the vector by a static amount. I think the conversion from units to feet is approximately 22, so if the reach is 100 you shoue have about 4.8 feet or so I think.
User avatar
Alexis Estrada
 
Posts: 3507
Joined: Tue Aug 29, 2006 6:22 pm

Post » Sun May 27, 2012 7:58 am

If it was really working as it should, then the line formed by the activators should be going through, or at least touching the dummy. But instead, the closest that any of the lines get is about 2 feet.
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Sun May 27, 2012 6:29 am

Hmm, when does "OnHit" actually take places? Is it exactly when then weapon strikes the target?
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Sun May 27, 2012 3:53 pm

Just checking to see if there have been any new successes! :-D
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Previous

Return to V - Skyrim