The Dink Network

Mouse Brain

September 30th 2015, 06:28 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I'm hoping someone here knows more about the mouse brain (13) than I do.

I'm turning Dink back into the mouse mid-game and I'm having a few issues. When I move him around with my mouse he can move through hardness (which is what I want), but when I move him around with the arrow keys (which I would like to do as well while he's in mouse mode) he can't move through hardness. Is there a way to make it so he can move through hardness when moved with the arrow keys as well as the mouse? sp_flying only moves over blue hardness I'm pretty sure, so that won't work for objects and stuff.

I also want to be able to do stuff when the mouse is clicked/control is pressed (anywhere on the screen), but I don't want to have to place a giant invisible sprite over the screen and make it pretend to be a button (bain 14). Is there a way around this?
September 30th 2015, 06:38 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Wait... Nevermind about the hardness thing, I just rediscovered the sp_move_nohard function.

My second question still stands, however.
September 30th 2015, 12:10 PM
wizardg.gif
Leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
I also want to be able to do stuff when the mouse is clicked/control is pressed (anywhere on the screen), but I don't want to have to place a giant invisible sprite over the screen and make it pretend to be a button (bain 14). Is there a way around this?

I can't really think of another way to do this. Or at least a way that's easier. As far as I'm away there's no command or script along the lines of dink not hitting something. I've never really used brain 13 so I don't know a whole lot about it though.
October 1st 2015, 06:21 PM
dinkdead.gif
"I also want to be able to do stuff when the mouse is clicked/control is pressed (anywhere on the screen), but I don't want to have to place a giant invisible sprite over the screen and make it pretend to be a button (bain 14). Is there a way around this?"

Yes and no... You would need a giant sprite to catch the click but it doesn't have to be brain 14

Brain 14 is just if you want to use buttonon and buttonoff, any brain can use the click procedure.

I have a giant sprite ready-made in Bug Mania, feel free to use that or anything else if it's useful.
October 2nd 2015, 07:14 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Well that's fair enough. I'll have a peek at Bug-Mania. Thanks for the help mate.
January 4th 2016, 06:20 AM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
On, "doing stuff elsewhere on the screen", would you not be interacting with sprites anyway?

I may be missing something but I don't see the need for a giant sprite, as you would only want the "click" to register on the sprite you want to action.

Ooop implies that the clicked sprite would determine the action when it is clicked on, as opposed to providing a slew of If...Thens, to hopefully cover every possible clicking location?
January 6th 2016, 08:08 AM
dinkdead.gif
He wants to be able to click anywhere, ie, even on an empty background tile area. At least, that's how I saw it.

You can only handle the click procedure from a sprite, hence the need for a giant invisible sprite to catch the click. The clicked location is easy to find because the mouse is Dink (sprite 1) so you can just get the current x/y.
January 6th 2016, 05:15 PM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
Aren't Dink and the Mouse pointer, sprites?
January 6th 2016, 09:40 PM
knightg.gif
DackFight
Peasant He/Him United States
Making Topics off-track faster then you can say it 
Anything that's not background tile is basically a sprite.
January 6th 2016, 10:01 PM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea duck bloop
can't flim flam the glim glam 
MIDIS. : |
January 6th 2016, 11:05 PM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
I meant, the mouse does process it's own movement and it's 'on_click' procedure has it cycle through the sprites to see if it clicked on one, then checks to see if there is s script attached. Is it possible then to trap the click event and have it run a script that was not attached in the editor?

January 6th 2016, 11:39 PM
wizardg.gif
Leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Is it possible then to trap the click event and have it run a script that was not attached in the editor?

Probably not? There's no command I know of that supports what I think you're trying to do here.
January 8th 2016, 09:11 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
This is why you want a giant invisible sprite.

The easiest way I could think of to great a controllable targeting reticle was to use the mouse brain. Turns out I was right. Just needed to figure out how to "click" to choose the destination. Thus, the giant invisible sprite.
January 13th 2016, 11:44 PM
wizardg.gif
Paul
Peasant He/Him United States
 
Not quite sure why you don't want to use a giant invisible sprite, but would a small invisible sprite be better? Sparrowhawk says the button can have any brain, so what if you made it a "shadow" of the cursor? (Completely untested)

P.S. Hello! Just stopping by.
January 14th 2016, 12:38 AM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
This is why you want a giant invisible sprite.

In looking at this video, It looks dink is the active sprite when there is not a reticle on the screen, then dink loses focus while the mouse cursor (drawn as a reticle) is active on the screen. His idle anim is still going on, but it looks slower to me for some reason...perhaps paralax is to blame for that

With this in mind, I would expect the sprite need only be the size of the mouse cursor. In on_click(), you could simply populate &Retx = sp_x(&current_sprite, -1) and &Rety = sp_y(&current_sprite, -1). This would mark where on the screen to drop the rocks. After completing, you could disable and hide the reticle sprite and yield focus back to dink.

Steps 2 & 3 look useful in, mouse_mode_tutorial-1_01
January 14th 2016, 12:55 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
What a pleasure Paul!

The shadow idea is actually quite smart, and would be interesting to mess with to see how it functions, though I feel like there wouldn't be a noticeable advantage of using a small shadow sprite over a screen-sized sprite. I might give it a shot, just for the sake of it sometime though.