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 - johanvepa

#21

I am doing a function that checks if the mouse hovers over a region. If it does, and the cursor is not PickUp, then it should change to PickUp.

I am doing this:
Code: ags




function room_RepExec()
{
  if (Region.GetAtRoomXY(mouse.x, mouse.y) == Region[1])
  {
    if (mouse.Mode != eModePickup)
    {
      mouse.Mode = eModePickup;
    }
  }


since the manual told me this is a correct example:
if (Region.GetAtRoomXY(player.x, player.y) == region[0])
  Display("The player is not currently standing on a region.");

But AGS tells me that Region is not an array. What is wrong here?
#22
Well actually I was thinking about a monster chase across several screens, and perhaps the easiest solution is the big room. Thank you for your help.
#23
I think perhaps the solution with the very large room and no scrolling may be what I'm looking for. It is a large labyrinthine game area with a lot of similar rooms. I was wondering how to make a function that carries across several rooms, too, and your room-of-many-rooms gives an excellent solution to that as well. Thank you.
#24
I remember the original Quest for Glory II had a nice feature where walking in the desert would cause the background to change by a quick sideways scroll from one screen to the other, rather than fading. This looked quite nice, I thought, and for backgrounds that fit nicely into each other without wanting the background to scroll as the players walk around, this is a nice touch to a game.

But how to do that?
#25
Use an "if" condition.

Might be tricky because the NPC may stop-and-go, but its an option.
#26
I got a remake of the old Quest for Glory font, that's a very nice font.
#27
I read what you said, only I misunderstood the context. But I think I get it now. And thank you very much. In combination with mouse.IsButtonDown, this makes for some nice interactions. Thank you.
#28
Would it be correct to say that on_mouse_click is called the instant I release the click?
And that it is not called yet as long as I hold the button down?
#29
Will the event function on_mouse_click register the mouse click as soon as mouse button is pressed or only when it is pressed and released? Will on_mouse_click be called if I press and hold the mouse button?
#30
That was just the word I was looking for. Thank you Khris ;)
#32
I find that my test audience expect the "grabbing an item and moving it" to work like a smartphone and so they try to pickup by holding the mouse button pressed and releasing by releasing the mouse button. Rather than explaining the issue of "click the mouse to pick up, click again to release", I'll instead try to conform the game to the audience.

This calls for AGS to recognize in repeatedly_execute that a mouse button is pressed. Sort of like a bastard between IsKeyPressed and on_mouse_click.

Is this possible?
#34
Thanks Gurok, this seems very doable.

Especially your first solution is good within the scope of my project.

But I'm a little unsure how to make the border opaque. Is it best done with a dynamic sprite (can do, just wondering if there is an even easier solution)?
#35
My test player has trouble picking up items (objects or characters) as they look quite small on the screen and she has to be careful when positioning the mouse cursor over the item in question. I'd like to sort of "increase mouse sensitivity area" when it comes to mouse clicks and IsInteractionAvailable functions. Is this possible?
#36
I'm trying to make a function that enables me to make a character follow the mouse cursor around. I also need to turn that function off and on in the game.

This works fine with a bool and a small funtion. In global script:
Code: ags

bool shovelfollowingcursor;

function repeatedly_execute() 
{
  if (shovelfollowingcursor == true)
  {
    cShovel.x = mouse.x;
    cShovel.y = mouse.y;
  }
}

function cShovel_PickUp()
{
  shovelfollowingcursor = true;
}


Now I want to extend this to more characters to pick up and follow the cursor around. I figured something like an integer that keeps track of which character is the one I want to do this and then a function to make character[integer] follow the cursor, but I get the message that I cant convert character* to integer.

How do I make a function recognize a character by way of a global integer value?



#37
Thank you very much for the info Khris and for the solution Scavenger. I'm very excited to try it out. Thanks.
#38
I want eModeUseinv to have one cursor graphic as default and another graphic when hovering over certain hotspots or objects. This works just fine (thanks everyone for help with the coding in another thread). As it is, my cursor graphic is the default at whatever position on the screen, however when hovering over a hotspot, another cursor graphic makes the inventory item seem highlighted in some way (still playing around with designs).

But I use a lot of sprite slots and its tedious work to make two graphic sprites for every inventory item (one default and one highlighted). Is there a function in AGS that can make a graphic seem different in some way? Of course I can tint the graphic sprite using dynamic sprites, but I'm not reaaly satisfied with tinting. I want something like creating an outline around the object or changing a graphic sprite to grey shades.

Is there a solution that might do something like that?



#39
Thank you for all your help, both.
#40
Still no success.

I turned to TRUE the "Override built-in inventory click handling".

In globalscript I have:
Code: ags

function on_mouse_click(MouseButton button)
{
  if (button == eMouseLeft) 
  {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
  if (button == eMouseLeftInv)
  {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
}


My inventory item Agern has this global script:
Code: ags
function iAgern_Interact()
{
Display("You picked up an acorn!");
}


But now nothing happens. Neither does the mouse cursor change into the eModeUseinv view, nor does my message display.
SMF spam blocked by CleanTalk