Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Screen position detection
Screen position detection
Oct 4 2008, 5:18 pm
By: JaBoK  

Oct 4 2008, 5:18 pm JaBoK Post #1



Simple EUD question, I plan on placing all my start locations on the top left corner of the map. When a player presses space bar they will jump their screen to this position (also looking for a way to make sure the jump to spot is always here, haven't done too much testing but I'd like to know any issues involved with this)

I'm looking for simple EUD conditions to detect this screen position, so that I can center view back on the player and run a command. If this is too much to ask someone to find for me, I'd gladly do the testing myself, but I'd need a bit of info on how to do that.



None.

Oct 4 2008, 5:43 pm stickynote Post #2



Its in the EUD DB, some where in the middle of the page.



None.

Oct 4 2008, 6:39 pm NudeRaider Post #3

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

Space centers on the last message.
You must press F3 to center the view on the starting location.

But I don't know how to detect the screen via EUDs ... sry.




Oct 4 2008, 8:42 pm JaBoK Post #4



Is it possible to make it so that the "last message" will always be at a set location? And thanks to both of you.
EDIT
Since I'm not the greatest at all that, what's the basic algorithm for choosing which deaths to look for, and also, does this particular test function in multiplayer games?

Post has been edited 1 time(s), last time on Oct 4 2008, 9:21 pm by JaBoK.



None.

Oct 4 2008, 9:29 pm A_of-s_t Post #5

aka idmontie

Code
var fso = new ActiveXObject("Scripting.FileSystemObject");
var outputFileName = fso.GetParentFolderName(WScript.ScriptFullName) + "\\" + fso.GetBaseName(WScript.ScriptFullName) + ".txt";
var outputStream = fso.CreateTextFile(outputFileName, true);


var DeathTable = 5808972;


for(var turn = 0; turn < 1699; turn ++) {
var Address = 0x0059CB8D + (turn * 336);
var DeathOffset = Address - DeathTable;
var UnitID = Math.floor(DeathOffset /48 );
var PlayerID = Math.floor((DeathOffset - (UnitID*48 )) /4) + 1; // 1-based
var ByteOffset = Address & 3;
outputStream.WriteLine("Deaths(P" + PlayerID + ", Exactly, 199, " + UnitID + ");");
}


Its something like that.



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Oct 4 2008, 10:46 pm JaBoK Post #6



Okay, so if I were to make the condition for the top left corner of the map, all I would need would be for X(1) and Y(1) to each be zero, but apart from that I'm no programmer, so I have no clue as to how to interpret that. Thanks, though, but I really don't get how 199 got in to the mix, what DeathTable represents, or if this would work for four different players in a game, provided the trigs were set under current player.



None.

Oct 6 2008, 1:03 am O)FaRTy1billion[MM] Post #7

👻 👾 👽 💪

You cannot set where the "last message" will be, unless nothing like units being built can happen.

You can use EUDTrig to convert the address into a trigger, but I feel like being a bit more helpful than that right now:
X(1) = Player 6, unit 13487
Y(1) = Player 4, unit 13488



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Oct 6 2008, 3:16 am JaBoK Post #8



Bleh, I just did more research and realized that it would cause desyncs in multiplayer. My goal was to have 4 players able to perform an action at the press of a button without losing control of their unit.

Anyways, thanks for that, and I really hate to ask more potentially dummy questions, but would it be possible that the first four units on the map were 11 hp firebats, and that a trigger be created that would detect if a firebat was at 1 hp, reset it to 11 hp, and then set a certain death counter to 1 for the player owning the said firebat? As a bit of background, it's an arena type game in which pressing a key will cause you to bend down and make a snowball, pressing it again will start a repeated back and forth bar on top of the screen, and pressing it a third time with throw it, with "strength," or speed, equal to whenever you hit the button for the first time. I also plan on triggering gravity and stuff, but I can't go further until I have an easy-to-use system that allows me to press an action key, and burrowing just doesn't cut it.



None.

Oct 6 2008, 3:32 am O)FaRTy1billion[MM] Post #9

👻 👾 👽 💪

If the units will never be created out of order. EUD detection on units is very specific.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Oct 6 2008, 3:35 am JaBoK Post #10



Well, assume four preplaced units as units 1, 2, 3 and 4. Start locations and other preplaced things would come afterwards and the preplaced units would never be killed or removed.



None.

Oct 6 2008, 3:52 am O)FaRTy1billion[MM] Post #11

👻 👾 👽 💪

Then that would work. You'd just need to find thier addresses.
I usually put the current selection group offset into a memory viewer, select the unit, and then write down the value.

I'll be more helpful later, I have to sleep.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Oct 6 2008, 9:34 am NudeRaider Post #12

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

Quote from O)FaRTy1billion[MM]
You cannot set where the "last message" will be, unless nothing like units being built can happen
You could constantly have a unit attacked there. That should always give you the "unit under attack" message. Don't know if it works, maybe the unit has to die and be recreated for the new message. You'll have to experiment a bit.




Oct 7 2008, 12:43 am JaBoK Post #13



Quote from O)FaRTy1billion[MM]
Then that would work. You'd just need to find thier addresses.
I usually put the current selection group offset into a memory viewer, select the unit, and then write down the value.

I'll be more helpful later, I have to sleep.
Hm, thanks, I attempted to figure out what that meant and I realized that I have no idea of how to use EUDs properly, apart from a rudimentary understanding of the memory involved. Anyways, if anyone knows the unit ID and player ID to check up on the HP for units 1 2 3 and 4 that'd be great, as well as any info on ho wmuch of this can be done in scmdraft 2, and how much needs starforge.



None.

Oct 7 2008, 12:48 am stickynote Post #14



Aw man Jabok. I see what your plan for the winter mapping contest is going to be. Good luck! It already sounds fun. :D

I don't know if you can use starforge to do EUD's. I write them in EUD Trig, save them, then load the triggers with SCXE.



None.

Oct 10 2008, 1:27 pm JaBoK Post #15



Hm, sorry for the bump, but I've been unable to figure out how to get this working. Anyone know of any test maps or trigs needed to check up on units' hp?



None.

Oct 10 2008, 1:58 pm Devourer Post #16

Hello

Quote from NudeRaider
Space centers on the last message.
You must press F3 to center the view on the starting location.

But I don't know how to detect the screen via EUDs ... sry.

or F2 or SPACEBAR



Please report errors in the Staredit.Network forum.

Oct 10 2008, 3:04 pm NudeRaider Post #17

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

Quote from Devourer
Quote from NudeRaider
Space centers on the last message.
You must press F3 to center the view on the starting location.

But I don't know how to detect the screen via EUDs ... sry.

or F2 or SPACEBAR
OK, F2 maybe. Haven't actually checked and I don't really use it.
But while spacebar might work at the very start of the map (not sure of this) it will definetely fail as soon as you got the first message.




Oct 10 2008, 3:19 pm Devourer Post #18

Hello

Quote from NudeRaider
Quote from Devourer
Quote from NudeRaider
Space centers on the last message.
You must press F3 to center the view on the starting location.

But I don't know how to detect the screen via EUDs ... sry.

or F2 or SPACEBAR
OK, F2 maybe. Haven't actually checked and I don't really use it.
But while spacebar might work at the very start of the map (not sure of this) it will definetely fail as soon as you got the first message.

thats right, but not a message
also when a unit construction / warp / moprh is done, the "spacebar" will be updated :D



Please report errors in the Staredit.Network forum.

Oct 10 2008, 7:20 pm NudeRaider Post #19

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

that IS a message.

Ofc message does NOT mean PMs or other chat. Also does it NOT mean display text action.




Oct 11 2008, 4:58 am JaBoK Post #20



As a note, in a map without unit constructions or non-vhp fighting, the message stays at the SL.

As another note, this wont work for my multiplayer map so I'm still looking for unit HP EUDs to use stimpacks for the same effect, IE, press T and instantly get an action.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
Please log in to shout.


Members Online: lil-Inferno, Roy