Jump to content

Playidle not working


Erenna

Recommended Posts

Ok, so I'm trying to start out making a combat overhaul for oblivion, simply because I feel that Unnecessary Violence isn't complete enough, and I don't like Deadly Reflex's gore. However, I've run into a bit of a snag. I'm trying to create code that will let me press the J key to trigger an animation, to see how it looks in-game, but it's not working. Here's my code.

 

scn ParryMagic
begin ScriptEffectStart
message "ParryMagic script enabled."
short mindex
ref PL
ref playervar
set PL to NewHtHparryL
set playervar to playerref
short played
set mindex to getmodindex Cyrodiilic_Combat
setdebugmode 1 mindex
end
begin GameMode
if OnKeyDown 36
	if played != 1
		message "Parry Animation Initialized"
		playervar.playidle PL 1
		set played to 1
	endif
	set played to 0
endif
end

 

This takes on the form of a passive ability, added at the beginning of an invisible starting quest. The ability adds properly, even the onkeydown part works properly. The, 'Animation initialized' message shows up but for some strange, strange reason the animation itself doesn't player. Any thoughts? Thanks.

Link to comment
Share on other sites

if magiceffect use

 

==

begin scripteffectupdate

==

 

And this command(playidle) works only for the view - the third person.

 

To animate the view from the first person need to give Idle objects.(And of course have the first person animation)

Edited by DKZZ2
Link to comment
Share on other sites

Nah, the 'If magiceffect use' thing isn't the problem. I'm seeing the, 'ParryMagic Script Enabled' message so the variables are being set. Also, changed the variable definitions to right after the scn portion, still not working. Here's my new code. Also? Yes, I am trying to animate this in third person... Hold on. Do I need a first person animation and an animation object to go with it, to get it to play even in the third person?

scn ParryMagic
short played
short mindex
ref PL
ref playervar
begin ScriptEffectStart
Message "ParryMagic script enabled."
set PL to NewHtHparryL
set mindex to GetModIndex Cyrodiilic_Combat
set playervar to PlayerRef
SetDebugMode 1 mindex

end
begin GameMode
if OnKeyDown 36
	if played != 1
		Message "Parry Animation Initialized"
		playervar.PlayIdle PL 1
		set played to 1
	endif
	set played to 0
endif
end

Edited by Erenna
Link to comment
Share on other sites

I discourage use of ScriptEffectUpdate, as you never know when it will update or if at all. GameMode is much more reliable for this purpose.

But have you tried using "player" instead of "PlayerRef" already? I've never seen "PlayerRef.PlayIdle" called that way, as far as I remember.

Link to comment
Share on other sites

1/Do not reinvent the wheel.

 

The structure of the script magical effect:

 

 

scn ParryMagic

 

float ttt

short played

short mindex

ref PL

ref playervar

 

begin scripteffectstart

Message "ParryMagic script enabled."

set PL to NewHtHparryL

set mindex to GetModIndex Cyrodiilic_Combat

set playervar to PlayerRef

SetDebugMode 1 mindex

set ttt to 0

end

 

begin scripteffectupdate

 

 

if (IsKeyPressed2 36)&&(ttt<=0);!!!!!!!!!!!!!!!!!!!!!!!!

if played != 1

Message "Parry Animation Initialized"

set playervar to Player ;(refresh refs)

set PL to NewHtHparryL

playervar.PlayIdle PL 1

set played to 1

set ttt to 3

endif

set played to 0

endif

 

 

if ttt>0

let ttt:=ttt-getsecondspassed

endif

end

 

2/ No

Edited by DKZZ2
Link to comment
Share on other sites

Fixed it. Apparently, I forgot to put, "Specialidle_" before the name in nifskope. Now, problem 2: When the animation finishes, the character's mesh spazzes out, momentarily moving off to the side while some lower parts stretch, and coming back standing at an odd angle. Any thoughts?

 

EDIT: Finally fixed. The spazzing animation was due to a lack of a return to the neutral position, and the crash was caused by empty frames. Thanks for all your help!

Edited by Erenna
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...