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 | 
 

 [Solved!] Character not saving correctly, defaulting to KovMat

View previous topic View next topic Go down 
AuthorMessage
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: [Solved!] Character not saving correctly, defaulting to KovMat   Mon Sep 28, 2015 6:46 pm

Solved by modifying:
Code:
(bodyMarkID == 0 ? "" : ";" + vect4ToString(bodymarking, 3)));
(headMarkID == 0 ? "" : ";" + vect4ToString(headmarking, 8));
(tailMarkID == 0 ? "" : ";" + vect4ToString(tailmarking, 3));

Into:
Code:
+ ";" + vect4ToString(bodymarking, 3)
+ ";" + vect4ToString(headmarking, 3)
+ ";" + vect4ToString(tailmarking, 3));

Thanks for the help!

The Problem:
 


Last edited by XJayX on Sat Nov 14, 2015 5:56 am; edited 2 times in total
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Oct 29, 2015 2:41 am

Going to bump this because it has been a while, and I still haven't found the solution.

As for more information on the problem, I did a little more searching, and found something saying I might need to up the char limit(256) to 512.
I changed 256 in 3 places (in the spoiler below). It sounded like I had to change a few other of the 256s to 512, but I didn't find any others that looked like they related to the color values. So, if I did it wrong, I wouldn't be surprised.

Spoiler:
 
Back to top Go down
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 377
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Oct 29, 2015 5:21 am

omg this was posted in sept? why didn't i see it then? lol I'm so sorry for not putting my solution in my own help thread. wow, would that have been useful. (as would having my code infront of me instead of using my faulty memory shhhhh)

anywhoozer, ramblings aside. customParameter it is refering to is literally listed as the parameter counts being off. i think it was in magixunit or unitmanager. if you run a search for it, you should come across a long list similar to

param[0];
param[1];
param[2];

etc. um..perhaps as tparam or fully typed as customParameter. it'll have a header on it for defining maximum number of params based on which of the get assigned to the character during the creation process (similar to the headers in the characterscreen code that defines the color parameters)
man i hope this isn't TOO confusing. lol my tablet won't let me scroll your code blips to check for what im talking about. but if you do manage to find the section I'm talking about, that is where your error should be coming from. either your counts go too high, too low, or aren't adding up to what the header defines.

actually, im almost 99% certain it'll be a list of

customParameter[0];

etcetc


fffff i hope this ends up helpful even a tiny bit T.T sorry its all deranged/rambly....
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Oct 29, 2015 6:54 pm

That's fine, and I'm thankful for any help I get, no matter how long it takes to get it. x3

I searched for "param" and this is what I found:
In MagixUnit.cpp:
 

In MagixCharScreenManager.cpp:
 

In MagixNetworkManager.cpp:
 

I think the "getCustomParameter" list in MagixUnit is the one you were talking about. I've been messing around with the numbers, just have to know which numbers themselves I need to increase/decrease them to.

Looking at how the markings' parameters are in the order of 3;8;3 in MagixUnit and they are ordered 8;9;10 in MagixCharManager, I thought I might have to match them. I'm probably doing even more things wrong.. but I tried to match all the marking params to 3;8;3, then when that didn't work I tried matching the other numbers, 8;9;10. Of course, one of these orders broke it, the other just did the same thing as before I changed it. (These codes are reversed, so they don't show my changes.)
I also wondered if I should add to "mUnit->createUnit" in any places, I didn't test that yet.

(Also, something I hadn't mentioned. The Head and Tail markings are black, like they are supposed to be, but the Body markings are white--all of them still seem to function when changing colors in the creator, though. Not sure if this changes anything.)
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: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Oct 29, 2015 7:25 pm

It's not the parameters. We need to find out why does your character have the kovmat on it while trying to apply colours >_<

Could you please post MagixUnit::createUnit function?
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Oct 29, 2015 8:20 pm

Here they are, but I don't believe I changed anything in either of these. Which might actually be a problem itself... but I looked over it and I didn't notice anything I needed to separate.

In MagixUnit.h:
Code:
void createUnit(const unsigned short iID, SceneManager *sceneMgr, const String &bodyMesh, const String &headMesh, const String &maneMesh, const String &tailMesh, const String &wingMesh, const String &matName, const String &tuftMesh);

In MagixUnit.cpp:
Code:
void MagixUnit::createUnit(const unsigned short iID, SceneManager *sceneMgr, const String &bodyMesh, const String &headMesh, const String &maneMesh, const String &tailMesh, const String &wingMesh, const String &matName, const String &tuftMesh)
{
 if (unitID)destroyUnit(sceneMgr);
 unitID = iID;

 mBodyEnt = sceneMgr->createEntity("Body" + StringConverter::toString(iID), bodyMesh + ".mesh");
 mHeadEnt = sceneMgr->createEntity("Head" + StringConverter::toString(iID), headMesh + ".mesh");
 if (maneMesh != "Maneless")mManeEnt = sceneMgr->createEntity("Mane" + StringConverter::toString(iID), maneMesh + ".mesh");
 mTailEnt = sceneMgr->createEntity("Tail" + StringConverter::toString(iID), tailMesh + ".mesh");
 if (wingMesh != "Wingless")mWingEnt = sceneMgr->createEntity("Wing" + StringConverter::toString(iID), wingMesh + ".mesh");
 if (tuftMesh != "Tuftless")mTuftEnt = sceneMgr->createEntity("Tuft" + StringConverter::toString(iID), tuftMesh + ".mesh");

 setMaterial(matName);
 bodyMarkID = 0;
 headMarkID = 0;
 tailMarkID = 0;

 mObjectNode = sceneMgr->getRootSceneNode()->createChildSceneNode();
 mObjectNode->attachObject(mBodyEnt);
 mObjectNode->attachObject(mHeadEnt);
 if (mManeEnt)mObjectNode->attachObject(mManeEnt);
 mObjectNode->attachObject(mTailEnt);
 if (mWingEnt)mObjectNode->attachObject(mWingEnt);
 if (mTuftEnt)mObjectNode->attachObject(mTuftEnt);
 mObjectNode->setScale(1, 1, 1);

 mBodyEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);
 mHeadEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);
 if (mManeEnt)mManeEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);
 mTailEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);
 if (mWingEnt)mWingEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);
 if (mTuftEnt)mTuftEnt->getSkeleton()->setBlendMode(ANIMBLEND_CUMULATIVE);

 mBodyEnt->getSkeleton()->getBlendMode();
 mHeadEnt->getSkeleton()->getBlendMode();
 if (mManeEnt)mManeEnt->getSkeleton()->getBlendMode();
 mTailEnt->getSkeleton()->getBlendMode();
 if (mWingEnt)mWingEnt->getSkeleton()->getBlendMode();
 if (mTuftEnt)mTuftEnt->getSkeleton()->getBlendMode();

 mBodyEnt->setQueryFlags(UNIT_MASK);
 mHeadEnt->setQueryFlags(UNIT_MASK);
 if (mManeEnt)mManeEnt->setQueryFlags(UNIT_MASK);
 mTailEnt->setQueryFlags(UNIT_MASK);
 if (mWingEnt)mWingEnt->setQueryFlags(UNIT_MASK);
 if (mTuftEnt)mTuftEnt->setQueryFlags(UNIT_MASK);
 //mBodyEnt->getParentSceneNode()->showBoundingBox(true);
 animBase = "";
 prevAnimBase = "";
 animSpeed = 1;
 animCount = 0;
 animSecond = "";
 prevAnimSecond = "";
 animSecondCount = 0;
 emoteMode = "Normal";
 prevEmoteMode = "";
 emoteCount = 0.001;
 headTurnCount = 0;
}
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: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Nov 12, 2015 10:05 pm

Sorry for long answer.
Did you fix that?

If not,
When you save your character, do you have the valid .character file? (with CustomMat in proper (7th) place and coloured markings)?
Do your preseted characters load properly?
Can you post the MagixUnit::setMaterial?
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Nov 12, 2015 11:47 pm

Nope, still playing around with the code. I've restarted several times, but haven't got it right once.

(I probably should have posted the .char files in the first place...)
I'm not sure where the marking colors are, but CustomMat is where it belongs. I believe the head markings are red, the body markings are green, and the tail markings are blue. (If that is wrong, then body is blue and tail is green.)
(245 characters, with spaces)
Code:
Tester;Body;Head1;Maneless;Tail1;Wingless;CustomMat;Tuftless;1;1;1|0.45 0.35 0.25 1;0.65 0.55 0.35 1;0 0 0 0;0.02 0.02 0.02 1;0.25 0.15 0.05 1;0.55 0.45 0.25 1;0.25 0.25 0.05 1;0.2 0.15 0 1;0.884 0.465 0.15 1;1 0.465 0.15 1;0 0 0 0;0 1 0 1
false

Here is a .character file from my working compile, without the marking color code.
(258 characters, with spaces)
Code:
Jay;Body;Head6;Mane19;Tail7;Wings4;CustomMat;Tuft7;8;8;0;0.944|0.305 0.2 0.085 1;0.5 0.385 0.179 1;0.23 0.14 0.044 1;1 0.51 0 1;0.65 0.505 0.249 1;0.655 0.505 0.244 1;1 0.51 0 1;0.24 0.15 0.044 1;0.345 0.16 0 1;0.345 0.16 0 1;0 0 0 1;0.23 0.11 0 1
ok;1 0.5 0

Sort of confused that there are more characters in the .char file that should probably have less (the one without the 2 extra values for markings' colors), but I don't know if it is the difference of how many numbers with or without decimals there are (like 1 or 0 instead of 0.884). I would still expect there should be more characters in the currently broken .char file.
__________________________________


Apparently, presets work completely fine. I put a preset on a character, my screen could see it and my other test user could see it just fine.

Here is MagixUnit::setMaterial:
Code:
void MagixUnit::setMaterial(const String &matName)
{
 if (!unitID)return;
 matGroupName = matName;
 if (matGroupName == "CustomMat")return;

 const String tBodyMat = matName + "/BodyMat";
 const String tHeadMat = matName + "/HeadMat";
 const String tEyeMat = matName + "/EyeMat";
 const String tTeethMat = matName + "/TeethMat";
 const String tManeMat = matName + "/ManeMat";
 const String tTailMat = matName + "/TailMat";
 const String tWingMat = matName + "/WingMat";

 mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName(tTeethMat);
 mHeadEnt->getSubEntity(2)->setMaterialName(tEyeMat);
 if (mManeEnt)mManeEnt->setMaterialName(tManeMat);
 mTailEnt->setMaterialName(tTailMat);
 if (mWingEnt)mWingEnt->setMaterialName(tWingMat);
 if (mTuftEnt)mTuftEnt->setMaterialName(tManeMat);
}
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: [Solved!] Character not saving correctly, defaulting to KovMat   Thu Nov 12, 2015 11:54 pm

In the first file there aer shorter colours so it's ok to have it shorter.

could you please also post the MagixUnit::setColours Very Happy
Sorry for that function jumping...
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Fri Nov 13, 2015 1:19 am

Alright, I wasn't sure about that. ^^

Here it is:

Code:
void MagixUnit::setColours(const ColourValue &pelt, const ColourValue &underfur, const ColourValue &mane, const ColourValue &nose, const ColourValue &eyeTop, const ColourValue &eyeBot, const ColourValue &ears, const ColourValue &tailtip, const ColourValue &eyeL, const ColourValue &eyeR, const ColourValue &wing, const ColourValue &bodymarking, const ColourValue &headmarking, const ColourValue &tailmarking)
{
 matGroupName = "CustomMat";

 const Vector4 peltVect(pelt.r, pelt.g, pelt.b, 1);
 const Vector4 underfurVect(underfur.r, underfur.g, underfur.b, 1);
 const Vector4 maneVect(mane.r, mane.g, mane.b, 1);
 const Vector4 noseVect(nose.r, nose.g, nose.b, 1);
 const Vector4 eyeTopVect(eyeTop.r, eyeTop.g, eyeTop.b, 1);
 const Vector4 eyeBotVect(eyeBot.r, eyeBot.g, eyeBot.b, 1);
 const Vector4 earsVect(ears.r, ears.g, ears.b, 1);
 const Vector4 tailtipVect(tailtip.r, tailtip.g, tailtip.b, 1);
 const Vector4 eyeLVect(eyeL.r, eyeL.g, eyeL.b, 1);
 const Vector4 eyeRVect(eyeR.r, eyeR.g, eyeR.b, 1);
 const Vector4 wingVect(wing.r, wing.g, wing.b, 1);
 const Vector4 bodymarkingVect(bodymarking.r, bodymarking.g, bodymarking.b, 1);
 const Vector4 headmarkingVect(headmarking.r, headmarking.g, headmarking.b, 1);
 const Vector4 tailmarkingVect(tailmarking.r, tailmarking.g, tailmarking.b, 1);

 String headMeshID = mHeadEnt->getMesh()->getName();
 headMeshID.erase(0, 4);
 headMeshID.erase(headMeshID.find_first_of("."), 5);
 //Common headID mods
 if (headMeshID == "5")headMeshID = "1";
 else if (headMeshID == "6")headMeshID = "3";

 String wingMeshID = "";
 if (mWingEnt)
 {
 wingMeshID = mWingEnt->getMesh()->getName();
 if (wingMeshID != "Wings.mesh")
 {
 wingMeshID.erase(0, 5);
 wingMeshID.erase(wingMeshID.find_first_of("."), 5);
 }
 else wingMeshID = "";
 }
 const String tBodyMat = (bodyMarkID == 0 ? "BodyModColour" : "BodyMark" + StringConverter::toString(bodyMarkID));
 const String tHeadMat = (headMarkID == 0 ? "HeadModColour" + headMeshID : "HeadMark" + StringConverter::toString(headMarkID) + "_" + headMeshID);
 const String tTailMat = (tailMarkID == 0 ? "TailModColour" : "TailMark" + StringConverter::toString(tailMarkID));
 const String tWingMat = "WingModColour" + wingMeshID;

 mBodyEnt->setMaterialName(tBodyMat);
 mHeadEnt->getSubEntity(0)->setMaterialName(tHeadMat);
 mHeadEnt->getSubEntity(1)->setMaterialName("TeethMat/TWOSIDE");
 mHeadEnt->getSubEntity(2)->setMaterialName("EyeModColour");
 if (mManeEnt)mManeEnt->setMaterialName("ManeModColour");
 mTailEnt->setMaterialName(tTailMat);
 if (mWingEnt)mWingEnt->setMaterialName(tWingMat);
 if (mTuftEnt)mTuftEnt->setMaterialName("ManeModColour");

 mBodyEnt->getSubEntity(0)->setCustomParameter(1, peltVect); //pelt
 mBodyEnt->getSubEntity(0)->setCustomParameter(2, underfurVect); //underfur
 if (bodyMarkID != 0)mBodyEnt->getSubEntity(0)->setCustomParameter(3, bodymarkingVect); //body markings
 mHeadEnt->getSubEntity(0)->setCustomParameter(1, peltVect); //pelt(head)
 mHeadEnt->getSubEntity(0)->setCustomParameter(2, underfurVect); //underfur(head)
 if (mManeEnt)mManeEnt->getSubEntity(0)->setCustomParameter(1, maneVect); //mane
 mHeadEnt->getSubEntity(0)->setCustomParameter(3, noseVect); //nose
 mHeadEnt->getSubEntity(0)->setCustomParameter(4, eyeTopVect); //around eyes top
 mHeadEnt->getSubEntity(0)->setCustomParameter(5, eyeBotVect); //around eyes bottom
 mHeadEnt->getSubEntity(0)->setCustomParameter(6, Vector4(0, 0, 0, 1)); //eyebrows
 mHeadEnt->getSubEntity(0)->setCustomParameter(7, earsVect); //inside ears
 if (headMarkID != 0)mHeadEnt->getSubEntity(0)->setCustomParameter(8, headmarkingVect); //head markings
 mTailEnt->getSubEntity(0)->setCustomParameter(1, peltVect); //pelt(tail)
 mTailEnt->getSubEntity(0)->setCustomParameter(2, tailtipVect); //tailtip
 if (tailMarkID != 0)mTailEnt->getSubEntity(0)->setCustomParameter(3, tailmarkingVect); //tail markings
 mHeadEnt->getSubEntity(2)->setCustomParameter(1, eyeTopVect); //eyelid
 mHeadEnt->getSubEntity(2)->setCustomParameter(2, eyeLVect); //eye Left
 mHeadEnt->getSubEntity(2)->setCustomParameter(3, eyeRVect); //eye Right
 if (mWingEnt)mWingEnt->getSubEntity(0)->setCustomParameter(1, wingVect); //wings
 if (mTuftEnt)mTuftEnt->getSubEntity(0)->setCustomParameter(1, maneVect); //tuft

#pragma warning(push)
#pragma warning(disable : 4482)
 //If fragment programs are not supported
 if (mBodyEnt->getSubEntity(0)->getTechnique()->getName() == "2")
 {
 MaterialPtr tMat = MaterialManager::getSingleton().getByName("DynamicBodyMat" + StringConverter::toString(unitID));
 if (!tMat.isNull())MaterialManager::getSingleton().remove(tMat->getHandle());
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName(tBodyMat))->clone("DynamicBodyMat" + StringConverter::toString(unitID));
 mBodyEnt->setMaterialName("DynamicBodyMat" + StringConverter::toString(unitID));
 mBodyEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_SOURCE1,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(peltVect.x,
 peltVect.y,
 peltVect.z));
 mBodyEnt->getSubEntity(0)->getTechnique()->getPass(1)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(underfurVect.x,
 underfurVect.y,
 underfurVect.z));
 if (bodyMarkID != 0)
 mBodyEnt->getSubEntity(0)->getTechnique()->getPass(3)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(bodymarkingVect.x,
 bodymarkingVect.y,
 bodymarkingVect.z));
 if (mManeEnt || mTuftEnt)
 {
 if (MaterialManager::getSingleton().getByName("DynamicManeMat" + StringConverter::toString(unitID)).isNull())
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName("ManeModColour"))->clone("DynamicManeMat" + StringConverter::toString(unitID));
 if (mManeEnt)
 {
 mManeEnt->setMaterialName("DynamicManeMat" + StringConverter::toString(unitID));
 mManeEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_SOURCE1,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(maneVect.x,
 maneVect.y,
 maneVect.z));
 }
 if (mTuftEnt)
 {
 mTuftEnt->setMaterialName("DynamicManeMat" + StringConverter::toString(unitID));
 mTuftEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_SOURCE1,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(maneVect.x,
 maneVect.y,
 maneVect.z));
 }
 }
 tMat = MaterialManager::getSingleton().getByName("DynamicTailMat" + StringConverter::toString(unitID));
 if (!tMat.isNull())MaterialManager::getSingleton().remove(tMat->getHandle());
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName(tTailMat))->clone("DynamicTailMat" + StringConverter::toString(unitID));
 mTailEnt->setMaterialName("DynamicTailMat" + StringConverter::toString(unitID));
 mTailEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_SOURCE1,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(peltVect.x,
 peltVect.y,
 peltVect.z));
 mTailEnt->getSubEntity(0)->getTechnique()->getPass(1)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(tailtipVect.x,
 tailtipVect.y,
 tailtipVect.z));
 if (tailMarkID != 0)
 mTailEnt->getSubEntity(0)->getTechnique()->getPass(2)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(tailmarkingVect.x,
 tailmarkingVect.y,
 tailmarkingVect.z));
 if (MaterialManager::getSingleton().getByName("DynamicEyeMat" + StringConverter::toString(unitID)).isNull())
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName("EyeModColour"))->clone("DynamicEyeMat" + StringConverter::toString(unitID));
 mHeadEnt->getSubEntity(2)->setMaterialName("DynamicEyeMat" + StringConverter::toString(unitID));
 mHeadEnt->getSubEntity(2)->getTechnique()->getPass(1)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(eyeTopVect.x,
 eyeTopVect.y,
 eyeTopVect.z));
 mHeadEnt->getSubEntity(2)->getTechnique()->getPass(2)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(eyeLVect.x,
 eyeLVect.y,
 eyeLVect.z));
 mHeadEnt->getSubEntity(2)->getTechnique()->getPass(3)->getTextureUnitState(2)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(eyeRVect.x,
 eyeRVect.y,
 eyeRVect.z));
 tMat = MaterialManager::getSingleton().getByName("DynamicHeadMat" + StringConverter::toString(unitID));
 if (!tMat.isNull())MaterialManager::getSingleton().remove(tMat->getHandle());
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName(tHeadMat))->clone("DynamicHeadMat" + StringConverter::toString(unitID));
 mHeadEnt->getSubEntity(0)->setMaterialName("DynamicHeadMat" + StringConverter::toString(unitID));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_SOURCE1,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(peltVect.x,
 peltVect.y,
 peltVect.z));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(1)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(underfurVect.x,
 underfurVect.y,
 underfurVect.z));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(3)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(noseVect.x,
 noseVect.y,
 noseVect.z));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(4)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(eyeTopVect.x,
 eyeTopVect.y,
 eyeTopVect.z));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(5)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(eyeBotVect.x,
 eyeBotVect.y,
 eyeBotVect.z));
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(7)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(earsVect.x,
 earsVect.y,
 earsVect.z));
 if (headMarkID != 0)
 mHeadEnt->getSubEntity(0)->getTechnique()->getPass(8)->getTextureUnitState(1)->setColourOperationEx(LayerBlendOperationEx::LBX_BLEND_DIFFUSE_ALPHA,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_CURRENT,
 ColourValue(headmarkingVect.x,
 headmarkingVect.y,
 headmarkingVect.z));
 if (mWingEnt)
 {
 tMat = MaterialManager::getSingleton().getByName("DynamicWingMat" + StringConverter::toString(unitID));
 if (!tMat.isNull())MaterialManager::getSingleton().remove(tMat->getHandle());
 static_cast<MaterialPtr>(MaterialManager::getSingleton().getByName(tWingMat))->clone("DynamicWingMat" + StringConverter::toString(unitID));
 mWingEnt->setMaterialName("DynamicWingMat" + StringConverter::toString(unitID));
 mWingEnt->getSubEntity(0)->getTechnique()->getPass(0)->getTextureUnitState(0)->setColourOperationEx(LayerBlendOperationEx::LBX_MODULATE,
 LayerBlendSource::LBS_MANUAL,
 LayerBlendSource::LBS_TEXTURE,
 ColourValue(wingVect.x,
 wingVect.y,
 wingVect.z));
 }
 }
#pragma warning(pop)
}

(I wasn't sure if you wanted the entire thing...because it is large, but I guess it's there anyway. x3)
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: [Solved!] Character not saving correctly, defaulting to KovMat   Fri Nov 13, 2015 5:15 am

Try changing this
Code:
(bodyMarkID == 0 ? "" : ";" + vect4ToString(bodymarking, 3)));
(headMarkID == 0 ? "" : ";" + vect4ToString(headmarking, 8));
(tailMarkID == 0 ? "" : ";" + vect4ToString(tailmarking, 3));
into this
Code:
vect4ToString(bodymarking, 3)+ ";" +
vect4ToString(headmarking, 3)+ ";" +
vect4ToString(tailmarking, 3);
in MagixUnit::getColourString()

Shame on me I didn't notice this: there are ';'s at end of each line, so the following colours won't append
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Sat Nov 14, 2015 2:22 am

Thank you! Fixed one problem, but unfortunately, now I can see some other problem I have with the markings... it is kinda strange. I can't explain this well, so here's two screen shots of the two screens I used to test:

Screen 1:
 

Screen 2:
 

1. The tail markings are black on both tails, on both screens.
2. The head markings are black on one character on one screen, but on the other screen, you can see both are colored.
3. As for the body markings, I THINK they are correct in the first screen (don't remember which char got which color, but I think it is correct), but the second screen... not at all.
(4. In the character creator, Head and Tail markings are black as supposed to be, but Body markings are white--all can be colored just the same. I used to have one eye that was white when I first added dual eyes, but it didn't affect anything important and could be colored, so this might not need an urgent fix.)

Unsure whether this is a network issue, saving issue, or.. something else.

Making the assumtion it has something to do with the network files, this is in MagixNetworkManager.cpp:
Code:
if (String(tMatName) == "CustomMat")
 {
 short tBodyMark, tHeadMark, tTailMark;
 char tColours[256];
 tBitStream.Read(tBodyMark);
 tBitStream.Read(tHeadMark);
 tBitStream.Read(tTailMark);
 tUnit->setBodyMarkings((unsigned char)(mDef->hasBodyMark((unsigned char)tBodyMark) ? tBodyMark : 0));
 tUnit->setHeadMarkings((unsigned char)(mDef->hasHeadMark((unsigned char)tHeadMark) ? tHeadMark : 0));
 tUnit->setTailMarkings((unsigned char)(mDef->hasTailMark((unsigned char)tTailMark) ? tTailMark : 0));
 stringCompressor->DecodeString(tColours, 256, &tBitStream);
 tUnit->setColours(String(tColours));
 }

Also in MagixNetworkManager.cpp:
Code:
{
 short tBodyMark = 0, tHeadMark = 0, tTailMark = 0;
 mUnitManager->getPlayer()->getBodyMarkings(tBodyMark);
 mUnitManager->getPlayer()->getHeadMarkings(tHeadMark);
 mUnitManager->getPlayer()->getTailMarkings(tTailMark);
 tBitStream.Write(tBodyMark);
 tBitStream.Write(tHeadMark);
 tBitStream.Write(tTailMark);
 stringCompressor->EncodeString(mUnitManager->getPlayer()->getColourString().c_str(), 256, &tBitStream);
 }
_______________________________________________

If the issue might be in the character file, here are the character files for both of the testing characters:
Code:
Tester;Body;Head1;Maneless;Tail1;Wingless;CustomMat;Tuftless;1;1;1|0.45 0.35 0.25 1;0.65 0.55 0.35 1;0 0 0 0;0.02 0.02 0.02 1;0.25 0.15 0.05 1;0.55 0.45 0.25 1;0.25 0.25 0.05 1;0.2 0.15 0 1;0.55 0.3 0.15 1;0.55 0.3 0.15 1;0 0 0 01 0 0 1;0 0 1 1;0 1 0 1
false
Code:
Tester2;Body;Head1;Maneless;Tail1;Wingless;CustomMat;Tuftless;1;1;1|0.45 0.35 0.25 1;0.65 0.55 0.35 1;0 0 0 0;0.02 0.02 0.02 1;0.25 0.15 0.05 1;0.55 0.45 0.25 1;0.25 0.25 0.05 1;0.2 0.15 0 1;0.55 0.3 0.15 1;0.55 0.3 0.15 1;0 0 0 00 0 1 1;0 1 0 1;1 0 0 1
false
_______________________________________________

If this is happening because of something else (which I kind of assume), then I'll grab whatever part of the code you think is causing this. I think it could likely be that I did something incorrect when coding in the color values, at least for some of these problems. Just confused one screen shows ALMOST correct colors, and the other screen isn't even close to correct.
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: [Solved!] Character not saving correctly, defaulting to KovMat   Sat Nov 14, 2015 2:27 am

Oh sorry
I made a mistake again
See the highlighted place?
Quote :
Tester2;Body;Head1;Maneless;Tail1;Wingless;CustomMat;Tuftless;1;1;1|0.45 0.35 0.25 1;0.65 0.55 0.35 1;0 0 0 0;0.02 0.02 0.02 1;0.25 0.15 0.05 1;0.55 0.45 0.25 1;0.25 0.25 0.05 1;0.2 0.15 0 1;0.55 0.3 0.15 1;0.55 0.3 0.15 1;0 0 0 00 0 1 1;0 1 0 1;1 0 0 1
Red is wing colour, blue is the first marking colour. I forgot to put ";" between them.

Instead of what I said in my previous post, write this:
Code:
+ ";" +vect4ToString(bodymarking, 3)
+ ";" +vect4ToString(headmarking, 3)
+ ";" +vect4ToString(tailmarking, 3);

I don't know how this could cause the screens colour issue, but it's sure a critical mistake that needs to be fixed
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Sat Nov 14, 2015 3:36 am

That did it! Thank you so much! ^^

Just to add something, I edited some things there:
Code:
+ ";" + vect4ToString(bodymarking, 3)
+ ";" + vect4ToString(headmarking, 8)
+ ";" + vect4ToString(tailmarking, 3));

It would give me an error if there was not an extra ')'. I also changed "headmarking, 3" into "headmarking, 8" because "8" matched its GetCustomParameter number. I am actually unsure of what these numbers do or if changing it would affect it, but to avoid any other problems that might come up, I kept it at 8.

Thank you again!
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: [Solved!] Character not saving correctly, defaulting to KovMat   Sat Nov 14, 2015 4:50 am

You need 3 there, as it is in all other colors and in the original files.
It says how much digits you have after the "." in the numbers. If you put there 8, the head colour will be "0.12345678 0.62627384 1 1" and will likely exceed the length limit when sending to server.
Back to top Go down
XJayX

avatar

Female Posts : 10
Join date : 2015-09-04

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Sat Nov 14, 2015 6:01 am

Alright, I will edit the code as soon as I can.
The character files looked normal to me, but of course that was most likely because of the color values being either "1" or "0", so it wouldn't be adding numbers after a decimal to either look strange or cause an error.
Back to top Go down
Slain Motionless
Watched
avatar

Game username : The-Hunted
Server : Aroessa
Female Posts : 426
Join date : 2014-05-09
Age : 18
Location : Coding

PostSubject: Re: [Solved!] Character not saving correctly, defaulting to KovMat   Sun Nov 15, 2015 2:47 am

Seeing as this is solved, i'll be locking it and putting it in the solved bin. Glad the issue was fixed!
Back to top Go down
http://aroessa.proboards.com
 
[Solved!] Character not saving correctly, defaulting to KovMat
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support :: Solved Support Issues-
Jump to: