Cursor problems and Display problems

Started by Klarnolph, Sat 06/07/2019 00:13:17

Previous topic - Next topic

Klarnolph

I feel like I'm slipping backwards on the learning curve here...

For some reason, the cursor, when I run the game, is the "Look at" cursor. I don't remember choosing it anywhere, and I can't find anywhere in code or settings if/how even to make the choice. (Anyhow, I'd like it to be... Pointer, i guess, since I'm making a 1st person game and I'd like to have a cursor mode that can trigger mouse over event but the player gotta choose a verb to change cursor.)

I got help with how to change and change back the cursor graphic at mouse over, which works fine. Though I'd now like the cursor to stay in the mode chosen by button press, thus only change over hotspot in the initial mode (that in this case would be Pointer, but is Look at, since I can't seem to change it). Like, when the player has chosen a mode, there is no reason for the cursor graphic to change.
I'd even be happy with no change of graphic at mouse over, I'd do fine with just a display text describing clickable areas. As long as I can choose a verb, click a hotspot and get my scripted response.

(I understand that cursor mode and cursor graphic are different things, they're just both involved in this.)

I built a GUI for display text, that I haven't put into use yet (for inner monologue and such), but with no mouse over graphic change, perhaps a mouse over display by the cursor would be nice. I might just be tired, but I now can't remember or find search result on how to get the display window to appear at mouse over but then disappear when the mouse leaves the area. As it is now, the text just sits there being stupid while the mouse goes on to further endeavours.

Also, the mouse changes and the button presses would be global, right?

My plan B is to make events on all hotspots: mouse over change the graphic/display text or whatever; certain mouse modes changes between rooms, display thoughts/text, gets used with an inventory item, etc. But I'd still like to set the initial mouse mode.
When I put anything in, set mouse mode or something similar, all I get is that it's "already defined". Okay, but where and how do I redefine it?

If "Walk to" won't be used, since it's 1st person, do I just leave it out or what's best?

It's late, I'm tired, but I figure that posting on here could give me a few hours' peace of mind, as there's probably no use pushing forward at this point. Also, I've been really happy with the answers I've gotten thus far, and also very happy with how nice you are to newbies! I'm trying my best!

Khris

The mouse modes can be set to "StandardMode" in the editor; afaik the first one of these that is also enabled is the one the game starts with.
If you want to select any other mode instead, go to the Global Script's game_start function and add a line like
Code: ags
  mouse.Mode = eModeInteract;

(Also, whenever you try to code something and it doesn't work, it's usually helpful to show us what you tried; most people who have never programmed before make lots of basic mistakes and fixing those early on will avoid lots of wasted time.)

Hotspot name text following the cursor is easily in the top ten of questions that have been asked and answered many, many times. The basic idea is to put a label on a GUI, put @OVERHOTSPOT@ as the label's text and have it follow the mouse inside the repeatedly_execute function by changing its coordinates to ones relative to the mouse's.

I'm also going to suggest that you start with the default template instead of the empty one; it's much closer to the game mechanics you're looking for. It already has a bar of buttons that set the current cursor mode.

Laura Hunt

Other issues aside, if I undertand correctly, you want a "neutral" Pointer cursor mode that does nothing when the player clicks on, or mousesover, stuff, so they're always forced to choose a verb/mode in order to get a response from hotspots or objects, right?

If this is correct, I'd personally advise against it from a game design standpoint. When a player starts up your game, the first thing they're going to do is start clicking on stuff and they'll expect some kind of feedback. You, on the other hand, want them to first choose a type of action and then click on stuff to see what happens, which is a bit counterintuitive. It's not a huge thing by any means and it won't kill the playability of your game or anything, for sure, but I think it's a better idea to have a default/preselected mode that really does something, such as "look at".

Just an opinion though! Your mileage may vary and all that :)

Klarnolph

Thanks to both of you!

I will try to make GUI label for mouse over hotspot texts. The mouse.mode line worked like a spell although I'm sure that I've tried it before, but I might have had another error at the same time and missed it.

I will also consider usable cursor from start. I was thinking that it would give mouseover descriptions, but be neutral because I didn't want the screen invaded by a huge eye as default and also didn't really see what's so "look at" about a floating hand. I really understand why the basic standard cursors on most interfaces are an arrow or crosshairs! But I might have a solution in mind.

As for now, thank you! And for next time I need help, I'll attach the relevant code!

Klarnolph

#4
Quote from: Khris on Sat 06/07/2019 13:01:08

Hotspot name text following the cursor is easily in the top ten of questions that have been asked and answered many, many times. The basic idea is to put a label on a GUI, put @OVERHOTSPOT@ as the label's text and have it follow the mouse inside the repeatedly_execute function by changing its coordinates to ones relative to the mouse's.

I'm also going to suggest that you start with the default template instead of the empty one; it's much closer to the game mechanics you're looking for. It already has a bar of buttons that set the current cursor mode.

I must have gotten it wrong the first time, because what I want is not that the mouse over description box should follow the mouse (maybe stay by the hotspot in question, but I think I can figure that out), but the thing is that I want it to disappear when I'm no longer holding the mouse over the corresponding hotspot.

And oh, what's the default template? I'm confused! There are four to choose from, which one did you refer to?

Slasher

#5
Try the FloatingHotspot Module

http://www.mediafire.com/file/28087koqgata5bb/FloatingHotspot.scm

Default Template is the Sierra one...


Khris

Quote from: Klarnolph on Sat 06/07/2019 23:13:16And oh, what's the default template? I'm confused! There are four to choose from, which one did you refer to?

Right, it used to be called "Default Game" for ages and was renamed to "Sierra-style" only recently.

SMF spam blocked by CleanTalk