I'm an idiot, I had not idea you could do that in properties with BASS enabled. For what it's worth, Khris' way worked too. Thanks everybody for your help.
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 Menufunction on_mouse_click(MouseButton button)
{
if (action != null)
{
action.Text = "";
}
if (!IsGamePaused() && (button == eMouseLeft || button == eMouseRight))
{
do_room_action(button);
}
else if (button == eMouseLeftInv || button == eMouseRightInv)
{
do_inventory_action(button, inventory[game.inv_activated]);
}
}
else if (button == eMouseLeftInv || button == eMouseRightInv)
{
inventory[game.inv_activated].RunInteraction(eModeInteract);
}
Quote from: Crimson Wizard on Tue 13/02/2024 13:18:53AGS does not have such feature built-in, so this has to be done by scripting a custom movement.
I do not have a ready code example, but my thinking is this:
- save the walk destination (x,y) in global variables, and start the walking;
- in function repeatedly_execute check if the character is walking, and which animation frame it is;
- - if character is walking, and this is a frame where character should pause, then stop walking, and run animation using Animate command (non-blocking)
- - if character is not walking, but a destination is saved, and animation has finished, then order to walk towards destination again.
- when character reaches the destination, reset the global variables (in order to avoid unnecessary walking further).
On a side note, I believe that such feature is worth planning for the future versions of the engine.
Quote from: Khris on Tue 13/02/2024 14:37:29The limp stopping mid-animation is always an issue but pretty much unavoidable unless you code completely custom walking.
Here's a very quick example of a limping walk-cycle:
// called when a mouse button is clicked
function on_mouse_click(MouseButton button)
{
{
if (DoubleClick.Event[eMouseLeft])
{
LocationType loc = GetLocationType(mouse.x, mouse.y);
if (loc == eLocationHotspot)
{
Hotspot *h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
h.RunInteraction(eModeDoubleClk);
}
}
}
// all clicks handled by TwoClickHandler script
}
function QuickExit_Interact() //Quickexit is name of my hotspot, change it to whatever you've called hotspot
{
Display("");
}
function QuickExit_Look()
{
Display("");
}
function QuickExit_Mode8()
{
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.060 seconds with 13 queries.