Controlling animations via script

Post » Sat Dec 01, 2012 12:56 am

Hello,

if someone could help me, it would be greatly appreciated.

I made an interior-window for the Skyrim-Mod (SHOTN) for Morrowind. which features 8 animation-groups to react to different weather circumstances outside. (the snow and rain is actually only needed so I can reuse the same script for a chimney to let snow and rain drop in at the respective weather)

Idle2: Dusk
Idle3: Night/Rain
Idle4: Night/Snow
Idle5: Day/Rain
Idle6: Day/Snow
Idle7: Day/Otherwise
Idle8: Night/Otherwise
Idle9: Dawn

The animation-textkeys are placed as follows, I'm sorry they are a little bit mixed up in order:
1/Idle9: Start
299/Idle9: Loop Start/Idle9: Loop Stop/Idle9: Stop
300/Idle2: Start/Idle7: Start/Idle7: Loop Start/Idle7: Loop Stop/Idle7: Stop
599/Idle2: Loop Start/Idle2: Loop Stop/Idle2: Stop
600/Idle3: Start/Idle3: Loop Start/Idle8: Start/Idle8: Loop Start/Idle8: Loop Stop/Idle8: Stop
649/Idle3: Loop Stop/Idle3: Stop
650/Idle4: Start/Idle4: Loop Start
699/Idle4: Loop Stop/Idle4: Stop
750/Idle5: Start/Idle5: Loop Start
799/Idle5: Loop Stop/Idle5: Stop
800/Idle6: Start/Idle6: Loop Start
849/Idle6: Loop Stop/Idle6: Stop

For general clarification: The dawn- and the dusk-animation contains a transition between day and night to make light fade to dark, or the other way around.

And this is the script I'm using:

Begin Sky_DayLight_Interior

short ran
short daytime
short daytimebefore

if ( MenuMode == 0 )
set ran to random 100

if (ran < 5);5% chance of changing something
if ( GameHour >= 20 )
set daytime to -1; night
elseif ( GameHour >= 19 )
set daytime to -2; evening
elseif ( GameHour >= 8 )
set daytime to 1; day
elseif ( GameHour >= 7 )
set daytime to 2; morning
else
set daytime to -1; night
endif


if ( daytime == 2 )
if ( daytimebefore != 2 )
PlayGroup, Idle9; dawn
endif
elseif ( daytime == -2 )
if ( daytimebefore != -2 )
PlayGroup, Idle2, 0; dusk
endif
elseif ( daytime == 1 )
if ( GetCurrentWeather == 8 )
PlayGroup, Idle6, 0; day, snow
elseif ( GetCurrentWeather >= 4 )
PlayGroup, Idle5, 0; day, rain
else
PlayGroup, Idle7, 0; day, clear
endif
else
if ( GetCurrentWeather == 8 )
PlayGroup, Idle4, 0; night, snow
elseif ( GetCurrentWeather >= 4 )
PlayGroup, Idle3, 0; night, rain
else
PlayGroup, Idle8, 0; night, usual
endif
endif

set daytimebefore to daytime ; change the prior daytime to match the current one
endif
endif


End Sky_DayLight_Interior


And now I have the following two problems:
1. The script seems to make every animation group play accordingly, only Idle9 (Dawn) won't play around 7:00+ as supposed, whereas Idle2 (Dusk) works just fine around 19:00+. I have checked if Idle9 shows up in the animation-window of the object and it does. According to http://www.preik.net/morrowind/animationgroups.html Idle9 should be a valid animation group. I had the same problem when the Dawn-Animation was still called "Idle". I changed it to Idle9, hoping that it would help which it didn't.

Does anybody see a logic error in the script or is there some limitation I don't know of? Is there a limited amount of animation groups a script can control?

2. I don't know how to animate the emissive color of the material. It seems that blender only exports the animated diffuse color. Does someone know how to animate the emissive color of a material in Nifskope?
User avatar
luke trodden
 
Posts: 3445
Joined: Sun Jun 24, 2007 12:48 am

Return to III - Morrowind