llde / xOBSE

Oblivion Script extender source
250 stars 36 forks source link

C2 Special Combat Moves #197

Open skiaslu opened 1 year ago

skiaslu commented 1 year ago

Hey, good work there. I'd like to report what looks to be an issue between xOBSE and the mod C2 Special Combat Moves. When using the moves "Mugetsu Bloodmess" or "Izayoi Moonflower" there's meant to be a short sequence of the player character unleashing a flurry of strikes on the target, but when using xOBSE no attacks play out and you just stand there in place.

Note that the problem starts with xOBSE 22.2, everything works as intended when using version 22.1 or earlier.

llde commented 1 year ago

thanks for the report. Can you provide the exact instructions to reproduce?

skiaslu commented 1 year ago

Use the Misc. Item in the player's inventory to open a menu, click Power Attacks, and pick out Izayoi Moonflower from the list. This will add a Lesser Power that's scripted so that upon using it the player has a short period of time to hit the enemy with a power attack in order for the move to work. A small scene will play out with player controls turned off. If everything works as intended there should be a flurry of sped up punches or weapon strikes, but for me with the latest xOBSE that part has the character standing still, sped up but in his idle animation with his fists up or weapon drawn.

llde commented 1 year ago

Hi @skiaslu , I did test C2 both Izayoi Moonflower and Mugetsu Bloodmess and I think they work as intended following your description. Can you check wethever one of the latest Artifacts from here works to you. Do you per chance use the japanese patch?

kuroko137 commented 1 year ago

Hi. I tried it myself because I was curious. It seems that the scripts for "Mugetsu Bloodmess" and "Izayoi Moonflower" (zzzZMugetsuFC, zzzZIzayoiFC) achieve the continuous attack effect by using the "TapKey" command to press the button obtained with the "GetControl 4" command. The actual code looks like this:

set Btn to GetControl 4
---
TapKey Btn

However, if you have not assigned the attack key to any keyboard key, the GetControl command cannot obtain the key code of the mouse button, and the returned key code will be 255, so this effect will not work correctly (The author need to use the GetAltControl2 command in addition to GetControl). This means that it is not a bug in xOBSE, but rather a problem with the method of obtaining key codes in the mod. However, for some reason, in xOBSE22.1 and earlier versions, the attack key seems to be pressed with "TapKey 255". Note that in my case, whether or not to use the unofficial Japanese patch was irrelevant.

Anyway, if you want to use these powers of the mod in xOBSE22.2 or later, it would be a good idea to assign some keyboard key to the attack key in the in-game settings.

llde commented 1 year ago

you are right: old code had this if(keycode%256==255&&keycode<2048) keycode=255+(keycode+1)/256; where basically if keycode have the form k 255 then it's assigned as 255 + (k 255 + 1) /256 So it's roundable to 255 + k (where if code is exactly 255 k is 1 and the new result is 256)

This is horrible. I'm not even sure why that was added, it doesn't make any sense