Post by 無限 on Jan 9, 2016 5:03:07 GMT
instructions on how to achieve effect
Open up the Script.nsd of the mech you want to add it too.
then modify the said lines in each step.
step 1 & 2 are the only steps needed to get basic 0g movement working. after that refines the movement to be easier to handle.
1. add this line to top of the file
const isZeroGravity = 1; //0g Toggle. 1 = on. 0 = off
2. Modify Grav function
// 重力
before edit
function Grav(ritu = 1.0)
{
if(Robo.vF.y > -0.8){
Robo.vF.y -= 0.01 * ritu;
}
}
// 重力
after edit
function Grav(ritu = 1.0)
{
if(Robo.vF.y > -0.8 && isZeroGravity == 0){
Robo.vF.y -= 0.01 * ritu;
}
}
3. Modify these lines in ACT_HitDown and ACT_HitDown2
before edit
if(Robo.GetPartsData(0).GetNowAnimePos() > 10){
if(Robo.SkyFlag == 0){
if(g_DownData.nType == 1){
g_AnimeMgr[0].ChangeAnime(ANIME.DOWN,0,0);
}
else if(g_DownData.nType == 2){
g_AnimeMgr[0].ChangeAnime(ANIME.DOWN2,0,0);
}
return 1;
}
}
after edit
if(Robo.GetPartsData(0).GetNowAnimePos() > 10){
if(Robo.SkyFlag == 0 || isZeroGravity == 1){
if(g_DownData.nType == 1){
g_AnimeMgr[0].ChangeAnime(ANIME.DOWN,0,0);
}
else if(g_DownData.nType == 2){
g_AnimeMgr[0].ChangeAnime(ANIME.DOWN2,0,0);
}
return 1;
}
}
4. Modify these lines in ACT_JumpStop (this will help improve movement in the air)
before edit
Robo.GetMat().Move(Robo.vF);
local MovePow = CVector3();
MovePow.Set(g_MoveDir);
MovePow.Scale(g_Speed*g_AddSpeedRate);
Robo.GetMat().Move(MovePow);
after edit
if (isZeroGravity == 0){
Robo.GetMat().Move(Robo.vF);
local MovePow = CVector3();
MovePow.Set(g_MoveDir);
MovePow.Scale(g_Speed*g_AddSpeedRate);
Robo.GetMat().Move(MovePow);
}
TIPS and Recommendations:
its recommended to do 0g with infinite boost (link to infinite boost thread)