SOLVED: AddWaypoint different speeds

Started by Slasher, Mon 26/01/2015 19:52:57

Previous topic - Next topic

Slasher

Hi,

Loop 1 and 2: same amount of frames, same sprite numbers (flipped for view 1) but loop 2 is slower than loop 1.

Code: ags

function room_RepExec()
{
  if (cTiger.Moving == false){
  cTiger.AddWaypoint(670, 367); // loop 2
  cTiger.AddWaypoint(458, 367);// loop 1 
}
}



cadeultra3

You are running in RepExec(). Why?
That code is run every frame. So you are setting the way points over and over again.

Slasher

#2
Because it is patrolling.

Even this has the same result:
Code: ags

 if (cTiger.Moving ==false){
 cTiger.Walk(670, cTiger.y);
 cTiger.AddWaypoint(458,  cTiger.y);
}
}


Gilbert

Just a random idea. Check whether there are delays set for the walking frames and whether these values match up in both loops, and also whether anti-glide mode is on. As when anti-glide mode is on, the character will only move when the animation frame changes, so if one of the loops has more delays than the other the character will walk slower in that direction.
This is what I can think of at the moment.

Slasher

Hi Iceboty V7000a,

There are no loop frame delays, only an overall delay of 4 for all.

In show preview the animation speed looks the same for both loops 1 and 2.

Anti-Glide is removed in 3.2.1 .
Code: ags

 cTiger.MovementLinkedToAnimation = false; // does not cure the different speed issues.


It's not a real major issues but it is niggling.


RetroJay

Hi Slasher.

The problem you are having is exactly what I have come across and I don't know why it does it.:(
I set a character to Walk to coords and then add a waypoint to make him come back.
He always walks faster going and slower coming back... Pixelated little pillock.(laugh)   

Mandle

Quote from: RetroJay on Wed 28/01/2015 05:59:19
Hi Slasher.

The problem you are having is exactly what I have come across and I don't know why it does it.:(
I set a character to Walk to coords and then add a waypoint to make him come back.
He always walks faster going and slower coming back... Pixelated little pillock.(laugh)   

Does upping the character's walk speed on the way back compensate for the problem or does it change nothing?

Slasher

#7
Hi,

from Mandle
QuoteDoes upping the character's walk speed on the way back compensate for the problem or does it change nothing?

well, after your suggestion about speed Mandle I did this and it seems ok now:

Code: ags


function room_RepExec()
{
 if (cTiger.Moving ==false && cTiger.Room==11)
 
 if(cTiger.Loop==1){
 cTiger.StopMoving();
 cTiger.SetWalkSpeed(8, 8);
 cTiger.Walk(680, cTiger.y);
 cTiger.Loop=2;
} 
 else if(cTiger.Loop==2){
 cTiger.StopMoving();
 cTiger.SetWalkSpeed(7, 7);
 cTiger.AddWaypoint(458,  cTiger.y);
 cTiger.Loop=1;
}
}


This is something that should be looked into in future editions.

Happy days.. I think (laugh)

cheers ;)



Mandle

Awesome...kind of a bandaid fix rather than a real one I guess...But whatever works eh?

MiteWiseacreLives!

Hi Slasher.
It looks like your missing a bracket in there, {
Does that work in game? Looks like to me the Tiger will never get to (680, cTiger.y).
(maybe you just snipped it off when copying?)

Slasher

Hi,

Quote(maybe you just snipped it off when copying?)
It's just one part of the script and it does it well enough ;)


SMF spam blocked by CleanTalk