HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Toadcop or whoever advice me

09-23-2007, 11:06 PM#1
MaD[Lion]
I played the toadcop map (shooting thingy), and he made a use of left click, which is an ability as i see. But do anyone know how to always force the player to click this ability? Like in his map...
09-23-2007, 11:35 PM#2
Pyrogasm
He probably has an ability that has a specific hotkey and then he does this:
Collapse JASS:
if GetLocalPlayer() == <The Player> then
    call ForceUIKey("F") //F being the hotkey for said ability
endif


You can also force-press the Escape key
09-24-2007, 12:06 AM#3
MaD[Lion]
is it possible to force "Alt+F4"? XD ok joke, but hm thnx for help :D
09-24-2007, 10:26 AM#4
Anitarf
As far as I have experimented, it's not so simple to reproduce, but it is doable. Basicaly, you make a no-target skill and a point target skill, both with no cooldown. Then, lock player selection so he always has that unit selected, and have a fast periodic trigger force that player to press the hotkey for the no target ability, and another trigger that, whenever the unit is issued an order, forces the player to press the point target ability hotkey.

That way, the unit will immediately cast the no target ability, and the second trigger will go to the targeting submenu of the point target ability, where the first trigger will no longer work because no hotkeys register while in there. When the player left clicks (thus choosing a target for the spell and casting it) or right clicks (thus canceling the spell), the game will go back to the main unit command menu where the periodic trigger will then immediately cast the no target skill again, completing the cycle.

Thus, if only a no target spell order is issued to the unit, then that means the player must have exited the targeting menu with a right click (or escape), while if a target spell order is issued then that means the player must have selected the target for the point target spell with a left click and you should ignore the next time he is ordered a no-target spell.

Now come the problems. Since it seems some delays are involved with the force UI key action, the no target order gets spammed massively before the game gets to the targeting submenu of the point target skill. Because of that, you need to give the no target skill a cooldown, I had something like 0.05s and still the game would occasionaly detect a right click when I only spammed left clicks (because the no target spell would get cast twice, while I would only ignore it once after a left click detection). Also, with a 0.05s cooldown, if you spammed rightclicks, it might take the spell long enough to cast again that you could in the meantime manage to issue a smart order. I suppose that a way around this would be, instead of giving the no target spell a cooldown, to simply ignore all no target spell orders a certain time after a left or right click detection instead of just one, but that could make pressing the left and right mouse button simultaneously harder to detect (but it's already not quite accurate with my current method).
09-24-2007, 12:32 PM#5
Toadcop
Alt+F4 no =\ you can use call ExecuteFunc("$uckmyball$") instead =)

yes something like that =)
09-24-2007, 05:14 PM#6
MaD[Lion]
thnx for helps guys ^^