HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Bottom Teeth Fix

View previous topic View next topic Go down 
Go to page : Previous  1, 2
AuthorMessage
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 487
Join date : 2014-02-09
Age : 19

PostSubject: Bottom Teeth Fix   Sat Oct 25, 2014 6:06 am

First topic message reminder :

Do you make presets? Have you ever made a skeleton? Those are pretty cool. So everything is goin great, but when you go to test it, you get this:

[You must be registered and logged in to see this image.]

What??? My teeth texture is transparent!! yudodis

It's ok. A simple source edit will fix that right up.

Open up MagixUnit and find

Code:
mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName("TeethMat/TWOSIDE");
 mHeadEnt->getSubEntity(2)->setMaterialName("EyeModColour");

Here's the problem. In the head's mesh, it has 4 materials - the head, the top teeth, the eyes, and the bottom teeth. The source isn't recognizing the bottom teeth.

Change the lines to include a second teeth mat:

Code:
mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName("TeethMat/TWOSIDE");
 mHeadEnt->getSubEntity(2)->setMaterialName("EyeModColour");
 mHeadEnt->getSubEntity(3)->setMaterialName("TeethMat/TWOSIDE");

Make sure to set the subentity right

Next, still in MagixUnit, find:

Code:
mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName(tTeethMat);
 mHeadEnt->getSubEntity(2)->setMaterialName(tEyeMat);

And again, change it to include another teeth mat:

Code:
mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName(tTeethMat);
 mHeadEnt->getSubEntity(2)->setMaterialName(tEyeMat);
 mHeadEnt->getSubEntity(3)->setMaterialName(tTeethMat);

Go test again:

[You must be registered and logged in to see this image.]

hot

EDIT:

If you have some heads with only a single submesh (the flat teeth) but some with two, here's a way to keep both.
Spoiler:
 

any questions feel free to message me


Last edited by Hyper on Sat Sep 26, 2015 5:27 pm; edited 1 time in total
Back to top Go down
http://azoptaos.boards.net/

AuthorMessage
Hyper
Admin


Posts : 487
Join date : 2014-02-09

PostSubject: Re: Bottom Teeth Fix   Sun Sep 27, 2015 9:48 pm

i don't know how to explain it any simpler. you have it pasted inside the isIndexedUnit function. that's why its failing.
Back to top Go down
http://azoptaos.boards.net/
Cloud
Texture Artist
Texture Artist
avatar

Game username : Cloud, Daydream
Server : None
Female Posts : 614
Join date : 2014-07-22
Location : Under your bed

PostSubject: Re: Bottom Teeth Fix   Sun Sep 27, 2015 10:10 pm

I'm confused because the code you added here is the one I have in my source, so I'm not sure how it would fix anything xD
I took the code you added and pasted it in place of mine which didn't fix it. Here are the errors now:

Code:
1>c:\users\owner\desktop\kito-5.5\kito-5.5\src\client\include\MagixUnit.h(400): error C3861: 'getHeadID': identifier not found
Code:
1>c:\users\owner\desktop\kito-5.5\kito-5.5\src\client\include\MagixUnit.h(2781): error C2601: 'getHeadID' : local function definitions are illegal
1>c:\users\owner\desktop\kito-5.5\kito-5.5\src\client\include\MagixUnit.h(2782): error C2065: 'mHeadEnt' : undeclared identifier
1>c:\users\owner\desktop\kito-5.5\kito-5.5\src\client\include\MagixUnit.h(2782): error C2227: left of '->getMesh' must point to class/struct/union/generic type
1>          type is ''unknown-type''
1>c:\users\owner\desktop\kito-5.5\kito-5.5\src\client\include\MagixUnit.h(2782): error C2227: left of '->getName' must point to class/struct/union/generic type

Not sure if this helps at all, but the code you sent is the exact same one that was in my source so it couldn't have solved the error. It was in the exact same place as mine.

[You must be registered and logged in to see this image.]



Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 487
Join date : 2014-02-09
Age : 19

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 12:42 am

no, it isnt. it's still inside the function.

replace the isIndexedUnit function and down with this

Code:
   virtual bool isIndexedUnit()
   {
      return false;
   }
String getHeadID()
{
   String headMeshID = mHeadEnt->getMesh()->getName();
   headMeshID.erase(0, 4);
   headMeshID.erase(headMeshID.find_first_of("."), 5);
   return headMeshID;
}
};

#endif

________________________________
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
Back to top Go down
http://azoptaos.boards.net/
Cloud
Texture Artist
Texture Artist
avatar

Game username : Cloud, Daydream
Server : None
Female Posts : 614
Join date : 2014-07-22
Location : Under your bed

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 1:01 am

Okay, what I had earlier was what you had posted so that's why I was confused. The build succeeded, but it still crashes upon trying to create a character (which is set at head1 originally) with the same 'index out of bounds' error. Now I honestly have no idea what's wrong because it can't be the submeshes this time.
Back to top Go down
Nakti
®
®
avatar

Game username : Nakti
Server : World of Pandora
Female Posts : 164
Join date : 2012-08-24
Age : 22
Location : black celebration

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 4:21 am

You have
Code:
if (getHeadID() != "1" || getHeadID() != "5" || getHeadID() != "7")mHeadEnt->getSubEntity(3)->setMaterialName("TeethMat/TWOSIDE");
But you need
Code:
if (getHeadID() != "1" && getHeadID() != "5" && getHeadID() != "7")mHeadEnt->getSubEntity(3)->setMaterialName("TeethMat/TWOSIDE");

With the || you load the submesh if at least one of those statements is true. There always is at least one true, as HeadID cannot be 1, 5 and 7 simultaneously. By using && you choose those heads who are at one time not 1, 5, 7 - the ones having teeth.
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 487
Join date : 2014-02-09
Age : 19

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 4:30 am

...no. using && would make it look to see if the head ID is 1, 5 and 7 simultaneously. which it isn't

i'm honestly not sure what the issue is. i've tested this code and it worked fine for me. can you repost what you've edited?

________________________________
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
Back to top Go down
http://azoptaos.boards.net/
Nakti
®
®
avatar

Game username : Nakti
Server : World of Pandora
Female Posts : 164
Join date : 2012-08-24
Age : 22
Location : black celebration

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 5:09 am

If there was ==, it would look for simultaneous equality to three heads. But there is !=, so it looks for opposite.
Back to top Go down
Cloud
Texture Artist
Texture Artist
avatar

Game username : Cloud, Daydream
Server : None
Female Posts : 614
Join date : 2014-07-22
Location : Under your bed

PostSubject: Re: Bottom Teeth Fix   Mon Sep 28, 2015 7:06 pm

This is exactly what I've edited for this fix:

Code:
mBodyEnt->setMaterialName(tBodyMat);
      mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
      mHeadEnt->getSubEntity(1)->setMaterialName("TeethMat/TWOSIDE");
      mHeadEnt->getSubEntity(2)->setMaterialName("EyeModColour");
      if (getHeadID() != "1" || getHeadID() != "5" || getHeadID() != "7")mHeadEnt->getSubEntity(3)->setMaterialName("TeethMat/TWOSIDE");
      if(mManeEnt)mManeEnt->setMaterialName("ManeModColour");
      mTailEnt->setMaterialName(tTailMat);
      if(mWingEnt)mWingEnt->setMaterialName(tWingMat);
      if(mTuftEnt)mTuftEnt->setMaterialName("ManeModColour");

Code:
mBodyEnt->setMaterialName(tBodyMat);
      mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
      mHeadEnt->getSubEntity(1)->setMaterialName(tTeethMat);
      mHeadEnt->getSubEntity(2)->setMaterialName(tEyeMat);
      if (getHeadID() != "1" || getHeadID() != "5" || getHeadID() != "7")mHeadEnt->getSubEntity(3)->setMaterialName(tTeethMat);
      if(mManeEnt)mManeEnt->setMaterialName(tManeMat);
      mTailEnt->setMaterialName(tTailMat);
      if(mWingEnt)mWingEnt->setMaterialName(tWingMat);
      if(mTuftEnt)mTuftEnt->setMaterialName(tManeMat);

Code:
virtual bool isIndexedUnit()
   {
      return false;
   }
     String getHeadID()
   {
     String headMeshID = mHeadEnt->getMesh()->getName();
      headMeshID.erase(0, 4);
      headMeshID.erase(headMeshID.find_first_of("."), 5);
      return headMeshID;
   }
};

#endif
Back to top Go down
 
Bottom Teeth Fix
View previous topic View next topic Back to top 
Page 2 of 2Go to page : Previous  1, 2

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: START HERE :: KITO's IT Source Code :: Bugs & Patches-
Jump to: