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 | 
 

 Animation Run/Walk problems

Go down 
AuthorMessage
DarkHeta

avatar

Game username : DarkHeta
Server : Eternal Time
Female Posts : 66
Join date : 2016-01-18
Age : 17
Location : Russia

PostSubject: Animation Run/Walk problems   Thu May 17, 2018 2:12 pm

There is the code

Quote :
//Swim
if (isSwimming)
{
speedMultiplier = (Real)((isMovingReverse() ? 0.25 : 1));
changeAnimBase("Swim", 0.8, animBase != "Swim");
return;
}

//Hover
Real tSpeed = Math::Abs(Vector2(mForce.x, mForce.z).squaredLength()) ;
if (antiGravity && tSpeed==0)
{
speedMultiplier = 1;
changeAnimBase("Hover", 0.8, animBase != "Hover");
return;
}



//Jump
if (distanceFromGround() > 0 && !antiGravity)
{
speedMultiplier = 1;
if (mForce.y > 0 && !hasDoubleJumped)
{
if (animBase != "Attack5" || animBase != "Attack5")changeAnimBase("JumpUp", 1, false, false, false);
}
else if (hasDoubleJumped)doDoubleJump();
else changeAnimBase("JumpDown", 1, animBase != "JumpDown");
if (animBase == "Attack5" || animBase == "Attack5")
{
if (mBodyEnt->getAnimationState(animBase)->hasEnded())changeAnimBase("JumpDown", 1, animBase != "JumpDown");
}
}

else
{
Real tSpeed = Math::Abs(Vector2(mForce.x, mForce.z).squaredLength());
bool bReverse = isMovingReverse();

//if(isPositionChanged() && tSpeed==0)tSpeed = 0.001;
if (isCrouching)speedMultiplier = 0.15;
else if (isWalking || bReverse)speedMultiplier = 0.25;

//Run
if (tSpeed>0 && !bReverse && !isWalking && !isCrouching && !antiGravity)
{
Real tAnimSpeed = (Real)((evt.timeSinceLastFrame == 0 ? 1.0 : tSpeed / (30000 * evt.timeSinceLastFrame)));
if (tAnimSpeed>1.0)tAnimSpeed = 1.0;
changeAnimBase("Run", (Real)1.5 + tAnimSpeed, animBase != "Run");
}

else if (isStance && tSpeed>0 && !bReverse && !isWalking && !isCrouching && !antiGravity)
{
Real tAnimSpeed = (Real)((evt.timeSinceLastFrame == 0 ? 1.0 : tSpeed / (30000 * evt.timeSinceLastFrame)));
if (tAnimSpeed>1.0)tAnimSpeed = 1.0;
changeAnimBase("Stance_Run", (Real)1.5 + tAnimSpeed, animBase != "Stance_Run");
}

//Crawl
else if (tSpeed>0 && isCrouching)
{
changeAnimBase("Crawl", 1, animBase != "Crawl", bReverse);
}
//Walk
else if (tSpeed>0 && (isWalking || bReverse))
{
changeAnimBase("Walk", 1.18, animBase != "Walk", bReverse);

}
else if (isStance&&tSpeed>0 && (isWalking || bReverse))
{
changeAnimBase("Stance_Walk", 1.18, animBase != "Stance_Walk", bReverse);
}
//Fly

if (antiGravity && tSpeed>0)
{
speedMultiplier = 1;
changeAnimBase("Fly", 0.8, animBase != "Fly");
return;
}

I want to change run animation, when char is in Stance, but... You seee...
I broke flying, running, walking and so on

Back to top Go down
https://vk.com/eternaltimenewserver
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 540
Join date : 2014-02-09
Age : 20

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 4:14 pm

try just changing the changeAnimBase within the run code itself like:

Code:
if (isStance) changeAnimBase("Stance_Run", (Real)1.5 + tAnimSpeed, animBase != "Stance_Run");
else changeAnimBase("Run", (Real)1.5 + tAnimSpeed, animBase != "Run");

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/ Online
DarkHeta

avatar

Game username : DarkHeta
Server : Eternal Time
Female Posts : 66
Join date : 2016-01-18
Age : 17
Location : Russia

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 4:43 pm

Code:
 //Run
 if (tSpeed>0 && !bReverse && !isWalking && !isCrouching && !antiGravity)
 {
 Real tAnimSpeed = (Real)((evt.timeSinceLastFrame == 0 ? 1.0 : tSpeed / (30000 * evt.timeSinceLastFrame)));
 if (tAnimSpeed>1.0)tAnimSpeed = 1.0;
 if (isStance)changeAnimBase("Stance_Run", (Real)1.5 + tAnimSpeed, animBase != "Stance_Run");
 else changeAnimBase("Run", (Real)1.5 + tAnimSpeed, animBase != "Run");
 }


 //Walk
 else if (tSpeed>0 && (isWalking || bReverse))
 {
 if (isStance)changeAnimBase("Stance_Walk", 1.18, animBase != "Stance_Walk", bReverse);
 else changeAnimBase("Walk", 1.18, animBase != "Walk", bReverse);
 }
Nothing happened :c
If to think, I try this method later
Back to top Go down
https://vk.com/eternaltimenewserver
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 540
Join date : 2014-02-09
Age : 20

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 4:49 pm

did you remove what you had before?

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/ Online
DarkHeta

avatar

Game username : DarkHeta
Server : Eternal Time
Female Posts : 66
Join date : 2016-01-18
Age : 17
Location : Russia

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 5:02 pm

Hyper wrote:
did you remove what you had before?

Yep

I did animations once before... But how... I totaly forgot and I missed that version of sourse
Back to top Go down
https://vk.com/eternaltimenewserver
Hamilton

avatar

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

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 5:25 pm

Code:
         //Run
         if(tSpeed>0 && !bReverse && !isWalking && !isCrouching)
         {
            Real tAnimSpeed = (evt.timeSinceLastFrame==0? 1.0 : tSpeed/ (30000*evt.timeSinceLastFrame));
            if(tAnimSpeed>1.0)tAnimSpeed = 1.0;
            changeAnimBase(isStance?"Run2":"Run", 1.5 + tAnimSpeed);
         }

Code:
         //Walk
         else if(tSpeed>0 && (isWalking||bReverse))
         {
            changeAnimBase(isStance?"Stalk":"Walk", 1.18, isStance?animBase!="Stalk": animBase!="Walk", bReverse);
         }

"Run2" and "Stalk" should be changed to what you named your stance-run/walk animations to.
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 540
Join date : 2014-02-09
Age : 20

PostSubject: Re: Animation Run/Walk problems   Thu May 17, 2018 5:35 pm

oh, i didnt see the walk one...hammys code does the same thing mine does, just includes the walk lol

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/ Online
Sponsored content




PostSubject: Re: Animation Run/Walk problems   

Back to top Go down
 
Animation Run/Walk problems
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-
Jump to: