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

#1
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?
#2
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!
#3
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!
#4
Quote from: Slasher on Thu 04/07/2019 17:50:50
Did you set cursor modes properly in the buttons events panel? These are built-in functions..

Yes, I believe I did. But you made me double-check, which is always a good thing! Thanks!

Quote from: Khris on Thu 04/07/2019 22:23:59
It sounds like your game has code that resets the cursor mode.

Which template did you use? The BASS template for instance changes the cursor mode based on the LocationType (the type of area under the mouse); you'll probably want to use the Empty or Sierra template instead.

I use the Empty template, but your first guess was right! I did have code that resets the cursor mode, from back when I struggled to make the cursor change over hotspots. I put the if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) != hotspot[0]) but the cursor image didn't changed back, so I improvised a line of if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hotspot[0]), which worked for the moment being, but of course was the root of my problems with the buttons.

Thank you for helping me see it!
#5
I'm trying to get my verb buttons to change the cursor mode.

So far I've made a GUI with five buttons, and set each button's Click Action to SetCursorMode, and the NewModeNumber to the corresponding cursor number. When I run the game, though, clicking the buttons does little to nothing, it blinks as if it changes image for a fraction of a second, but remains in Walk To mode.

If I'm supposed to put something in the global script, I haven't managed to find any info on it. I've read the manual and searched the forums.

Thankful for help!
#6
Quote from: notarobotyet on Sun 30/06/2019 13:21:41


Hi and welcome! How have you tried to set the coordinates? Are you using DisplayAt?


Hi!

Thank you, everything worked out really well, except the display box location. I use DisplayAt and set coordinates, but it doesn't move an inch along the y axis (but x axis works fine).

I was ready to put my forhead through the screen (or, you know, whatever breaks first) the last couple of nights, but finally realized the possibility to do the things I actually can do, instead of doing stuff "in order", and your answers just now made it come together really nice! Thank you!  :cheesy:
#7
I', kinda new to this, and often get stuck in the gap between my acquired skill and what's explicit in the manual. A lot seems to be taken for granted that the user already knows.

My recent hangup is text windows. I've tried to set the coordinates for the Display box, but so far I've only managed to manipulate the x axis. On the y axis, the box sticks to the middle of the room, no matter what number I type.

I have also tried making a Text Window GUI, but when I want to set "Use GUI for dialog options", 0 is supposed to just put text at the bottom of the screen, right? Well, my Text Window GUI's ID is 0. with the ID 1, and have successfully typed "1" in "Use GUI for dialog options", but my dialogue text (one mouseover, one look at) is still in the standard display box and the GUI nowhere to be seen. How do I get it in there?

Last but not least, I would actually like the Text Window to display all text that is being said, thought or read, since my game is a single character, first person pov.
It can't be that uncommon, right? It's what seems most intuitive to me, based on my own gaming experiences, but seems impossible to find in the manual or forums. Except when the answer refers to information I'm expected to already have, and thus renders the answer useless to me.

I apologize in advance if I've missed an existing post about this or some of it - I have flipped through the forum but might just as well have missed something.

PS. What's with the Text Window GUI "textcolor" value? How do I know what number represents which color? It's default as "0" with nothing to choose from.
SMF spam blocked by CleanTalk