HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
The domain www.kitopen.com will expire on 2018-08-17. Update your bookmarks to point at http://kito.forumotion.com/
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Character Screen - Positioning Problems (SOLVED somehow)

Go down 
AuthorMessage
Banditka95

avatar

Game username : Banditka95
Server : Reflection Of Spirits (Owner)
Female Posts : 72
Join date : 2016-02-01
Age : 21
Location : Somewhere far away

PostSubject: Character Screen - Positioning Problems (SOLVED somehow)   Thu May 31, 2018 9:04 pm

I tried solving this problem for 2 days now, however, without success... I read through every existing thread made for this topic to find any small tipp, a solution etc. but nothing really helped...

I want that the playermodel stands on the "/position" i got ingame and that the camera is zoomed perfectly to it aswell ofc but no matter what i do in the coding it never turns out correct.

1stPic=where he is supposed to stay
2ndPic=CharacterEditor
3rdPic=CharacterSelection


The coordinates i calculated for me are following:
50, 18.75, 50 <-- Is the "real" in-game value where the playermodel is supposed to stay
50, 22.5, 50 <-- Is the one i used which is when flying in the sky, because i read that the model should be a bit above the real position on a max sized character.
65, 15.5, 30 <-- 2nd Value
85, 15.5, 54<-- 3rd Value

And this is inside my coding:
Code:
bool MagixCharScreenManager::update(const FrameEvent &evt, const Real &x, const Real &y)
{
 //First page, stop any rotation and check if game started
 if (page == PAGE_SELECT)
 {
 stopRotateUnit();
 if (startGameCount>0)
 {
 startGameCount -= evt.timeSinceLastFrame;
 mBackdrop->setDimensions((Real)(1 + (3 - startGameCount) / 3 * 0.4), (Real)(1 + (3 - startGameCount) / 3 * 0.6));
 mBackdrop->setPosition(-(mBackdrop->getWidth() - 1) / 2, -(mBackdrop->getHeight() - 1) / 2);
 const Vector3 tVect = mUnit->getPosition(true) + mUnit->getObjectNode()->getOrientation()*Vector3(0, 1, 4) - Vector3(50, 22.5, 50);
 mSceneMgr->getCamera("PlayerCam")->setPosition(Vector3(50, 22.5, 50) + tVect*(3 - startGameCount) / 3 * 0.25);
 if (startGameCount <= 0)
 {
 startGameCount = 0;
 mBackdrop->setMaterialName("GUIMat/Backdrop1");
 mBackdrop->setDimensions(1, 1);
 mBackdrop->setPosition(0, 0);
 return true;
 }
 }

 return false;
 }

Code:
if (mUnit->getObjectNode())
 {
 //Rotate unit
 mUnit->yaw(dYaw);
 mUnit->getObjectNode()->yaw(dYaw);
 //Camera zoom
 const Vector3 tVect = mUnit->getPosition(true) + mUnit->getObjectNode()->getOrientation()*Vector3(0, 1, 4) - Vector3(50, 22.5, 50);
 mSceneMgr->getCamera("PlayerCam")->setPosition(Vector3(50, 22.5, 50) + tVect*camZoom);
 }
 return false;
}

Code:
void MagixCharScreenManager::positionUnitForEdit()
{
 mSceneMgr->getCamera("PlayerCam")->setOrientation(Quaternion(Degree(-80), Vector3::UNIT_Y));
 if (!mUnit->getObjectNode())return;
 mUnit->setPosition(85, 15.5, 54);
 mUnit->resetTarget();
 mUnit->setGroundHeight(15.5);
 mUnit->yaw(Degree(-120));
 mUnit->getObjectNode()->yaw(Degree(-120));
 mUnit->setFreeLook(false, false);
}
void MagixCharScreenManager::positionUnitForSelect()
{
 mSceneMgr->getCamera("PlayerCam")->setOrientation(Quaternion(Degree(-40), Vector3::UNIT_Y));
 mSceneMgr->getCamera("PlayerCam")->setPosition(85, 15.5, 54);
 if (!mUnit->getObjectNode())return;
 const Real tDist = (mUnit->getObjectNode()->getScale().x - 1)*-11;
 mUnit->setPosition((Real)(50 - (tDist<0 ? tDist : 0)*0.6), (Real)(22.5 + (tDist<0 ? tDist : 0)), (Real)(50 + (tDist<0 ? tDist : 0)*0.6));
 mUnit->resetTarget();
 mUnit->setGroundHeight(18 + (tDist<0 ? tDist : 0));
 mUnit->yaw(Degree(-80));
 mUnit->getObjectNode()->yaw(Degree(-80));
 mUnit->setFreeLook(false, false);
 mUnit->update(FrameEvent(), mDef);
}

Code:
case GAMESTATE_STARTCHARSCREEN:
 if (mCamera->getCamera()->isAttached())mCamera->getActiveCamNode()->detachObject(mCamera->getCamera());
 mCamera->getCamera()->setPosition(50, 22.5, 50);
 mCamera->getCamera()->setOrientation(Quaternion(Degree(-40), Vector3::UNIT_Y));
 mSkyManager->showSky(true);
 mSkyManager->setDayTime(1810);
 mSkyManager->setWeatherTime(0);
 mSkyManager->setWeatherCycle("");
 mSkyManager->update(evt);
 mWorld->loadWorld(MAP_DEFAULT);
 mCollisionManager->destroyAllPortals();
 mCollisionManager->destroyAllGates();
 mWorld->update();
 mGui->showCharScreenOverlay(true);
 mGui->getCharScreenManager()->reset(true);
 mGui->loadChar();
 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), "Bloom", mGui->isBloom());
 CompositorManager::getSingleton().setCompositorEnabled(mWindow->getViewport(0), "BlackAndWhite", mGui->getIsBW());
 mGameStateManager->setGameState(GAMESTATE_CHARSCREEN);
 break;

PLEASE someone help ;w;


Last edited by Banditka95 on Sat Jun 02, 2018 2:22 pm; edited 2 times in total
Back to top Go down
http://reflectionofspirits.freeforums.net
Tigg

avatar

Game username : Tigg
Server : Impressive Title by Tigg
Female Posts : 151
Join date : 2017-08-01
Age : 35
Location : Austria

PostSubject: Re: Character Screen - Positioning Problems (SOLVED somehow)   Thu May 31, 2018 9:25 pm

I cant compare it right now since its too late, but my experience as i edited it (for hours), you are best only fiddling with just one number at a time.

Sometimes the numbers need to be changed very very slightly. You need to adjust the character and the camera.

If you really cant get it to work, you could just change which map is loaded up and adjust the meshes inside of it. But that could also be a heck of work.
Back to top Go down
http://www.tiggcreations.com
Banditka95

avatar

Game username : Banditka95
Server : Reflection Of Spirits (Owner)
Female Posts : 72
Join date : 2016-02-01
Age : 21
Location : Somewhere far away

PostSubject: Re: Character Screen - Positioning Problems (SOLVED somehow)   Thu May 31, 2018 9:42 pm

Hmm do you know which codes here are for the camera only and which for the position only? Because i could then try to adjust the position first and then the camera?

(btw i see you live in austria me too Surprised)
Back to top Go down
http://reflectionofspirits.freeforums.net
Banditka95

avatar

Game username : Banditka95
Server : Reflection Of Spirits (Owner)
Female Posts : 72
Join date : 2016-02-01
Age : 21
Location : Somewhere far away

PostSubject: Re: Character Screen - Positioning Problems (SOLVED somehow)   Sat Jun 02, 2018 2:16 pm

Nvm i solved it somehow. Thank you anyways ^^.
Back to top Go down
http://reflectionofspirits.freeforums.net
Sponsored content




PostSubject: Re: Character Screen - Positioning Problems (SOLVED somehow)   

Back to top Go down
 
Character Screen - Positioning Problems (SOLVED somehow)
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: