Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: I need 2 eud conditions
I need 2 eud conditions
Jan 5 2011, 12:40 am
By: iCCup.xboi209  

Jan 5 2011, 12:40 am iCCup.xboi209 Post #1



I need a EUD condition that knows where a player clicked and one that knows if the player has selected a building. ty =)



None.

Jan 5 2011, 2:01 am NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

First you need a general understanding of EUDs.
You need 1 trigger per pixel of mouse position you want to detect, and you can't detect mouse klicks, just key presses.
Also the building in question must not ever die in your map or you'll run into trouble with your selection detection.

Have you read the stickies? http://www.staredit.net/163556/




Jan 5 2011, 3:48 am Roy Post #3

An artist's depiction of an Extended Unit Death

Quote from name:xboi209
I need a EUD condition that knows where a player clicked...
Quote from NudeRaider
You need 1 trigger per pixel of mouse position you want to detect...
This alone says that what you are asking is going to be quite impractical to implement on a large scale. You may want to reconsider your methodologies for the map. What are you trying to do, exactly? There may be easier ways to implement the system, like via casting dark swarm and detecting that.

Quote from name:xboi209
... one that knows if the player has selected a building.
Selection detection addresses can be found among other things in this thread: http://www.staredit.net/topic/10471/

Quote
6284E8 161889 P1 FIRST SELECTION ID (SHARED): (Pointer to unit, see below)
6284EC 161890 P1 SECOND SELECTION ID (SHARED): (Pointer to unit, see below)
...

628518 161901 P2 FIRST SELECTION ID (SHARED): (Pointer to unit, see below)
62851C 161902 P2 SECOND SELECTION ID (SHARED): (Pointer to unit, see below)
...

628548 161913 P3 FIRST SELECTION ID (SHARED): (Pointer to unit, see below)
62854C 161914 P3 SECOND SELECTION ID (SHARED): (Pointer to unit, see below)
... (for address: +0x30; for extended player: +12)

If it doesn't have to be global and will be client-side actions only, you may want to simply detect the unit portrait, because then you wouldn't need one trigger for each building, but rather one for each possible building type.




Jan 5 2011, 7:22 am rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from name:xboi209
I need a EUD condition that knows where a player clicked and one that knows if the player has selected a building. ty =)
http://www.staredit.net/topic/6865/
first map just has a trigger which detects what you have selected. Second map has selection and order. Have you watched the video and made an EUD health detection map? That's pretty much the first step in understanding SC memory and what EUDs really are.



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

Jan 5 2011, 12:30 pm Ahli Post #5

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

Mouse click detection?
-We don't know where to directly detect the mouse click input in the memory.
-You can detect that a preplaced unit got an order (that's easy to detect)

Mouse on Map Detection:
-Singleplayer only, 16380 triggers to get mouse on map coordinates.
See attachement.
It's a text file (4.88mb) inside a rar-archive (55kb) containing the triggers + explanation text for Player 1.

Attachments:
EUD mouse position on map.rar
Hits: 5 Size: 55.05kb

Post has been edited 1 time(s), last time on Jan 5 2011, 6:58 pm by Ahli. Reason: corrected trigger count




Jan 5 2011, 6:50 pm poison_us Post #6

Back* from the grave

Ahli, you sure you want to add, rather than set to, the deaths for the X-coordinate?




Jan 5 2011, 6:56 pm Ahli Post #7

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

Quote from poison_us
Ahli, you sure you want to add, rather than set to, the deaths for the X-coordinate?
Set the screen offsets (X,Y) and add the mouse offset (X,Y) ?
Oh and I missed the 3. 16380 triggers are needed ;D




Jan 7 2011, 11:33 pm iCCup.xboi209 Post #8



Quote from Ahli
Mouse click detection?
-We don't know where to directly detect the mouse click input in the memory.
-You can detect that a preplaced unit got an order (that's easy to detect)

Mouse on Map Detection:
-Singleplayer only, 16380 triggers to get mouse on map coordinates.
See attachement.
It's a text file (4.88mb) inside a rar-archive (55kb) containing the triggers + explanation text for Player 1.

That's pretty pointless(srry) because it's single player only but can you explain why it's single player only?



None.

Jan 8 2011, 2:03 am Apos Post #9

I order you to forgive yourself!

Quote from name:xboi209
That's pretty pointless(srry) because it's single player only but can you explain why it's single player only?
For a detailed explanation, you can check other EUD threads, it was answered in almost all of them.... Let's just say it's because if it was multiplayer, anyone could easily hack in the game. (Using an external program to know what you are doing.)




Jan 8 2011, 3:15 am Roy Post #10

An artist's depiction of an Extended Unit Death

It's single-player only because the address is client-side. Why is it client-side? Because each player has their own mouse with their own positions. There isn't an address for P1_Mouse_Position_X, P2_Mouse_Position_X, etc. Rather, there is one address for Mouse_Position_X and Mouse_Position_Y that holds the values for the client's mouse position. These values are going to be different because one player will have their mouse at a different position than another. When the trigger fires for one player, it runs for that player's instance of StarCraft, but since the other players do not have their mouse at the same spot, it won't run the trigger for them. This creates two different running games, one where the trigger fired, and one where it didn't. These two games will desync from each other, and the player that had the EUD trigger run will be dropped from the other game.

Reading address values that are shared will not have this problem, because the address value will be the same for all players, and nobody will be out-of-sync after it executes (except Mac users *ahem*).




Jan 8 2011, 4:19 am rockz Post #11

ᴄʜᴇᴇsᴇ ɪᴛ!

Just require your map to use the eud enabler mod on bnet.



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

Jan 8 2011, 5:18 am poison_us Post #12

Back* from the grave

Quote from Ahli
Quote from poison_us
Ahli, you sure you want to add, rather than set to, the deaths for the X-coordinate?
Set the screen offsets (X,Y) and add the mouse offset (X,Y) ?
Oh and I missed the 3. 16380 triggers are needed ;D
My bad, I forgot you have to find both screen and mouse. Anyways, I did one independently on a 256x256 map with only 3,030 triggers...because the screen is on an 8-pixel grid, you don't really need all of the triggers you have.

Math: (x-axis) 256 * 32 = 8,192 pixels - 640 pixels in one frame of the screen (screen can't show past the edge of the map) = 7,552 pixels available / 8 = 944 grid spaces for screen to center + 640 for mouse detection = 1,584 triggers for x-axis.
(y-axis) 256 * 32 = 8,192 - 480 = 7,712 /8 = 964 + 481 = 1,444
(both) 1,584 + 1,444 = 3,028 + 1 to set both counters to 0 = 3,029
Notepad++ count feature: ...3,030. Found it, now 3,030. 3,029.

Great, one extra somewhere. I'm looking forward to searching 33,332 lines of trigger for a duplicate...not.

EDIT: Found it, was because of how I was copying and pasting my add triggers, had two duplicate +600's on my x-axis. Doing these by hand was a pain in the ass.


Post has been edited 3 time(s), last time on Jan 8 2011, 7:10 pm by poison_us. Reason: Failed to actually change the # -.-




Jan 8 2011, 5:19 pm iCCup.xboi209 Post #13



Quote from Roy
It's single-player only because the address is client-side. Why is it client-side? Because each player has their own mouse with their own positions. There isn't an address for P1_Mouse_Position_X, P2_Mouse_Position_X, etc. Rather, there is one address for Mouse_Position_X and Mouse_Position_Y that holds the values for the client's mouse position. These values are going to be different because one player will have their mouse at a different position than another. When the trigger fires for one player, it runs for that player's instance of StarCraft, but since the other players do not have their mouse at the same spot, it won't run the trigger for them. This creates two different running games, one where the trigger fired, and one where it didn't. These two games will desync from each other, and the player that had the EUD trigger run will be dropped from the other game.

Reading address values that are shared will not have this problem, because the address value will be the same for all players, and nobody will be out-of-sync after it executes (except Mac users *ahem*).
I knew a desync was gonna happen but I didn't know why. ty for explaining =)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:35 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:35 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:35 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:35 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:35 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:34 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[01:34 pm]
ninokaw193 -- RioGrand is a reputed name in manufacturing high- quality Criket Bats https://www.riogrand.in
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[2024-4-25. : 7:46 am]
RIVE -- :wob:
Please log in to shout.


Members Online: jun3hong