Menu

Show posts

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 Menu

Messages - MikeDraven

#1
I found the solution, thanks to a similar topic on this forum (and modified it a bit).

Maybe it'll help someone too.

Code: ags

function room_Load()
{
gBottomBar.Visible = false;
mouse.Mode = eModePointer;
}

function on_mouse_click(MouseButton button) // called when a mouse button is clicked
{
 if (button == eMouseLeft) 
  {
    if (mouse.Mode == eModePointer)
    {
      // if there's a hotspot under mouse cursor
      if (GetLocationType(mouse.x, mouse.y) == eLocationHotspot)
      {
        // then fire "anyclick" event
        Room.ProcessClick(mouse.x, mouse.y, eModePointer);
        return; // do not do anything else
      }
    }
    // in all other cases - just do default action
    Room.ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
}
#2
Hi,
I'm using the default VerbCoin.
I want to disable the verbcoin GUI on the title screen.

There's 3 hotspots - start game, load game, quit game.

I've tried something like this:

Code: ags

function room_Load()
{
gBottomBar.Visible = false;
mouse.Mode = eModePointer;
VerbCoin.Disable();
}

function hStart_AnyClick()
{
  player.ChangeRoom(1);
}

function hLoad_AnyClick()
{
  lstRestoreGamesList.FillSaveGameList();
  gRestoreGame.Visible = true;
}

function hQuit_AnyClick()
{
  QuitGame(0);
}


But it doesn't work.
I mean - when I use VerbCoin.Disable(); - the cursor remains in pointer mode, but clicking on hotspots don't do anything.

How to disable the VerbCoin and make AnyClick events work?
#3
Quote from: eri0o on Thu 06/05/2021 15:22:04
Easier way would be to place cGuy.Name = "John"; directly in the dialog script.

Heh, I guess I was thinking too hard. Your way worked like a charm! Thanks!

(and the function was called by cGuy event Usermode 1 - but I probably used it wrong, like I said, I started with AGS a few days ago ;) )
#4
Hi!
I've started using AGS a few days ago, but I'm a quick learner.

My question is: how can you change the name of a character (RealName) using the IF statement?

I'll show you my example and what I want to achieve.

I've got an NPC, let's say he's described as "Little guy" (RealName) and his ScriptName is cGuy. The player talks to him and asks who is he (Dialog option #1). The NPC responds that his name is "John".

And now I want the RealName of this character to be "John" (or at least that should be displayed as hotspot, so maybe I'm overthinking it?).

I've tried something like this:

Code: ags

function cGuy_Identity()
{
  if(dGuyStart.HasOptionBeenChosen(1)) {
    cGuy.Name = "John";
  }
}




But it doesn't seem to work.
Any ideas? :)
SMF spam blocked by CleanTalk