Hi, its me again, with a problem that I really have no clue(I remained totally clueless) how to fix !
For some reason in my game any click registers as x2 click. For example, If I want to trigger an animation via hotspot click, even if I assign the view as eOnce, it behaves like I click it 2 times, animating it TWICE at once. The same if I had - say - a keypad puzzle, it registers the clicks as x2 times. I have a script that changes the cursor while hovering over objects, but It does not change the 'cursor mode', - but the graphics of the cursor...I dont know why that is happening D:
I think I need to post all the script from my on mouse click from the global script and anything related to the mouse in general,
I really cant see why this happens 😦
for example while triggering GUI's, it only registers 'one' click, not x2 as it does on anything related to adding characters to strings or triggering animations
Code: ags
(its a script that makes you able to click away with an inventory item and make it dissapear, returning the 'normal' cursor)
And the one that changes the mouse graphic while hovering over hotspots/objects
Code: ags I also did some weird stuff to be able to add my own 'cursor graphic' on some very specific hotspots(thus disabling the always execute thing)
Code: ags
Im sure its because of the way I implemented these scripts ! (For context, the objects/hotspots that trigger certain events that play x2 times are linked only once. I tried to change the 'any click' from 'interact' and whatnot, and its still the same behaviour)
For some reason in my game any click registers as x2 click. For example, If I want to trigger an animation via hotspot click, even if I assign the view as eOnce, it behaves like I click it 2 times, animating it TWICE at once. The same if I had - say - a keypad puzzle, it registers the clicks as x2 times. I have a script that changes the cursor while hovering over objects, but It does not change the 'cursor mode', - but the graphics of the cursor...I dont know why that is happening D:
I think I need to post all the script from my on mouse click from the global script and anything related to the mouse in general,
I really cant see why this happens 😦
for example while triggering GUI's, it only registers 'one' click, not x2 as it does on anything related to adding characters to strings or triggering animations
// called when a mouse button is clicked
function on_mouse_click(MouseButton button)
{
if (button == eMouseLeft) {
// left-clicking nothing with active inv item
if (GetLocationType(mouse.x, mouse.y) == eLocationNothing && player.ActiveInventory != null) {
player.ActiveInventory = null;
Mouse.Mode = eModeInteract;
}
else Room.ProcessClick(mouse.x, mouse.y, Mouse.Mode);
}
(its a script that makes you able to click away with an inventory item and make it dissapear, returning the 'normal' cursor)
And the one that changes the mouse graphic while hovering over hotspots/objects
function repeatedly_execute()
{
if (player.ActiveInventory ==null){
if (GetLocationType(mouse.x, mouse.y) != eLocationNothing) {
// Set the variable to true when the mouse is over a hotspot
if (!isOverHotspot) {
// Execute global script only when entering a hotspot
Mouse.ChangeModeGraphic(mouse.Mode, 24);
aMousetape.Play();
}
isOverHotspot = true;
} else {
// If the mouse is not over a hotspot, execute the global script
if (!isOverHotspot) {
Mouse.ChangeModeGraphic(mouse.Mode, 22);
}
// Reset the variable
isOverHotspot = false;
}
}
}
function on_mouse_over_hotspot()
{
// Disable global script when over a hotspot
isOverHotspot = true;
}
// Handle mouse leave hotspot event
function on_mouse_leave_hotspot()
{
// Enable global script when leaving a hotspot
isOverHotspot = false;
}




