Hi there!
See, I tried making this Lucasart-style status bar (a GUI with a label, lAction), that shows the action you can do with every object or hotspot in the room. The thing is, I also want , with certain objects, characters or hotspots, the status bar to display a different text (for example, if the mouse is in Interact mode on a door, instead of the usual "Use Door" there would be a "Open Door")
So, I writed this on the global script:
Code: ags
I made it work with hotspots, using the "Hotspot_Mousemove" function... but the problem comes with Objects and Characters. I tried using this code in one Room with an object:
Code: ags
But it doesn't work, the Status Bar displays "Use" instead of "Mess with". What did I do wrong? Any solution or alternative? Thanks in advance, folks!
See, I tried making this Lucasart-style status bar (a GUI with a label, lAction), that shows the action you can do with every object or hotspot in the room. The thing is, I also want , with certain objects, characters or hotspots, the status bar to display a different text (for example, if the mouse is in Interact mode on a door, instead of the usual "Use Door" there would be a "Open Door")
So, I writed this on the global script:
function repeatedly_execute()
{
GetGlobalInt(1);
if (GetLocationType(mouse.x,mouse.y) == eLocationNothing) {
SetGlobalInt(1, 0);
lAction.Visible=false;}
else {lAction.Visible=true;
if (Mouse.Mode==eModeWalkto){lAction.Text = "Go to";}
if (Mouse.Mode==eModeLookat) {lAction.Text = "Look at";}
if (Mouse.Mode==eModeTalkto){lAction.Text= "Talk with";}
if (Mouse.Mode==eModePickup){lAction.Text="Pick";}
if(Mouse.Mode==eModeInteract){if(GetGlobalInt(1)==0){lAction.Text="Use";}else if (GetGlobalInt(1)==1){lAction.Text=Game.GlobalStrings[1];}}
}
I made it work with hotspots, using the "Hotspot_Mousemove" function... but the problem comes with Objects and Characters. I tried using this code in one Room with an object:
function repeatedly_execute()
{if (Object.GetAtScreenXY(mouse.x,mouse.y) == oescultura){SetGlobalInt(1, 1);Game.GlobalStrings[1]="Mess with";}}
But it doesn't work, the Status Bar displays "Use" instead of "Mess with". What did I do wrong? Any solution or alternative? Thanks in advance, folks!