I'm trying to implement a "downhill" situation without the Downhill module.
What it means :
- The player walks DOWNWARDS (increasing Y coordinate)
- BUT In also want to show him walking with his BACK turned to the camera (as if his Y coordinate was decreasing).
The following code snippet fails to achieve that. The character keeps facing the camera the whole time What am I doing wrong?
player.StopMoving();
StartCutscene(eSkipESCOrRightButton);
int characterWalkView = 91; int loopWalkNorth = 3; int loopWalkSouth = 0;
player.LockView(characterWalkView , eKeepMoving); Wait(1);
player.FaceDirection(eDirectionUp);
player.Animate(loopWalkNorth, 2, eRepeat, eNoBlock, eForwards);
player.Walk(player.x, payer.y+50, eBlock, eAnywhere); //walk downhill
player.UnlockView(eKeepMoving);
EndCutscene();
Note: I've tried replacing .Walk with .Move but it doesn't work either : It seems like the movement speed is now very high (the player almost teleports). Also we can see his back but I'm not even sure it's animated (but that might be because it's super fast)
What about making separate walking view with swapped directions and doing ChangeView instead of LockView, and Walk normally?
PS. For the reference, this was from an old project I was working on (cancelled or suspended):
function WalkDownTheDune(this Character*, int walkView, int duneHeight, int walkBehindArea)
{
SetWalkBehindBase(walkBehindArea, 200);
this.LockView(walkView);
this.Animate(3, 0, eRepeat, eNoBlock, eForwards);
int w = this.WalkSpeedY;
this.SetWalkSpeed(this.WalkSpeedX, 1);
this.Move(this.x, this.y + duneHeight, eBlock, eAnywhere);
this.SetWalkSpeed(this.WalkSpeedX, w);
this.UnlockView();
}
function WalkUpTheDune(this Character*, int walkView, int duneHeight, int walkBehindArea, int topX, int topY)
{
SetWalkBehindBase(walkBehindArea, 200);
this.x = topX;
this.y = topY + duneHeight;
this.LockView(walkView);
this.Animate(0, 0, eRepeat, eNoBlock, eForwards);
int w = this.WalkSpeedY;
this.SetWalkSpeed(this.WalkSpeedX, 1);
this.Move(this.x, this.y - duneHeight, eBlock, eAnywhere);
this.SetWalkSpeed(this.WalkSpeedX, w);
this.UnlockView();
SetWalkBehindBase(walkBehindArea, 0);
}
So there I used Move actually, but changed Y speed. Too bad I don't remember why.
If he's meant to always have his back to the camera, shy not just change the walk view, where all loops are back views? Then you would just have to deal with the inverted y. Or am I missing some key detail?
Changing the entire view (even if only temporarily) is a good-enough workaround. I'll try it.
Thanks