I played this game yesterday, Death (http://www.moddb.com/games/death-episode-1-the-scythe-of-unlimited-power), and I'm kinda new to ags still and I was wondering if anyone could tell me how these two things were done. So when you mouse over what I'm guessing is a hot spot the text of that thing appears ot the bottom of the screen would you use a GUI for this or what? Also when you left click it interacts and when you right click it looks, how is this done? Thanks in advance! ;)
Yup, use a GUI with a label. Look up Game.GetLocationName or @OVERHOTSPOT@ in the manual or by searching the forums.
For left click interact, right click examine, you'll just change the on_mouse_click function. Something like:
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
{
}
else if (button == eMouseLeft)
{
ProcessClick(mouse.x,mouse.y, eModeInteract);
}
else // right-click, so examine
{
ProcessClick(mouse.x,mouse.y, eModeLookat);
}
}
Like I said I am still very new, where exactly would I put the mouse code? ???
There should already be a on_mouse_click function in your global script file.
This is the code we used in Death episode 1.
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
{
if (IsGamePaused() == 1){
//Game is paused, so do nothing on any mouse click
}else{
if (button == eMouseLeft){
//left mouse button
if (GetLocationType(mouse.x, mouse.y) == eLocationNothing){
//not over hotspot so walk
ProcessClick(mouse.x, mouse.y, eModeWalkto);
}else{
//over a hotspot/object etc
if (mouse.Mode==eModeUseinv){
//using inventory on hotspot
ProcessClick(mouse.x, mouse.y, eModeUseinv);
}else{
//not using inventory, so Interact
ProcessClick(mouse.x, mouse.y, eModeInteract);
}
}
}else if (button == eMouseRight){
//right mouse button
if (mouse.Mode==eModeUseinv){
//inventory item out, so cancel it
mouse.Mode=eModeWalkto;
}else{
//no inventory item out, so look
ProcessClick(mouse.x, mouse.y, eModeLookat);
}
}else if (button == eMouseWheelNorth){
//mouse wheel up
}else if (button == eMouseWheelSouth){
//mouse wheel down
}
}
}
Not sure if I should start an new thread, but I was wondering how you install modules? I want to try this one for the bottom screen text, when over hotspot.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26306.0
http://www.youtube.com/watch?v=drsb_Dvw-yM
Here's a visual way.