Author Topic: Specific Preset Animations HELP  (Read 1782 times)

Offline DragonGamez

  • Curious Wanderer
  • *
  • Posts: 27
  • Floof-O-Meter: 1
    • View Profile
Specific Preset Animations HELP
« on: January 02, 2018, 10:43:55 pm »
I wasn't entirely sure where to put this since it isn't really a game problem/game help thing, and also not a preset tutorial at all?
But...

I was wondering if any experienced preset makers out there know of a code/codes that can be used to create very specific preset animations?
Specific in the sense that only if a certain thing happens will the animation occur.

What I'm looking for is the ability to have a preset that when its eyes are closed, they're entirely dark, but when they're opened at all they turn red or glowy.
I was thinking this could work IF there's such a code available so that if the model has the emote "Rest" or "Rest Ear Perk" (whatever specified emotes) then there would be dark eyes, but anything else the eyes would be colored or animate. Perhaps an if/then statement?
I just don't know if the code will ACCEPT something like that, which is the issue.

The reason I'm trying to make it so when the eyes are closed the eyes go dark is because that way at any angle the eyes won't be seen under the eyelids at all, since the eyes don't close completely.

So... is this possible to do?
and if not, is there another solution for a similar result?

Offline Warriorstrike

  • . "The truth is often what we make of it; you heard what you wanted to hear, believed what you wanted to believe."
  • Ancient Silver Mane
  • *****
  • Posts: 4,221
  • Country: us
  • Floof-O-Meter: 346
  • . Remember… the Force will be with you. Always.
    • warriorstrike
    • warriorstrike
    • View Profile
    • My Tumblr
Re: Specific Preset Animations HELP
« Reply #1 on: January 03, 2018, 02:38:23 am »
The Game Help board may be the best place for this thread, since you're seeking general help regarding a code to help give your preset a specific effect. You can still use the Game Help board for assistance regarding any game-related troubles or help questions if it involves a preset. c:

I'll move it over for you.~

If you define yourself by the power to take life, the desire to dominate, to possess… then you have nothing.

Offline Kuri

  • Immortal Legend
  • *****
  • Posts: 8,168
  • Country: nz
  • Floof-O-Meter: 136
  • Foreboding evil harmless kitten.
    • dumbstuff4friends
    • channel/UCo42jgbLvEzkofpOin0_a4A
    • View Profile
Re: Specific Preset Animations HELP
« Reply #2 on: January 03, 2018, 07:28:12 am »
Not that i'm aware of, but you could colour the very bottom sliver of the eyes black so the tiny tiny bit that does show is darkened by default.   Of course this means when you look up the bottom eyelid would appear to follow...
The Japanese concept of wabisabi:
The closest concept in english would be 'rustic'
They might have an old thing, one example is a favourite bowl or dish, it's broken, pieces are missing, why fix it?  With gold and pieces from other dishes?
"Because it was my favourite & I like it"

Lucius

  • Guest
Re: Specific Preset Animations HELP
« Reply #3 on: January 03, 2018, 09:30:04 am »
I don't believe that .material files support conditional statements.

They support declaring variables, like: diffuse $diffuse_colour, which you can then change later with: set $diffuse_colour "1 0 0 1", but they don't support declaring conditions for those changes with if/elseif/while/etc statements.

I've tried inserting some if/else statements in my early days and it's a no go. If you just leave the line bare in the code, it won't break it, but as soon as you add the curly brackets to actually make the statement conditional, then the mesh you're affecting will go white.


If you need an example as to what I mean

The code below won't break the material file, but the condition won't work either:

pass
{
   if (Species == Feline)
   texture_unit
   {
      texture preset_5body.jpg
   }
}


Yet this one will break the file:

pass
{
   if (Species == Feline)
   {
      texture_unit
      {
         texture preset_5body.jpg
      }
   }
}

OGRE material scripts support mostly things that make repetitive tasks easier, like copying passes and referencing other .material files.

If you want to change the texture/diffuse of the eye mesh on certain rotational values of the eyelids, then you'll need a .cg and/or .program file. The problem is, they don't export with the preset file and if your material files reference or import .cg / .program files that other people don't have, their game will crash.

Essentially, if you fix this problem with a .cg / .program file and then upload your preset to preset sync, a lot of people will crash if you enter the same map as them.

A lot of the more practical and advanced coding possibilities are found in such shader files for OGRE, which is why it's a pain to try to understand why KovuLKD didn't allow the preset exporter to export the whole folder instead of just the one .material file.

Rambling aside, I don't think you have much of a solution for this, aside from what Kuri suggested.

Offline DragonGamez

  • Curious Wanderer
  • *
  • Posts: 27
  • Floof-O-Meter: 1
    • View Profile
Re: Specific Preset Animations HELP
« Reply #4 on: January 04, 2018, 12:33:45 am »
Thank you for the answers!
I figured it may have been a bit of a shot in the dark, but I used a method that ended up working without having to do any special coding. (Basically what Kuri suggested)