Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: displaying message in certain conditions
displaying message in certain conditions
May 25 2008, 10:35 pm
By: okeee  

May 25 2008, 10:35 pm okeee Post #1



2 locations, 1 unit (any unit)

Whenever a unit goes to location X, and then to location Y, then a message should be displayed. This message should ONLY be displayed if that unit went to location X first, and then to location Y. The important thing is, that it has to be the same unit that went from location X to location Y, and not some other unit. So if there is 1 unit at location X, and another unit at location Y, no message should be displayed.



None.

May 25 2008, 10:39 pm stickynote Post #2



If a player brings the exact unit required to location 'X', then set switch 1 (or whatever switch you want). If that same player brings the exact unit required to location 'Y', and switch 1 is set, then display the text message.



None.

May 25 2008, 11:41 pm Falkoner Post #3



Well, that will work, but to make certain, can we get a bit more info, my main question is, is there only 1 of the unit moving to the locations?



None.

May 26 2008, 12:19 am NudeRaider Post #4

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

Uh oh... that could get a little tricky.
Basically when you want to follow a certain unit always center a 1x1 pixel location on it.

The idea is when the unit enters x center the 1x1 pixel on it and set a dc (better than a switch) for that player to 1.
When he brings a unit to y create a burrowed unit at 1x1.
Then check if that unit is in y.
If yes, display the text and reset the dc.
The problem is you'll have to think about failsafes. E.g. When the player brings a unit to x then leaves x and brings another unit to x and this new unit to y then the new unit has no 1x1 location following, so the detect fails.

Depending on how many units can run around you could copy this system 10 times or so and always use another 1x1 location and another dc.

There may be more issues. Just try what I said and post any problems. We'll eventually get it working bugfree.




May 26 2008, 12:39 am Falkoner Post #5



Yeah, in that case, it better not be an air unit..



None.

May 26 2008, 5:41 am Wormer Post #6



It is important to know what units do you have in your map roaming around. Are they all different types of units? Is there flying units? and etc.



Some.

May 26 2008, 10:41 am NudeRaider Post #7

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

Another idea: Now that ScmDraft supports unit IDs directly you could directly check for the unit ID instead of following it with a 1x1 pixel location. That would work for burrowing and flying units too.

But when you're not willing to make hundrets of copies of triggers it would be useful if you already know the unit IDs in question or can tell the range of possible unit IDs. That means that there are no other units dying/created than your "runners" you want to check for.




May 26 2008, 12:56 pm Ahli Post #8

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

Quote from NudeRaider
Another idea: Now that ScmDraft supports unit IDs directly you could directly check for the unit ID instead of following it with a 1x1 pixel location. That would work for burrowing and flying units too.

But when you're not willing to make hundrets of copies of triggers it would be useful if you already know the unit IDs in question or can tell the range of possible unit IDs. That means that there are no other units dying/created than your "runners" you want to check for.
I fear that you didn't understand what the unit id means in the triggereditor. It's not the unit ID on the map. It's the general unit ID.
For the list, just press on the "+" next to the collapse in the post:
Collapse Box





May 26 2008, 5:06 pm NudeRaider Post #9

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 Ahli
I fear that you didn't understand what the unit id means in the triggereditor. It's not the unit ID on the map. It's the general unit ID.
I fear you're right Ahli. ^^

OK then use EUD triggers to refer to the unit. Shouldn't be too hard to find the unit ID with Farty's list.
wait... this is not gonna work... There's no easy way to detect if the unit is inside a location -- using unit ID, is there?




May 26 2008, 6:40 pm DT_Battlekruser Post #10



For the sake of being understandable, please can we adopt the lexicon of 'Local ID' to refer to a unit's temporary ID based on its order of creation, and 'Unit ID' to refer to the ID assigned by unit type?

The first solution is really the only workable one - because Starcraft does not support mutable variables, then you cannot design a system like this to work for any arbitrary unit going to location x and then location y. If it is only one unit you are looking for, the first suggestion is the best way to do it - set a switch when it reaches location x and then display text when it reaches location y and switch is set. If you want to do it for multiple uniquely identifiable units (different unit ID or different owner), then you would need to make one trigger for each uniquely identifiable unit. The only way I can even see that is remotely possible to track one of multiple homogeneous units is to use some sort of multi-location grid, but I'm not sure if that's been done.

EUD conditions are not going to help you, since you cannot check for the Local ID of a unit at a pixel location; data in RAM is stored the other way (location of a given Local ID).




None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
Please log in to shout.


Members Online: NimoStar