Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Right Click Mouse Detection
Right Click Mouse Detection
Jan 17 2010, 3:54 am
By: Newb  

Jan 17 2010, 3:54 am Newb Post #1



I have not found a thread yet ( or map ) that has a way to detect a right click with the mouse. I even looked at EUD_Keys by Morhpling, and he wasn't able to detect it right :| . If anyone could help me and explain it to me, I'd very much appreciate it.

By the way. I am a newb ( hence the name ) so I might need some thorough explaining for this.



None.

Jan 17 2010, 4:01 am Morphling Post #2



In my map I had the correct EUDs to detect the left and right mouse click, but neither worked for some reason. I know they are correct because they follow the pattern of the VKey.



None.

Jan 17 2010, 9:46 am rockz Post #3

ᴄʜᴇᴇsᴇ ɪᴛ!

I don't understand why you would need to detect right click, when right click automatically has a default "move here" command. Simply detect when the unit moves.



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

Jan 17 2010, 3:52 pm Newb Post #4



Oh sorry for saying you did it wrong Morphling :(

Well the game I wanted to make was an upgraded version of Defend your Castle. I am able to make everything except the right click mouse. If you haven't played you toss units in the air to kill them, which is why I would want right clicking.

Unless I'm not understanding this and I could do this some other way.



None.

Jan 17 2010, 6:25 pm rockz Post #5

ᴄʜᴇᴇsᴇ ɪᴛ!

You can detect when a unit moves by detecting when the unit is outside of a location. Using an inverted location, you can detect when it moves 1 pixel, so you end up with right click detection with a little delay. I've never played defend your castle, so I don't understand how it works.



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

Jan 17 2010, 7:34 pm Apos Post #6

I order you to forgive yourself!

Quote from rockz
I've never played defend your castle, so I don't understand how it works.

Here is the game if you wanted to see:
Defend your castle




Jan 18 2010, 2:04 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

Use critters owned by the player. If the player orders them to a certain height, send it back down and kill the unit. You can't select multiple critters.



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

Jan 18 2010, 4:03 am darksnow Post #8



critters override move commands



None.

Jan 18 2010, 5:15 am Newb Post #9



Well if I were to use a unit, I was thinking about controlling a Zerg Scourge. Move it ontop of a unit, then send it up. I'd have to test this to see if it's still retains the fun value I find in the game. I don't know what you mean by critters though...



None.

Jan 18 2010, 5:43 pm rockz Post #10

ᴄʜᴇᴇsᴇ ɪᴛ!

bengalaas.

You can't select more than 1 critter at a time, which is why I suggested it. However, since critters apparently can't be ordered, it's pointless.



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

Jan 18 2010, 7:32 pm NudeRaider Post #11

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

Of course they can be ordered. The thing is they need orders all the time or they start wandering. Patrol to itself fixes this though.




Jan 18 2010, 8:51 pm Kaias Post #12



Quote from NudeRaider
Of course they can be ordered. The thing is they need orders all the time or they start wandering. Patrol to itself fixes this though.
Yep.
[attach=2019]

Attachments:
Nonjyd Critter.scm
Hits: 10 Size: 39.04kb



None.

Jan 18 2010, 10:18 pm Newb Post #13



Exactly how does using a critter make this work? I'm confused :ermm:
To make sure we are thinking the same thing, during the game there may be 20 units at a time coming to kill your castle. Which is why I think I must stack some of the units.



None.

Jan 18 2010, 10:21 pm Apos Post #14

I order you to forgive yourself!

According to what I understood, you will make a trigger detect when the critter will have moved and that will happen when a player right clicks while selecting the critter.

Edit: Corrected my sentence which made it easier to understand.

Post has been edited 1 time(s), last time on Jan 18 2010, 10:35 pm by apos.




Jan 19 2010, 2:18 am rockz Post #15

ᴄʜᴇᴇsᴇ ɪᴛ!


It's pretty ridiculously simple...

It's also a ridiculously simple game. If you want added effect, center a location on the player 1 critter, and give it to player 9, then order the unit back to the original location. Once it's in the original location, kill it.

The reason for critters is that you can't select more than ONE critter. You could do this with buildings too if you really wanted to stack them, but buildings are ridiculously slow moving.



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

Jan 19 2010, 2:48 am Newb Post #16



Did you ever test out the real defend your castle that guy posted? Because what you are saying doesn't really make sense. I think you are trying to say to move the critter to the unit I want to toss, but the critter would be slower than that unit going to attack the castle.

Or I could simply be very slow at getting this, or I just don't get your reasoning. :><:



None.

Jan 19 2010, 4:17 am Apos Post #17

I order you to forgive yourself!

Not sure if that's what he meant but if it is, it is pretty smart. You make the enemies be owned by the player playing so that's why he wanted critters, so you can only select one at a time then you would just toss it (order it to move). It would be pretty much like the real game. Hope that cleared everything out.




Jan 19 2010, 4:42 am rockz Post #18

ᴄʜᴇᴇsᴇ ɪᴛ!

The unit going to attack the castle is the critter. AFAIK, there's only 1 unit involved in this, and that's the unit attacking the critter. The "castle" can be terrain. All it has to have is a location to know where the "castle" is. And just so you know, detecting a right click only detects that you right clicked, not WHERE you right clicked. There's no easy way to solve the problem, and obviously critters aren't ideal.

The only problems I forsee is: dificulty getting any unit to return to "attack mode" after not being thrown far enough, changing unit speed, and the cf which would develop due to the massive numbers of critters. It's also pretty ugly and slow (so use a shorter running distance). One recommendation, though, to improve the "look" of it. Turn off vision for the player, and use a shared vision map revealer to show where you want to see (like around the castle). The critters will come, but they will appear out of nowhere, while you still own them, and they will disappear when you fling them high into the air.

You could use zerglings to track each and every critter you make, but it'd take some serious triggering, and would be difficult, however it would have the side effect of slowing down the unit at a controllable degree. You could randomize the size of the locations centered over the critters, anywhere from 1 pixel to an inverted location. The critter isn't fast enough to outrun a 1 px location. Also, you should have the units moving towards the left, not the right, just to avoid any possible collisions switching the units.

If what I'm saying here doesn't make sense, that's because it shouldn't. I'm not going to explain in detail how to do this, just that it's theoretically possible to do. I can't give you the triggers, since I'd essentially have to write the map for you then. If you can't figure this out on your own, it's not worth the trouble to do, since it really takes a long time to understand the process. You can read up on things like inverted locations and slowing down units in the wiki/search.

If you wanted to use kakarus, you could stack units, but unfortunately, there's no way of keeping such a unit slowed down, since slowing down units relies on there only being one unit in that spot. Not that it matters much, since all the units are the same.



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

Jan 19 2010, 8:00 am fat_flying_pigs Post #19



Although the use of critters is optimal for throwing, it has the main flaw that the units cannot stack/move past each other. Potential walling with the creeps and other things.

One idea is to have the player command 11 units in separate boxes else where. The player must shift-click one of the attacking units (preferably an air unit), and order it upward. The trigger detects the movement of 1 attacker unit and 11 other units moving up. The 11 other units are reset, and the 1 attacker unit goes high into the air, then comes down (give to another player and order down?) and dies (or just continues if it wasn't thrown high enough).
(hotkey for 11 other units is "1"): 1, shift-click, right click up, 1 shift-click, right click up, ..etc

Keep in mind, in order to correctly detect the attacker units, they must be confined to 1 grid space. The grid space above them is used to find if the attacker unit has been moved. You can use multiple rows. ie:
Space ===================
Space ===================
Space ===================
Space ===================
Space ===================
Attacers =================
Space ===================
Attacers =================
Space ===================
Attacers =================



None.

Jan 19 2010, 10:25 pm Newb Post #20



Well I had already made a mouse detection system for the area of the map ( which sounds like it was a waste of time :crazy: , just not the right click detection :( . But it makes perfect sense now about what you're talking about. Thanks for the help everyone*. :D

EDIT: Everyone*



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
[2024-5-10. : 8:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
Please log in to shout.


Members Online: Zycorax, 2audreye29100fo7