[REL] Morrowind Containers Animated

Post » Sat Sep 22, 2012 10:04 am

Why do you need unsmoothed version?
All textures are vanilla. One new texture added.
User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Post » Sat Sep 22, 2012 4:44 pm

I know not many people share my opinion but honestly i prefer the vanilla meshes over smoothed versions, they dont fit in my vanilla game. I guess I will need to learn how to export animations from max then. Thanks for vanilla textures!
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Sat Sep 22, 2012 5:34 am

There essentially already is one. Antares animated the vanilla meshes first, and then the smoothed ones. Either in this thread or the animated chests thread should be a download, you might be able to just replace the meshes.
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Sat Sep 22, 2012 6:00 am

Uhm... interesting, but there are couple things I don't understand in the scripts.
You are spawning for each container e.g.
if ( state == 0 )	set timer to ( timer + GetSecondsPassed )	if ( timer > 0.1 )		placeatme "AC_de_closet_02" 1 1111 1		set state to 1		set timer to 0	endifendif
an activator that just disables itself. e.g.
begin AC_chestdummydisableif ( cellchanged == 1 )	;setdelete 1endifend
What is ithe purpose of these disabled activators?

each script attached on the containers has a extra endif (automatic http://webpages.charter.net/manauser/morrowind/indenter.htm/http://mwedit.sourceforge.net/ may help finding these kind of errors that CS can't notice) e.g.
if ( locked == 1 )	if ( getlocked == 0 )		menutest		set locked to 2		elseif ( getlocked == 1 )		return	endifendif  ; extra endifendif
User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Sat Sep 22, 2012 4:42 pm

You are spawning for each container e.g. [code]if ( state == 0 )
placeatme "AC_de_closet_02" 1 1111 1

according to my tests, if the command "activate" is given to an animated container, the game crashes. Unless in that cell there is at least another item that uses the same animated mesh. :shrug:
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Sat Sep 22, 2012 11:30 am

if the command "activate" is given to an animated container, the game crashes. Unless in that cell there is at least another item that uses the same animated mesh. :shrug:
That is correct.
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Sat Sep 22, 2012 1:21 pm

according to my tests, if the command "activate" is given to an animated container, the game crashes. Unless in that cell there is at least another item that uses the same animated mesh. :shrug:
I see, weird... but weird things are not uncommon with this engine.
Worth investigating more though IMO, because the remedy seems more weird than the problem.
I think ensuring skipanim is executed from the frame where activate is called could fix the crash (at least, this is how it worked for me with animated chest containers in water life)., e.g. something like this
begin AC_comchest02scriptfloat timershort stateshort lockedif ( getlocked == 1 )    set locked to 1endifif ( locked == 1 )    if ( getlocked == 0 )        menutest 0        set locked to 2        elseif ( getlocked == 1 )        return    endif    ;endifendifif ( onActivate == 1 )    if ( getlocked == 0 )        if ( state == 0 )            Playgroup "idle2"            PlaySound3D "Chest open"            set state to 1        endif    endifendifif ( state == 1 )    set timer to ( timer + GetSecondsPassed )    if ( timer > 1.0 )        skipanim        activate        set state to 2    endif    returnendifif ( state == 2 )    skipanim    if ( Menumode )        return    endif    set state to 3    returnendifif ( state == 3 )    PlaySound3D "Chest Close"    Playgroup "idle3"    set timer to 0    set state to 0endifend
[EDIT]some more fixes
User avatar
JUDY FIGHTS
 
Posts: 3420
Joined: Fri Jun 23, 2006 4:25 am

Post » Sat Sep 22, 2012 3:17 pm

Animation stops working if I use skipanim. Does it happen in Water Life?
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am

Post » Sat Sep 22, 2012 8:43 pm

Animation stops working if I use skipanim. Does it happen in Water Life?
skipanim skips playing animation for 1 frame.
It may be your animations have something particulat crashing which chest animation I used do not have, but I don't think so.
I think reason of your crashing is calling activate while animation is still playing.
So you could use getsecondspassed tuned to let animation play until animation is nearly finished e.g. stop it 0.1 seconds before natural mesh animationgroup end), calling skipanim same frame as activate and after, until player exits dialog. The code snippet I posted here is not tested, but you get the idea.
For a working example, in water life I use this working code if this can help, i have commented start/end of relevant part
Spoiler
begin ab01wlcrChestScriptDontSaveObject; status varsshort statefloat myScaleshort cc;  temp varsshort i1short i2float x1float y1float x2float y2float x3float y3; timersfloat gspfloat t1float t2if ( state == -1 )	returnelseif ( state == 0 )	set state to 1	disable	set i1 to Random 10001; a little scale randomization	set myScale to GetScale	set myScale to ( ( ( i1 / 13000.0 ) + 0.9 ) * myScale )	SetScale myScale	returnelseif ( state == 1 )	set state to 2	; set ab01wlCreCount to ( ab01wlCreCount + 1 )	set y1 to ( player->GetLevel )	set y1 to ( y1 * 20 )	set x1 to ( player->GetLuck )	set x1 to ( 2.5 * x1 )	set i1 to Random 1001	set i1 to (  y1 - x1  - ( i1 / 5 ) + 250 )	if ( i1 > 900 )		Lock 90	elseif ( i1 > 800 )		Lock 80	elseif ( i1 > 700 )		Lock 70	elseif ( i1 > 600 )		Lock 60	elseif ( i1 > 500 )		Lock 50	elseif ( i1 > 400 )		Lock 40	elseif ( i1 > 300 )		Lock 30	elseif ( i1 > 200 )		Lock 20	elseif ( i1 > 100 )		Lock 10	endif	set x1 to GetPos Z	set myScale to GetScale	set x1 to ( ( 14 * ( myScale - 1 ) ) - 5 + x1 )	SetPos Z x1	enableif ( ab01debug == 2 )	MessageBox "chest scale set to %f" myScaleendif	return  endif ; stateif ( GetDisabled == 0 )	if ( CellChanged )		if ( ab01wlSkipSpawn )			set t2 to 0			disable			return		endif		if ( GetInterior )			if ( cc == 1 )				set t2 to 0				disable				return			endif			set cc to 2		else			if ( cc == 2 )				set t2 to 0				disable				return			endif			set cc to 1		endif	endif	if ( GetScale != myScale )		disable		SetScale myScale		enable;if ( ab01debug == 2 ); MessageBox "chest scale re-set to %f" myScale;endif		return	endifendif; start of relevant partset gsp to GetSecondsPassedif ( t1 > 0 )	if ( t1 >= 0.8 )		SkipAnim	else		set t1 to ( t1 + gsp )	endifendif	if ( OnActivate )	if ( t1 == 0 )		if ( GetLocked == 0 )			set t1 to 0.1			PlayGroup Idle2 1			PlaySound3DVP "Door Creaky Open" 0.9 0.9		else			activate		endif	elseif ( t1 >= 0.8 )		activate	endifendifif ( MenuMode )	returnendif; end  of relevant partif ( t2 < 6 )	set t2 to ( t2 + gsp )	returnendif	set t2 to Random 10001set t2 to ( t2 * 0.00005 )if ( GetDisabled )	set state to -1	setdelete 1	returnendifset i1 to 0set x1 to ( GetDistance player ); if ( x1 > 5300 ) ; reduced to try to avoid palace orphaned chestsif ( x1 > 5100 )	set i1 to 1endifif ( i1 == 1 )	set x1 to ( player->GetPos X )	set y1 to ( player->GetPos Y )	set y3 to ( player->GetAngle Z )	set x2 to GetPos X	set y2 to GetPos Y	set x2 to ( x2 - x1 )	set y2 to ( y2 - y1 )	if ( y2 >= 0 )		set x3 to y2	else		set x3 to ( 0 - y2 )	endif	if ( x3 < 0.00001 )		return	endif	set x3 to ( x2 / y2 )	if ( x2 > 0 )		if ( y2 > 0 )			if ( x3 > 1 )				if ( y3 < -45 )					set i1 to 0				endif			else				if ( y3 < -90 )					set i1 to 0				endif				if ( y3 > 135 )					set i1 to 0				endif			endif		else			if ( x3 < -1 )				if ( y3 < 0 )					if ( y3 > -135 )						set i1 to 0					endif				endif			else				if ( y3 < 45 )					if ( y3 > -90 )						set i1 to 0					endif				endif			endif		endif	else		if ( y2 > 0 )			if ( x3 < -1 )				if ( y3 > 45 )					set i1 to 0				endif			else				if ( y3 > 90 )					set i1 to 0				endif				if ( y3 < -135 )					set i1 to 0				endif			endif		else			if ( x3 > 1 )				if ( y3 > 0 )					if ( y3 < 135 )						set i1 to 0					endif				endif			else				 if ( y3 > -35 )					if ( y3 < 90 )						set i1 to 0					endif				endif			endif		endif	endif	if ( i1 == 0 );if ( ab01debug == 2 ); messagebox "chest player not in sight: disable";endif		set t2 to 0		disable	endifendifend
, you can test it with e.g. placeatpc ab01wlChest05 1 64 0
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Sat Sep 22, 2012 11:33 am

I was able to activate container without crashing but playing animation after it was activated still crashes the game.
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Sat Sep 22, 2012 3:44 pm

This is amazing! It add so much more realism to the game! Thank you! Will you be adding sound files for when the drawers are opened like how they are in Skyrim?
User avatar
x_JeNnY_x
 
Posts: 3493
Joined: Wed Jul 05, 2006 3:52 pm

Post » Sat Sep 22, 2012 6:50 am

Sounds maybe later...

Version 1.0!
User avatar
Robert Devlin
 
Posts: 3521
Joined: Mon Jul 23, 2007 2:19 pm

Post » Sat Sep 22, 2012 4:40 pm

Excellent mod, thanks so much!
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Sat Sep 22, 2012 7:37 pm

I was able to activate container without crashing but playing animation after it was activated still crashes the game.
After being able to test the mod, I can confirm the second animation crashes no matter what without the second mesh. I would like to know why a second mesh can avoid the crashing, but I don't think this is something easy to understand.
Anyway, as spawning the activator seems to work but may cause savegame cluttering, I think that spawning and deleting the activator just in time would be a better approach. I have tried this code with 1 chest type and it seems to work.
Spoiler

begin AC_chestdummy; AC_dummy is a global short variableif ( GetDisabled )	if ( AC_dummy == 0 )		setdelete 1	endif	returnendifdisableend
begin AC_comchest02scriptfloat timershort stateshort lockedif ( getlocked == 1 )	set locked to 1endifif ( locked == 1 )	if ( getlocked )		return	endif	menutest 0	set locked to 2	endifif ( onActivate == 1 )	if ( getlocked == 0 )		if ( AC_dummy == 0 )			set AC_dummy to 1			placeatme "AC_com_chest_02" 1 1111 1			Playgroup "idle2"			PlaySound3D "Chest open"			set state to 2		endif	endifendifif ( state == 2 )	set timer to ( timer + GetSecondsPassed )	if ( timer > 1.0 )		activate		set timer to 0	endif	if ( menumode == 1 )		set state to 3	endif	returnendifif ( state == 3 )	if ( menumode == 0 )		PlaySound3D "Chest Close"		Playgroup "idle3"		set state to 4	endif	returnendifif ( state == 4 )	set timer to ( timer + GetSecondsPassed )	if ( timer > 2 )		set timer to 0		set AC_dummy to 0		set state to 0	endifendifend
Mod is very interesting and well done, but I'd feel more comfortable without those "magic mystery" activators saved
[edit]Ah, I've just seen you skipped the closing animation in last version, so this snippet is probably no more of use
[edit2]typos
User avatar
evelina c
 
Posts: 3377
Joined: Tue Dec 19, 2006 4:28 pm

Post » Sat Sep 22, 2012 7:37 pm

Using "setdelete 1" in dummy script leads to crashes when player puts items inside containers or when talking to traders.
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Sat Sep 22, 2012 12:15 pm

setdelete crashes my game if I use it in the console. I am not surprised it does so in a script, but I have no helpful insight as to why. I can only commiserate.
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Sat Sep 22, 2012 1:18 pm

Using "setdelete 1" in dummy script leads to crashes when player puts items inside containers or when talking to traders.
Oh, a pity. I'd love to understand why, but mod is still fine and atmospheric without closing animation :goodjob:
User avatar
Karl harris
 
Posts: 3423
Joined: Thu May 17, 2007 3:17 pm

Post » Sat Sep 22, 2012 1:48 pm

There is closing animation. Containers stay open until player activates them again.
User avatar
Blessed DIVA
 
Posts: 3408
Joined: Thu Jul 13, 2006 12:09 am

Post » Sat Sep 22, 2012 3:33 pm

There is closing animation. Containers stay open until player activates them again.
Nice! but last version is now crashing for me (new game, enter Arrille tradehouse, open couple com_basket_o1_ingred to the left, talk to Arrille, sell something, exit, crash). Doing the same things with 0.9 was working though
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Sat Sep 22, 2012 9:01 pm

Somebody re-introduced the old bug. :D At least you know how to fix it! I'll pick up the next upload, tomorrow.
User avatar
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Previous

Return to III - Morrowind