Welcome, Guest Friday 18th April 2014, 20:03:45
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: [SOLVED] cursorTarget  (Read 573 times)
0 Members and 1 Guest are viewing this topic.
JasonO
OFPEC Patron
****
Offline Offline


Oh no...


WWW
« on: 17 Jun 2009, 18:33:30 »

Hey,

Anyone managed to get this working?

It's added in ArmA2 but the syntax it uses is wrong (or the command is dead).

http://www.arma2.com/comref/full.html#cursorTarget
« Last Edit: 17 Jun 2009, 22:46:26 by JasonO » Logged

Spooner
*
Offline Offline


Mostly useless


WWW
« Reply #1 on: 17 Jun 2009, 19:03:32 »

Yeah, it works fine for me if you ignore the example:
Code: (run in init.sqf)
[] spawn { waitUntil { hint str cursorTarget; false } };
Note that it detects vehicles, units and buildings (even map-placed buildings), but not trees or bushes.

Can't believe how much effort I had trying to make a decent workaround for this command in A1!
Logged

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)
Worldeater
Editors Depot
Administrator
*****
Offline Offline


Suum cuique


« Reply #2 on: 17 Jun 2009, 19:56:10 »

Code: (init field)
glanceOfDeath = compile "waitUntil { cursorTarget setDamage (random 1); sleep 0.1; false };"; dummy = [] spawn glanceOfDeath;

... f34r!1!! Cheesy
Logged

try { return true; } finally { return false; }
Spooner
*
Offline Offline


Mostly useless


WWW
« Reply #3 on: 17 Jun 2009, 21:07:02 »

You'll never kill anyone that way, since you are setDamageing to random 1 (which is 0 up to, but not including 1). You'll also end up healing sometimes Wink

Also confused why compiling where you could just use standard function creation with {}.
Code: (init field)
glanceOfDeath = { waitUntil { cursorTarget setDamage (random 1); sleep 0.1; false };}; dummy = [] spawn glanceOfDeath;
or even simpler:
Code: (init field)
call { [] spawn { waitUntil { cursorTarget setDamage (random 1); sleep 0.1; false };};
Logged

[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)
JasonO
OFPEC Patron
****
Offline Offline


Oh no...


WWW
« Reply #4 on: 17 Jun 2009, 22:46:15 »

Hehe.

I'm an SQS whore, and always have been - even in ArmA!

However I'm told I supposidly can benefit from SQF, so got my thinking cap out the draw. I do PHP where the kinda c++ derived syntax is very similar in places.

The commands etc are the same and most concepts of the engine I know, so just to learn that flippin' syntax!

Works great Spooner! Helped a lot Smiley
Logged

Pages: [1]   Go Up
  Send this topicPrint  
 
Jump to: