SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SHIII Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=195)
-   -   THE Ultimate Animation of Crew Thread (https://www.subsim.com/radioroom/showthread.php?t=176928)

DivingDuck 04-18-11 02:45 AM

Moin Hans,

Make sure the files are all placed in the correct folder.

Interior.dat >>> goes without saying
Animation.dat >>> LIBRARY folder
Animation.anm >>> ANIMATIONS folder


Next, the SH engine is very strict regarding naming conventions.

The SMC entry in your Interior.dat contains the SMC Controller that defines the 'GraphName'. Letīs say 'Hans_Graph'. The game engine is now checking the LIBRARY folderīs *.dat files for a SMC named 'Hans_Graph'.

The 'Hans_Graph' SMC defines the events your animation is triggered by and holds the name(s) of the animation(s) to play. Letīs say 'Hans_Dance'. Once the condition to run the animation is met, the game engine checks the ANIMATIONS folderīs *.anm files for an 'AnimName' named 'Hans_Dance'. This 'Hans_Dance' contains one or more sub items containing another 'AnimName' entry. Letīs call it 'Hans_Limbs'.

When 'Hans_Dance' is called by 'Hans_Graph', the correlated MAD will be linked to 'Hans_Limbs' and the game engine will check the Interior.dat for any 3d_model by the name of '<Hans_Limbs>'. The brackets are vital! If '<Hans_Limbs>' is found, the animation will play.



How to create this setup?
  1. Import the animation to your Interior.dat
  2. cut the MAD (<notset> (10/05) + child node)
  3. paste it into your newly created 'Hans_Animation.anm' just behind an 'AnimationObject' node
  4. create needed entries and links for the 'AnimationObject'

http://i182.photobucket.com/albums/x...mation_001.jpg



Next, your SMC has to be built. For testing reasons it is advisable to use a setup that will call the animation on load with no conditions to be met. Thus you ensure the animation is imported correctly at last.

As for your SMC, it will not work this way. When your condition 'true' is met, the pointer is directed to entry #1, but there is none. Hence the animation will play once only or not at all. Donīt know how the game engine handles this "error".

'GotoEntry=0' should do the trick. But I strongly recommend to use a more advanced setup, even for an ever-looping basic test.


Use 4 StateEntries for a start:
  • Start (entry 0)
    • as you did, condition 'true' will be met on start up
    • points towards entry #1 (Idle)

  • Idle (entry 1)
    • define conditions to trigger the animation
    • points towards entry #2 (Animation)

  • Animation (entry 2)
    • define conditions to stop the animation here (GotoEntry #3 (Stop))
    • define conditions to change the animation here (GotoEntry #??)
    • if no interfering condition is met loop to entry #2 (Animation)

  • Stop (entry 3)
    • stop (all) animation(s)
    • point back to entry #1 (Idle)




[EDIT]
Moin UFi,

but donīt tell my wife. ;)
[/EDIT]


Regards,
DD

Hans Witteman 04-18-11 03:17 AM

Quote:

Originally Posted by DivingDuck (Post 1645495)
Moin Hans,

Make sure the files are all placed in the correct folder.

Interior.dat >>> goes without saying
Animation.dat >>> LIBRARY folder
Animation.anm >>> ANIMATIONS folder


Next, the SH engine is very strict regarding naming conventions.

The SMC entry in your Interior.dat contains the SMC Controller that defines the 'GraphName'. Letīs say 'Hans_Graph'. The game engine is now checking the LIBRARY folderīs *.dat files for a SMC named 'Hans_Graph'.

The 'Hans_Graph' SMC defines the events your animation is triggered by and holds the name(s) of the animation(s) to play. Letīs say 'Hans_Dance'. Once the condition to run the animation is met, the game engine checks the ANIMATIONS folderīs *.anm files for an 'AnimName' named 'Hans_Dance'. This 'Hans_Dance' contains one or more sub items containing another 'AnimName' entry. Letīs call it 'Hans_Limbs'.

When 'Hans_Dance' is called by 'Hans_Graph', the correlated MAD will be linked to 'Hans_Limbs' and the game engine will check the Interior.dat for any 3d_model by the name of '<Hans_Limbs>'. The brackets are vital! If '<Hans_Limbs>' is found, the animation will play.



How to create this setup?
  1. Import the animation to your Interior.dat
  2. cut the MAD (<notset> (10/05) + child node)
  3. paste it into your newly created 'Hans_Animation.anm' just behind an 'AnimationObject' node
  4. create needed entries and links for the 'AnimationObject'





Next, your SMC has to be built. For testing reasons it is advisable to use a setup that will call the animation on load with no conditions to be met. Thus you ensure the animation is imported correctly at last.

As for your SMC, it will not work this way. When your condition 'true' is met, the pointer is directed to entry #1, but there is none. Hence the animation will play once only or not at all. Donīt know how the game engine handles this "error".

'GotoEntry=0' should do the trick. But I strongly recommend to use a more advanced setup, even for an ever-looping basic test.


Use 4 StateEntries for a start:
  • Start (entry 0)
    • as you did, condition 'true' will be met on start up
    • points towards entry #1 (Idle)
  • Idle (entry 1)
    • define conditions to trigger the animation
    • points towards entry #2 (Animation)
  • Animation (entry 2)
    • define conditions to stop the animation here (GotoEntry #3 (Stop))
    • define conditions to change the animation here (GotoEntry #??)
    • if no interfering condition is met loop to entry #2 (Animation)
  • Stop (entry 3)
    • stop (all) animation(s)
    • point back to entry #1 (Idle)




[EDIT]
Moin UFi,

but donīt tell my wife. ;)
[/EDIT]


Regards,
DD

Hi DD,

Fantastic answer and food for my brain:up:

Will test that further on this afternoon because i must go to sleep soon i test all sort of stuff all night long and now i am exhausted.

Only one thing i still don't understand maybe you already have explain in this post so i apologize if it the case but how do you save your .anim in animation folder?

And if i understand correctly i don't need MAD in CR.dat with this method?

Best regards Hans

Hans Witteman 04-18-11 03:34 AM

Message to DD
 
Hi DD,

Check your pm mate:up:

I am going to have some rest now:salute:

Best regards Hans

DivingDuck 04-18-11 03:49 AM

Hi Hans,
Quote:

Originally Posted by Hans Witteman (Post 1645502)
Hi DD,
...

Only one thing i still don't understand maybe you already have explain in this post so i apologize if it the case but how do you save your .anim in animation folder?

And if i understand correctly i don't need MAD in CR.dat with this method?

Best regards Hans

the file that goes to the ANIMATIONS folder is basically nothing else than a *.dat file. But it has to be saved using the *.anm extension. I hope that was the answer you were seeking for.

And yes, the MAD must be cut from the CR.dat. This is necessary to be able to call different animations for the same base mesh, depending on SMC entries. If you donīt cut the MAD from the *.dat, the animation will loop endlessly and will not respond to SMC. Or it may even not show up at all. Didnīt check that until now.

Regards,
DD

Hans Witteman 04-18-11 04:02 AM

Quote:

Originally Posted by DivingDuck (Post 1645508)
Hi Hans,

the file that goes to the ANIMATIONS folder is basically nothing else than a *.dat file. But it has to be saved using the *.anm extension. I hope that was the answer you were seeking for.

Regards,
DD

Hi DD,

Yes that what i though but when you save it do you deleted afterward un neccessary nodes?

And do i have to change the windows in S3d that ask to keep same headers?

What i did for this one was to import my animation on water plane temporarily and i did a simple copy paste of noset+meshanimationdata.

After i created a new data file and append a AnimationObject controller and then paste my noset+meshanimationdata and link it as child of AnimationObjec.

Is this procedure sound good to you?

Many thank

Best regards Hans

DivingDuck 04-18-11 04:10 AM

The procedure itself sounds okay to my ears. But the devil is in the detail.

You should make a habit of deleting unneeded nodes or at least changing their IDs as they might cause ID conflicts and hence CTD.

When you copy and paste anything, always change the IDs to be unique. Otherwise they will cause problems that are exceptionally hard to track down or even CTD.

As for the S3D headers, I donīt know. I still use the hex editor very often. So, Iīve never seen a dialogue asking to keep headers or something similar. At least I donīt recall it.

After youīve copied and pasted the <notset> (10/05) node + itīs child MAD, youīll have to adjust the 'AnimationObject' entries to "find" that new node! See the pic Iīve posted last. That should be it.

DD

PS: Get some rest now! ;)

Anvart 04-18-11 04:47 AM

Quote:

Originally Posted by Hans Witteman (Post 1645415)
Hi shipmates,

I did some new test on saving as .anim file, what i did is i export as raw data the meshanimationdata and import it back in .anim. file and deleted the 3d model node leaving only the noset +meshanimationdata and re link it to parent AnimationObject.

And it is still not working so i think it could be 2 main reasons, first the way i saved .anim file and second the way i build the statemachines class, so far i did only 1 states entries just to test animation trigger in game can you tell me what is wrong with this SMC :
...
Best regards Hans

:woot:
First you have choose the method that you want to use for your Flooding... or method which i described (IIRC) in 2009 ... or standard StatemachineWrapper ... or mixed method ...
If you have a simple animation i recommend standard StateMachineWrapper ...
... If i understand correctly DD proposes to use the first method ...
I find it hard to understand the nuances of your conversation ...

Hans Witteman 04-18-11 02:07 PM

Quote:

Originally Posted by Anvart (Post 1645537)
:woot:
First you have choose the method that you want to use for your Flooding... or method which i described (IIRC) in 2009 ... or standard StatemachineWrapper ... or mixed method ...
If you have a simple animation i recommend standard StateMachineWrapper ...
... If i understand correctly DD proposes to use the first method ...
I find it hard to understand the nuances of your conversation ...

Hi Anvart,

We need the first method to be able to control the flooding with HasFloodIn and No_Flood condition.

Don't worry if sometime you don't understand the nuance because sometime i have difficulty to understand my own words:har:

Best regards Hans

Hans Witteman 04-18-11 04:11 PM

SMC new test
 
Hi DD,

I made the new SMC with 4 entries states can you have a look at this because i am sure i made a mistake in it i was taking flooding in engine room and it didn't trigger the animation?


Here it is :

http://i886.photobucket.com/albums/a.../SMC_Flood.jpg

Best regards Hans

skwasjer 04-18-11 05:00 PM

Quote:

Originally Posted by DivingDuck (Post 1645161)
Moin Hans,

if your animation shows in S3D but not ingame, you probably have not set the 3d_model identifier (see pic) correctly or youīve got an ID conflict.

Skwasjer is, of course, right saying that you do not need a SMC to make an animation show up ingame. But there are several hooks that might prevent your solution from working.


First thing to do is to create a new node featuring a 3d model.
  1. You can do it by cloning (copy&paste) an existing 3d_model within S3D. BUT, this will not work without hex editing as the 3d modelīs ID will be linked to itīs properties node via an ID entry that is not accessible via S3D. (see pic below) Therefore youīll end up with an ID conflict. ID conflict will result in animation not showing ingame, not even the base mesh.



  2. You can use your right mouse button to create new nodes/chunks in S3D. As I donīt know what routine S3D uses to create unique IDs I prefer method #1
Second step: you have to make sure the 3d_model type/identifier is set to 0x02. (see pic below) Otherwise you will see the base mesh only without animation.




Third step: select the 3d_model node and import your *.obj file sequence.
This is the easiest way to bring an ever looping animation into the game.


If you donīt want the animation to loop constantly, youīll have to split and put the data into several files. See pic below.




This last pic says it all. If thereīs still something missing, ask!


Regards,
DD

You have to excuse me since it's been too long, but I'm a bit confused by that statement, because as far as I know S3D does allow editting those ID's... I don't see anything weird, the 4/100 chunk has 3 id's in a row, the id, parent id and model id. The model chunk has just one id, it's own. Your hex screenshots show all of them, and S3D understands (and shows) all of them... So really, I am confused that you say S3D does not understand them :D

I need no hex work to make animations work - even more advanced ones - it can all be done in S3D... (I mean, I did it myself)

And yea, the funny misplaced box in the model pane was some left over unfinished (but useful) thingy that I left in, but totally forgot about... :88)

Tip: you can copy existing structures by pressing CTRL+SHIFT+C on the top node, and then pasting in new DAT (or ANM), and then just assign new ID's in S3D (the 'New' button next to the ID-field). If you have trouble starting from scratch, this may help.

Anvart 04-18-11 05:21 PM

Quote:

Originally Posted by Hans Witteman (Post 1646004)
Hi Anvart,

We need the first method to be able to control the flooding with HasFloodIn and No_Flood condition.
...
Best regards Hans

This method has been tested 100 times ...
It's wonder do at StateMachineWrapper... with trick's logic, using StartTimer, StartEffect, TimerElapsed, StopEffect and so on... :har:
...
Why you don't use HasFlood? for more detailed logic?
...
i think you made not correct logic...
...
but sorry, DD is your consultant... it's time for bed.

Hans Witteman 04-18-11 08:52 PM

Quote:

Originally Posted by skwasjer (Post 1646129)
You have to excuse me since it's been too long, but I'm a bit confused by that statement, because as far as I know S3D does allow editting those ID's... I don't see anything weird, the 4/100 chunk has 3 id's in a row, the id, parent id and model id. The model chunk has just one id, it's own. Your hex screenshots show all of them, and S3D understands (and shows) all of them... So really, I am confused that you say S3D does not understand them :D

I need no hex work to make animations work - even more advanced ones - it can all be done in S3D... (I mean, I did it myself)

And yea, the funny misplaced box in the model pane was some left over unfinished (but useful) thingy that I left in, but totally forgot about... :88)

Tip: you can copy existing structures by pressing CTRL+SHIFT+C on the top node, and then pasting in new DAT (or ANM), and then just assign new ID's in S3D (the 'New' button next to the ID-field). If you have trouble starting from scratch, this may help.

Hi mate,

I know what your mean because it did work without hexing anything the only thing that was not working because of the small box where it show a number i just had to change the 0 for 2 like DD mention and suddenly the magic went on in game.

But i have see that in some animation you did for sH4 you have it at 0 and it was working correctly so maybe we only need to put number 2 for Sh3.

Best regards Hans

Hans Witteman 04-18-11 08:57 PM

Quote:

Originally Posted by Anvart (Post 1646138)
This method has been tested 100 times ...
It's wonder do at StateMachineWrapper... with trick's logic, using StartTimer, StartEffect, TimerElapsed, StopEffect and so on... :har:
...
Why you don't use HasFlood? for more detailed logic?
...
i think you made not correct logic...
...
but sorry, DD is your consultant... it's time for bed.

Hi Anvart,

Keep in mind i am still a noob regarding SMC but if you have an idea that would make it work in the best way possible feel free to give advice it is not only DD on this one it is you, privateer,Skwasjer and me.

Also i saw that you have an action that is call SetVisible in your flag can you tell me what is the name for hiding it i guess SetInvisible???

We are all working in cooperation mode on this one so the more brains the better:salute:

Best regards Hans

Hans Witteman 04-18-11 09:02 PM

Message to privateer
 
Hi mate,

Just want to apologize because i derived your thread on water flooding and it is suppose to be only on crew animation just let me know if you prefer that we continue this topic in the thread Graphical flooding?

Best regards Hans

Madox58 04-18-11 09:22 PM

NO! By all means carry on as you were!
:yeah:
This thread is becomeing what it was intended for!
The Ultimate Animation Thread!
This is the stuff everyone wants to know.
We want to know the failures and successes!


All times are GMT -5. The time now is 03:45 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Đ 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.