Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: more than one x-file for each NPC  (Read 4149 times)

0 Members and 1 Guest are viewing this topic.

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
more than one x-file for each NPC
« on: June 27, 2007, 10:48:23 PM »

Hi folks,

following thing. I prefer to split my animations to different x-files because some will be changed from time to
time.

For the main actor e.g. means that, one for walk, idle and dummy, another one for all "picking things up" actions and so on.

No I tried the same for the NPC's as their animation stock is growing but damn! It doesn't work.
For example. First file contains the mesh, the walk and the idle anim, the second one some talk anims.
When it is time for WME to let that guy talk, he jumps back into the last walk frame. When setting the idle
as a talk animation, he jumps after walking to the idle anim and loops it, starts all talking, but with the idle animation. As expected, but as written above, both are in the same x-file.
Ain't it possible to use more x-files for the NPC's?

Thanks for upcoming answers

regards

Amo

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: more than one x-file for each NPC
« Reply #1 on: June 27, 2007, 11:15:53 PM »

it's possible. simply add multiple MODEL lines in your act3d file like this:

MODEL = "actors\actor\walk.x"
MODEL = "actors\actor\talk.x"
MODEL = "actors\actor\die.x"

ANIMATION
{
  NAME = "walk"
  LOOPING = TRUE
}

ANIMATION
{
  NAME = "talk"
  LOOPING = TRUE
}

ANIMATION
{
  NAME = "die"
  LOOPING = FALSE
}

etc.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: more than one x-file for each NPC
« Reply #2 on: June 27, 2007, 11:38:52 PM »

Hi metamorphium,

maybe I wrote a bit unclear. The way you describe is exactly the same way as I do for the main actor and it works. So I tried it again for the NPC and it doesn't work.

regards

Martin

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: more than one x-file for each NPC
« Reply #3 on: June 27, 2007, 11:54:18 PM »

ADDITIONAL QUESTION

Another question, I do not really understand that MergeAnims() thing.
I mean, the help is a bit short with this option. Ok, step by step.
In the scene.init has been added:

brian.MergeAnims("takelow");

than in the folder were the x-files for brian are stored a new file has been added called
"brian_take.anim"

This file contains:

ACTOR3DX
{
ANIMATION
  {
    NAME="takelow"
    LOOPING=FALSE
  }
}

and in brians act3d is the external model file 
MODEL = "actors\brian\brian_take.x" defined.

When starting the scene the debugger says, that WME isn't able to open "takelow".

Any suggestions?

regards

Amo

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: more than one x-file for each NPC
« Reply #4 on: June 28, 2007, 12:01:26 AM »

ah, I see your problem now!

actor.MergeAnims DOESN'T read act3d file.

Let me try to explain two approaches:

normally your actor3d have multiple MODEL lines and it will cause all animation loaded as soon as you load your actor file. But
this can be impractical at times, because your actor could have A LOT of animation. So WME introduce a trick with the dynamic
ability to load animations from .X files in the runtime. That's where MergeAnims comes in.

so you call it: brian.MergeAnims("actors\brian\brian_take.x"); which adds all animation from the .X file in the memory.
Mirror function for this is UnloadAnim();

Hope this helps.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: more than one x-file for each NPC
« Reply #5 on: June 28, 2007, 06:48:53 AM »

And the .anim files can only contain the "animation" blocks, in your case:

ANIMATION
{
  NAME="takelow"
  LOOPING=FALSE
}

NOT the ACTOR3DX thingy.

As for your original question, there is absolutely no difference between the main character and NPCs (they are all actor objects as far as the engine is concerned).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: more than one x-file for each NPC
« Reply #6 on: June 28, 2007, 10:43:01 AM »

Thank you guys,
now that mergeanims works good enough, that WME isn't crashing anymore.
But Brians behaviour is still the same. He walks in, stops, a transition starts, than
he jumps back to the last walk frame. When telling him he shall play his idle which
is stored in the first x file as talk anim, he plays it, but every animation from another
x-file isn't played.  I do not know why, as it works very fine for the main actor.
Strange.

Amo

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 206
    • View Profile
    • Sunrise The Game
Re: more than one x-file for each NPC
« Reply #7 on: June 28, 2007, 11:46:10 AM »

OK guys! Stop searching. We found it. It was a tiny little error in the x-file...
Everything is nice now.

regards

Amo
 

Page created in 0.042 seconds with 19 queries.