Player->HitOnMe

Post » Fri May 27, 2011 6:31 pm

I have some problems with a script to detect if the player was hit. I use this code in a script that lies on the oponent with the glass dagger:

if ( "Player"->HitOnMe, "glass dagger" == 1 )
MessageBox "Hit"
endif


Is this function buggy or what du I have to do different that a hit is detected?
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Fri May 27, 2011 10:36 am

I have some problems with a script to detect if the player was hit. I use this code in a script that lies on the oponent with the glass dagger:

if ( "Player"->HitOnMe, "glass dagger" == 1 )
MessageBox "Hit"
endif


Is this function buggy or what du I have to do different that a hit is detected?


As far as I am aware this function is to detect if the player hits xxxx with a certain weapon and not the way round you are doing it.
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Fri May 27, 2011 8:58 pm

As far as I am aware this function is to detect if the player hits xxxx with a certain weapon and not the way round you are doing it.


I thought the same thing when I saw this thread, but not according to the uesp wiki...

For example, player->HitOnMe, "chitin dagger" will return 1 if the player is hit by a chitin dagger.


Here's the http://www.uesp.net/wiki/Tes3Mod:HitOnMe .
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am

Post » Fri May 27, 2011 2:53 pm

From MSFD v9.

HitOnMe, "Weapon ID" (returns Boolean/short)
HitAttemptOnMe, "Weapon ID" (returns Boolean/short)

These functions return true (1) for 1 frame if the calling Actor is successfully hit or if it was
attempted to hit it with a specified weapon. HitOnMe is used only in the LorkhanHeart script
(only look at that if you have finished the game or don't mind severe spoilers). I guess it could
be a nice function to script any kind of fight of the "you need this special weapon to kill this
particular monster" type.


It might be an issue with the fix.. MSFD doesn't say it's nofix, so I don't know. Try it on a test actor- attach a similar script to him and then hit him and see if it works.
User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Fri May 27, 2011 6:25 pm

Thank you for your answers.

I knew both entries in UESP and MW-SfD. I also tested to hit an actor with a weapon. This is registered without problem.

Seems that it only doesn't work for the player. :(
User avatar
Gill Mackin
 
Posts: 3384
Joined: Sat Dec 16, 2006 9:58 pm


Return to III - Morrowind