1
Programming with Blackvoxel / Re: Programmatic handling of the player
« on: November 28, 2019, 12:46:58 am »
I have not used those function too. Indeed throwing the user anywhere to the sky rapidly kill it. There is programmation exemples but i cannot remember where i found then. I noticed that this code cause the player to go up really fast. I usually finish this with "u" (stop all robots). Use this onderground only!
Voxel_Step()
{
local Diff = GetInfo(5) - GetY();
if (GetZ() == GetInfo(6)) // && Diff>0 && Diff<4)
{
PlayerSetAccel(0.0, 1500.0, 0.0)
if (Diff>1) Move(4);
}
}
For horizontal displacments, I could not manage to use PlayerSetAccel and used PlayerMove instead. I really cannot figure out what the numbers figures, player displacement seems not proportionnal to the numbers given in arguments but
PlayerMove(15.0, 0.0, 0.0);
seems to safelly displace the player by 23 voxels if the place is empty with a ground.
You may want to foound a way to limit the number of UP to 16, 32 or 64 voxel depending upon the extraction robot you are using...
Voxel_Step()
{
local Diff = GetInfo(5) - GetY();
if (GetZ() == GetInfo(6)) // && Diff>0 && Diff<4)
{
PlayerSetAccel(0.0, 1500.0, 0.0)
if (Diff>1) Move(4);
}
}
For horizontal displacments, I could not manage to use PlayerSetAccel and used PlayerMove instead. I really cannot figure out what the numbers figures, player displacement seems not proportionnal to the numbers given in arguments but
PlayerMove(15.0, 0.0, 0.0);
seems to safelly displace the player by 23 voxels if the place is empty with a ground.
You may want to foound a way to limit the number of UP to 16, 32 or 64 voxel depending upon the extraction robot you are using...