Hi all - my first post so feel free to tell me if i have done anything wrong here. I did search the manual and forums but cant find this specific issue referenced sorry.
My problem goes as follows:
Walk-able areas all work perfectly on the room I am having issues with - except for a specific issue. I have found a solution that works but it isn't very elegant and is for want of a better word "CLUNKY".
Imagine you have a scrolling room (2560 x 720) and your character starts at the top right of the screen. He needs to walk in a "C" shape walk-able area from the top right corner (POINT A) to the bottom right corner (POINT B) when you click the left mouse button to walk. You can see point A and point B on the same side of the screen.
The walk-able area (the C Shape) extends the full width of the room - so not all of the walk-able area your character will use is on the viewable screen at once (1280 x 720). (The walk-able area is also split in three equal segments, all of which can be navigated perfectly in a manual arc or between any two points of the arc that are connected, and on the screen at once i.e. there is no issue with the set up of the areas)
My testing shows that if you attempt to walk from point A to point B in a single click, it will not respond. You have to instead tease the character along the walk-able pathway around the c-shape manually which works, but.... id rather the user clicks once to perform the task to head to point B.
My workaround for this is to test at what position my character is stood on the screen using the following:
Code: ags
Then I use the values provided to create an if statement as below. This checks if the player is at or above a certain point on the curve, and then if they are above the test value, it gradually walks the player around the curve from point A to point B. If they are NOT above that value then do something else.
Code: ags
Now the issue with this is three fold.
1) Its a lot of coding for something so simple - so there is probably a better way that i am unaware of in my AGS infancy.
2) you HAVE to use eBlock for it to work at all, meaning that if this is a long pathway - the user has no escape if they clicked it by accident. I would rather avoid that. If you do not use eBlock, the character does not move.
PLEASE NOTE ALSO - if you use an eBLOCK script line to try and go directly from Point A to Point B - this also doesn't work - you still need to navigate the curve in several steps.
3) if the path was more complicated then there would be many more variables of the y position to consider and even more code. (this needs applying to all clicks such as Talk To, Interact etc - that span the whole curve.)
Help, criticism, and ridicule where valid are all welcomed
!!!! Thank you in advance.
My problem goes as follows:
Walk-able areas all work perfectly on the room I am having issues with - except for a specific issue. I have found a solution that works but it isn't very elegant and is for want of a better word "CLUNKY".
Imagine you have a scrolling room (2560 x 720) and your character starts at the top right of the screen. He needs to walk in a "C" shape walk-able area from the top right corner (POINT A) to the bottom right corner (POINT B) when you click the left mouse button to walk. You can see point A and point B on the same side of the screen.
The walk-able area (the C Shape) extends the full width of the room - so not all of the walk-able area your character will use is on the viewable screen at once (1280 x 720). (The walk-able area is also split in three equal segments, all of which can be navigated perfectly in a manual arc or between any two points of the arc that are connected, and on the screen at once i.e. there is no issue with the set up of the areas)
My testing shows that if you attempt to walk from point A to point B in a single click, it will not respond. You have to instead tease the character along the walk-able pathway around the c-shape manually which works, but.... id rather the user clicks once to perform the task to head to point B.
My workaround for this is to test at what position my character is stood on the screen using the following:
Display("The player is at %d,%d.", player.x, player.y);
Then I use the values provided to create an if statement as below. This checks if the player is at or above a certain point on the curve, and then if they are above the test value, it gradually walks the player around the curve from point A to point B. If they are NOT above that value then do something else.
if (player.y >= 592) {
player.Walk(788, 638, eBlock, eWalkableAreas);
player.Walk(117, 614, eBlock, eWalkableAreas);
player.Walk(1076, 543, eBlock, eWalkableAreas);
}
else
{
player.Walk(1076, 543, eNoBlock, eWalkableAreas);
}
Now the issue with this is three fold.
1) Its a lot of coding for something so simple - so there is probably a better way that i am unaware of in my AGS infancy.
2) you HAVE to use eBlock for it to work at all, meaning that if this is a long pathway - the user has no escape if they clicked it by accident. I would rather avoid that. If you do not use eBlock, the character does not move.
PLEASE NOTE ALSO - if you use an eBLOCK script line to try and go directly from Point A to Point B - this also doesn't work - you still need to navigate the curve in several steps.
3) if the path was more complicated then there would be many more variables of the y position to consider and even more code. (this needs applying to all clicks such as Talk To, Interact etc - that span the whole curve.)
Help, criticism, and ridicule where valid are all welcomed
