Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Vincent

#621
well yeah... if i hide the HandleMovement();
it's just like the module is beign cutted off
and not any purpose then
with some trick //
i can join both together very nice..
as example
in room 1 i can trigger a gravity jump
and walking/running the player in diagonal
also while walking in a new high platform.
(with Alt Keyboard Movement is simply Amazing)
(not that's the same from the standard module KeyboardMovement using with the gravity jump)
#region then, are usefull for setting limits to the player
player.IsStandingOnRegion(1) { player.PlaceOnWalkableArea();}
and will not fall to underground
It's actually good stuff together


the description you did it's exactly what i wish for
probably i should give a global timer that animate the idle view taking out from modules
something like
in GlobalScript.ash
#define TIMER_IDLE_VIEW  1
in GlobalScript.asc
function IDLE_VIEW() {
if (!KeyboardMovement.Animating() && was_animating) { SetTimer(TIMER_IDLE_VIEW, 160); }

if (IsTimerExpired(TIMER_IDLE_VIEW))
{
// animate the idle view avoid Alt KeyboardMovement Loops ,
// if keyboard is animating then, normal view/walking
// How Khris could you do something alike to do the trick ?
// i wish you could help me with this
}

#622
Well, I'm also using a gravity jump module that it work nice
Maybe cause contrast with it

Code: ags


// Original module 'Platform Movement v0.01a' Author: Bernie 

// Overhauled By VinVin




//===================================================================
//This extension is actually more like an experiment 
//and only allows customized controls through direct module code editing. 
//It demonstrates a simple way of coding a platform gravity jump.
//A quick explanation of the module's values:
//if gravity is lower than 0, it makes the character go up. The lower, the faster. 
//If it's greater, the character moves down, the greater, the faster.
//xmove behaves the same way, only on the x axis. 
//below zero is left, above zero is right.
//===================================================================







void repeatedly_execute() {
  
  
int a;
while ((gravity>0)&&(a < gravity)){ if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0) {player.y=player.y +1;} 
//1 down if no walkable area found
a=a+1;
}

int b;
while ((gravity<0)&&(b > gravity)){ if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0) {player.y=player.y -1;} 
//1 up if no walkable area found above
b=b-1;
}




//===================================================================
//managing movement values and gravity--
//===================================================================
if (gravity < 6) {gravity=gravity+1;}
if ((IsKeyPressed(377)==1)&&(xmove<1)) {xmove=xmove+1;}//right
if ((IsKeyPressed(375)==1)&&(xmove>-1)) {xmove=xmove-1;}//left
if ((IsKeyPressed(375)==0)&&(IsKeyPressed(377)==0)&&(xmove<1)) {xmove=xmove+1;}//right
if ((IsKeyPressed(375)==0)&&(IsKeyPressed(377)==0)&&(xmove>-1)) {xmove=xmove-1;}//left
if (((IsKeyPressed(375)==0 && IsKeyPressed(380)==0 && IsKeyPressed(377)==0 && xmove>0 ))) {xmove=xmove-1;}
if (((IsKeyPressed(375)==0 && IsKeyPressed(380)==0 && IsKeyPressed(377)==0 && xmove<0 ))) {xmove=xmove+1;}

//===================================================================






//===================================================================
//diagonal stuff--
//===================================================================
if ((IsKeyPressed(372)==1) || IsKeyPressed(32)==1){ 
if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())>0) {player.y=player.y-1;}
player.y=player.y+2;
//===================================================================






//===================================================================
//jump----------------------------------
//===================================================================
if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==1) {gravity=-20;}  // jump
player.y=player.y-2;
}
//===================================================================


if ((player.View==13 && (IsKeyPressed(372)==1))){
player.ManualScaling=true;
player.Scaling=150;
player.LockView(5);
}
if (IsKeyPressed(372) && IsKeyPressed(eKeyDownArrow)){
  player.PlaceOnWalkableArea();
}



//===================================================================
//left and right 
//uses the same logic as moving up and down 
//but has additional checks so uneven terrain won't cause problems
//right---------------------------------
//===================================================================
int d;

while ((xmove>0)&&(d < xmove)){

player.x=player.x+1;
if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0) {player.x=player.x+1;}
player.x=player.x-1;

player.x=player.x+1;
//int check=0;


if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())>0) {check_gravity=1;}
player.y=player.y+1;
if ((GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0)&&(check_gravity==1)) {player.y=player.y+1;}
player.y=player.y-1;
   

 d=d+1;
}




//===================================================================
//left---------------------------------
//===================================================================
int c;
while ((xmove<0)&&(c > xmove)){



player.x=player.x+1;
if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0) {player.x=player.x-1;}
player.x=player.x-1;

player.x=player.x-1;
//int check=0;


if (GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())>0) {check_gravity=1;}
player.y=player.y+1;
if ((GetWalkableAreaAt(player.x-GetViewportX(),player.y-GetViewportY())==0)&&(check_gravity==1)) {player.y=player.y-1;}
player.y=player.y-1;

 
 c=c-1;
  }

}

#623
Firstly, Thanks So Much Khris For Your Respond, Very Appreciated !!! :-D

I'm Not So Sure Where I Should Put The KeyboardMovement.SetIdleView(int view, int delay) line...
I Put It In The game_start section firstly...

Code: ags


#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() {
KeyboardMovement.SetMovementKeys(eKMMovementArrowKeys);
Game.SpeechFont=eFontFont3;
player.SetWalkSpeed(5, 5);
cCkid.SetWalkSpeed(7, 7);
SetBackgroundFrame(0);
srSetSnowAmount(700);
srSetWindSpeed(9);
cCkid.FaceLocation(1, 192);
cCkid.ManualScaling=true;
cCkid.Scaling=107;
cCkid.Transparency=100;
BtnarmorEquip.Visible=false;
eShadow.Disable(player);
SmoothScroll_ScrollingOn();
SmoothScroll_PxOn();
KeyboardMovement.SetIdleView(7, 0);
}
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE


Then, I Move It In The Section repeatedly_execute()
or in the repeatedly_execute_always()
But
He Still Loop The Idle View... 
(Maybe Cause My idleview delay was to 0 ) ?!
When I Put The IdleView Delay To 40... well... nothing will happen ! =(

The Trouble is not when it start the idle view...
But it's that he loop the idle view very very much...
Maybe there is a contrast with The void HandleMovement() ?
I Tried To Hide //HandleMovement() and it work good...
But then the character don't use anymore the walkview...
Just like he Move (as example player.move)
#624
I Love This Module so much !  It Is Pretty Much Perfect ! Thank You Khris For Exist :)

May I should move this topic to beginning area...
I'm Having Hard Times to set the  KeyboardMovement.SetIdleView(int view, int delay);
When I do that, my Player set the idleview for an instant, then, he start to Loop the Idle view...

I'm trying to figure out the latest sentence

Code: ags

void repeatedly_execute() {

  if (Enabled) HandleMovement();

  if (IdleView == 0) IdleView = player.IdleView;
  if (KeyboardMovement.Animating() && !was_animating) player.SetIdleView(-1, 0);
  if (!KeyboardMovement.Animating() && was_animating) player.SetIdleView(IdleView, IdleDelay);
  was_animating = KeyboardMovement.Animating();

} 

#625
I Love FMV Games :)
I Look Forward To Play This
SMF spam blocked by CleanTalk