Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: EUD: right mouse click detection
EUD: right mouse click detection
Jun 4 2009, 3:21 pm
By: Ahli  

Jun 4 2009, 3:21 pm Ahli Post #1

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

This will be for my D1 map.

Shoting arrows would be work best, if you simply click with the right mouse button on the battlefield, if movement is controlled by WASD buttons.

It would be cool, if I can trigger arrows and spells by hotkeying a specific unit/building (building is less work/less lag, because it normally cannot move) and clicking on the battlefield.
In which direction you shot, is already done with a "mouse on map" EUD system.

Now I would like to get or help to find the addresses for the right mouse button.

Does someone know this?
How could we find out where it is stored in RAM (address)?




Jun 5 2009, 7:47 pm rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

I imagine it's somewhere near keypress detection.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jun 6 2009, 1:39 am Heinermann Post #3

SDE, BWAPI owner, hacker.

The keypress detection are part of this:
http://msdn.microsoft.com/en-us/library/ms645540.aspx

You'll need to do some calculation, since the original keypress triggers weren't updated to properly correspond with the Virtual Key array.




Jun 6 2009, 2:43 am rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Neat-O.

Caps is 0x14, right click is 0x02. Subtract 0x12 from player 3 Unit:1060. Caps is player 50884 unit:0, but that's reading once every 4 bits, so 4*50884=203536. 203536-0x12=203518. 203518/4=50879.5. That means its player 50879, and the number you're looking for is 65536. If I'm wrong, do the math yourself.

However, this would be nice to be mapped out in the wiki somewhere. I may end up doing it if I'm bored sometime.

It's kind of strange, since there's no 0x00. The most significant byte is the "cancel" button or whatever. It shouldn't be a problem.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jun 8 2009, 1:43 am Morphling Post #5



Quote from name:Zachary Taylor
Neat-O.

Caps is 0x14, right click is 0x02. Subtract 0x12 from player 3 Unit:1060. Caps is player 50884 unit:0, but that's reading once every 4 bits, so 4*50884=203536. 203536-0x12=203518. 203518/4=50879.5. That means its player 50879, and the number you're looking for is 65536. If I'm wrong, do the math yourself.

However, this would be nice to be mapped out in the wiki somewhere. I may end up doing it if I'm bored sometime.

It's kind of strange, since there's no 0x00. The most significant byte is the "cancel" button or whatever. It shouldn't be a problem.
That is not right. Player 3 Unit ID:1060 comes out to be Player 12723, Unit ID:0 (in scmdraft, Player 12722). Right click is Player 10, Unit ID:1059, Deaths 65536 or Player 12718, Unit ID:0 (in scmdraft, Player 12717), however it doesn't seem to work like ever other key. I might have done it wrong, but I don't think so because then all the other keys shouldn't work.

Post has been edited 1 time(s), last time on Jun 8 2009, 1:50 am by Morphling.



None.

Jun 8 2009, 2:00 am scwizard Post #6



It doesn't work, the x and y coordinates are both right next to each other, and each 2 bytes.

So you can only effectively detect the y coordinate of a click.

Also this would be a very difficult offset to find.



None.

Jun 8 2009, 2:05 am ForTheSwarm Post #7



You SHOULD be able to detect the x coordinate through death count subtraction.



None.

Jun 8 2009, 2:39 am Falkoner Post #8



Quote
You SHOULD be able to detect the x coordinate through death count subtraction.

Yeah, that's what I thought in the last thread that had something related to this, the issue is that since you're working with EUDs there's no way to copy the value over to a death that you can modify in order to perform math operations on it.



None.

Jun 8 2009, 4:24 am rockz Post #9

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from Falkoner
Quote
You SHOULD be able to detect the x coordinate through death count subtraction.

Yeah, that's what I thought in the last thread that had something related to this, the issue is that since you're working with EUDs there's no way to copy the value over to a death that you can modify in order to perform math operations on it.
*cough* 2^32 triggers *cough*

@morph
Lol, I multiplied by 4, and got my player mixed up. It should be 48*1060+4*2=50888. 50888-0x12=50870. 50870/4=12717.5.

You can detect a mouse click area via frags, but it has a pretty significant delay, especially if you want accuracy over a large area. EUDs can detect a constant position, a current position, or a y point.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jun 8 2009, 5:11 am Heinermann Post #10

SDE, BWAPI owner, hacker.

Quote from scwizard
It doesn't work, the x and y coordinates are both right next to each other, and each 2 bytes.

So you can only effectively detect the y coordinate of a click.

Also this would be a very difficult offset to find.

There's not one, not two, but MANY mouse x/y coordinate pairs, MOST of them are POINT structures (x/y pair, each 4 bytes).
I've never seen a mouse x/y pair being 2 bytes each.




Jun 8 2009, 9:44 am Ahli Post #11

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

but we still didn't found the entry where it is stored...

don't forget that we can read out where someone clicked by using the mouse position on map (screen offset + mouse offset) (I already made all triggers for that).

At least finding an entry where the direct mouse input is stored, would be enough (condition: at least 1).




Jun 9 2009, 11:49 pm Heinermann Post #12

SDE, BWAPI owner, hacker.

http://www.staredit.net/154915/




Jun 10 2009, 5:15 am Decency Post #13



Might I suggest using the rally points of different buildings for casting various spells, if you want to stay true to D1?



None.

Jun 11 2009, 1:02 am rockz Post #14

ᴄʜᴇᴇsᴇ ɪᴛ!

sweet, but too sweet.
+0xF8 - WORD wRallyX
+0xFA - WORD wRallyY

Better to just detect the position with:
006CDDAC Mouse X Position
006CDDB0 Mouse Y Position
Current select unit
and Right click.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jun 11 2009, 1:11 am scwizard Post #15



Quote from Heinermann
Quote from scwizard
It doesn't work, the x and y coordinates are both right next to each other, and each 2 bytes.

So you can only effectively detect the y coordinate of a click.

Also this would be a very difficult offset to find.

There's not one, not two, but MANY mouse x/y coordinate pairs, MOST of them are POINT structures (x/y pair, each 4 bytes).
I've never seen a mouse x/y pair being 2 bytes each.
Oh yeah, or else mouse defense wouldn't be possible.

How do you detect clicks? Also is this screen position (that's what mouse defense used) or is it map position?



None.

Jun 11 2009, 1:16 am Morphling Post #16



Quote from scwizard
How do you detect clicks?
The only way to detect clicks is by ordering a unit and detecting when it moves.
Quote from scwizard
Also is this screen position (that's what mouse defense used) or is it map position?
What are you talking about? Mouse Defense did not use screen position. What is map position?

Post has been edited 1 time(s), last time on Jun 11 2009, 1:21 am by Morphling.



None.

Jun 11 2009, 3:03 am rockz Post #17

ᴄʜᴇᴇsᴇ ɪᴛ!

Wait, so you can't detect a right click like you can a keypress?



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
[11:05 pm]
Ultraviolet -- :wob:
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[2024-5-18. : 3:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
Please log in to shout.


Members Online: Sylph-Of-Space