Home   Help Search Login Register  

Author Topic: Detecting mapclicking  (Read 590 times)

0 Members and 2 Guests are viewing this topic.

GeneralCoder

  • Guest
Detecting mapclicking
« on: 17 Mar 2003, 14:33:15 »
How can I get the position where user clicked the map?

what I tryed was this:
OnMapSingleClick _pos

but the result is just 'anything'  ???

Offline Spinor

  • Members
  • *
  • I'm a llama!
    • The chain of command
Re:Detecting mapclicking
« Reply #1 on: 17 Mar 2003, 16:01:20 »
The argument of onMapSingleClick must be a code string. The code within the string is executed everytime the player clicks the map. Within the code string, the variables _pos, _alt, _shift, _units are reserved and represent the click position, the status of the ALT and SHIFT buttons (true or false), and an array of the selected units, respecively. E.g.:
Code: [Select]
onMapSingleClick {[_pos, _shift, _alt, _units] exec "detectClick.sqs"}This simply calls the script "detectClick.sqs" upon map click, and all the relevant paramters are passed as arguments into the script, e.g. _pos = _this select 0.

GeneralCoder

  • Guest
Re:Detecting mapclicking
« Reply #2 on: 17 Mar 2003, 22:06:41 »
The argument of onMapSingleClick must be a code string. The code within the string is executed everytime the player clicks the map. Within the code string, the variables _pos, _alt, _shift, _units are reserved and represent the click position, the status of the ALT and SHIFT buttons (true or false), and an array of the selected units, respecively. E.g.:
Code: [Select]
onMapSingleClick {[_pos, _shift, _alt, _units] exec "detectClick.sqs"}This simply calls the script "detectClick.sqs" upon map click, and all the relevant paramters are passed as arguments into the script, e.g. _pos = _this select 0.

allright thanks!