Jump to content

Animation Help


Highsight

Recommended Posts

I am completely flying blind when it comes to animation work. My newest mod Active Wasteland requires animation work for some of the items I am trying to get working. For one thing, I am trying to get the Grinding Wheel to animate when it is activated. I succeeded in this, but the problem is, when its use is over, I can't figure out how to end the animation. I used PlayGroup Forward 1 to get it started, but have NO idea how to stop it. I tired PlayGroup Idle 1, but it just kept animating. Anyone know? :/
Link to comment
Share on other sites

You need a group for each action, IE:

Forward: Spin

Backward: Stop

 

Like a single door has:

Open

Close

 

The PlayGroup command will look in the nif for an animation with the named passed to the command. If the mesh only has one animation "Forward", then that's all it can do. PlayGroup Backward will have no effect.

 

You could get even fancier with:

Idle: No Spin

Forward: Spin Up

Left: Spin Full Speed

Backward: Spin Down

 

"Idle" is a standard that will play automatically. Then you would do a "PlayGroup Forward" to spin it up, then "PlayGroup Left" would be spinning at max RPM and finally "PlayGroup Backward" to slow it down to a stop where Idle can take back over.

 

Edit:

Artorp Object Animation Tutorial

 

Edit2:

Or:

Idle: No Spin

Forward: Spin

Edited by Ez0n3
Link to comment
Share on other sites

I see! This has been very helpful, but now I wonder, how could I discover what animations are already on an object?

 

Edit: Scratch that, got NifSkope, works great! But this particular one only has the one animation. How can I have it animate for a while, but then stop it if it doesn't have an Idle animation?

Edited by Highsight
Link to comment
Share on other sites

I believe there are two types of animations, Loop and Clamp. Loop will play for X amount of seconds and start over while Clamp will play for X amount of seconds and stop (kind of "lock up" on the last frame). I forget where that is in nifskope (think in the same entry with the name "Forward, etc."), but ya - you could have it spin for a set time and then lock up using only clamped "Forward" then. Forgot about that ;)

 

Edit:

If the object is an activator, you can Preview it in the GECK and its animation(s) will be listed and playable on the lower left.

Edited by Ez0n3
Link to comment
Share on other sites

It depends on the behavior you want.

 

If it's off and then when it is activated, it spins for X amount of seconds and then stops again automatically. Then you can set it to clamp and hit it with a PlayGroup Forward where "Forward" is say a 10 second anim of the wheel spinning.

Forward: Clamp

 

Or, it's off and then when activated it turns on and stays on until it's turned off again, then you would need two anims. One that is stopped and one that is spinning:

Forward: Loop

Idle: Clamp

 

Where "Idle" is a one frame clamped anim (still) and "Forward" is a 1 second or so looped anim (one full rotation that will repeat). Then you hit it with a PlayGroup Forward and it will spin until it's hit with a PlayGroup Idle.

Edited by Ez0n3
Link to comment
Share on other sites

Here, let me show you the code:

 

scn GrindingWheelActivatorScript

float Timer
short Grinding

begin OnActivate
if player.IsWeaponInList GrindingWheelRepairList == 1
	if player.GetWeaponHealthPerc != 100
		if player.GetAV Repair >= 50
			PlayGroup Forward 2
			player.PlayIdle NVGrindingWheelMachete
			set Timer to 0.1
			set Grinding to 1
		else
			ShowMessage GrindingWheelReqFailMSG
		endif
	else
		ShowMessage GrindingWheelCondFailMSG
	endif
else
	ShowMessage GrindingWheelWepFailMSG
endif
end

begin GameMode
if (Grinding == 1)
	if (Timer > 0)
		set Timer to ( Timer - GetSecondsPassed )
	else
		player.ModWeaponHealthPerc 0.5
		if player.GetWeaponHealthPerc != 100
			set Timer to 0.1
		else
			ShowMessage GrindingWheelUseMSG
			PlayGroup Backward 2
			set Grinding to 0
		endif
	endif
endif
end

 

Right where PlayGroup Backward 2 is, I need it to stop. The only animation that seems to exist for that object is Forward, and it is set to loop, not to clamp. So you're saying the ONLY way to make it stop animating is to add a new animation such as idle, make and make it clamp after 1 rotation of Forward? I'd like to avoid that if I could, so I don't have to include that in the file. :/

Link to comment
Share on other sites

Oh, I thought you were trying to make some custom grinding thing with your own animations. The only way to add new anims to be use via PlayGroup is to edit the nif (afaik).

 

I think scripts will still run on disabled refs, so I would just add two of the objects to the cell. One that is never on and one that is always on, then just toggle between them. Your main one with the script would probably be "off". Then make a dummy activator (no script, just spins) with the same mesh which is the linked ref of the main. Then add something like this to your script:

int bInit
ref rLinkedRef
Begin OnLoad
if (bInit == 0)
	set rLinkedRef to GetLinkedRef ; the dummy
	rLinkedRef.PlayGroup Forward 1
	rLinkedRef.Disable 0 ; might need a delay before disabling
	set bInit to 1
endif
End

Then replace your "PlayGroup Forward 2" with:

Disable 0 ; disable myself
rLinkedRef.Enable 0 ; enable spinning dummy

And replace "PlayGroup Backward 2" with:

Enable 0 ; enable myself
rLinkedRef.Disable 0 ; disable spinning dummy

Edited by Ez0n3
Link to comment
Share on other sites

  • Recently Browsing   0 members

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