Ok, sorry to revive a dead thread here, but I'm having trouble implementing the function. I created the traceline function as described with parameters:
Camera Position = (Position of Rogue [41.06, 88.89]) <Point>
Camera Height = TraceH <Real>
Player = 1 <Integer>
Where TraceH is:
TraceH = (+ (2.0, (Height of Main Unit), (Ground height at (Position of Main Unit)))) <Real>.
I then created an attack trigger:
Attack
Events
UI - Player 1 clicks Left mouse button Down.
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
traceline_currentTarget[1] == No Unit
Then
UI - Display "no unit targeted " for (All players) to Subtitle area
Unit - Create 1 Probe for player 1 at traceline_currentTargetPoint[1] using default facing (No Options)
Else
UI - Display (Name of (Unit type of traceline_currentTarget[1])) for (All players) to Subtitle area
Traceline((Position of Main Unit), TraceH, 1)
My problem is that the probe is being created (correctly) at traceline_currentTargetPoint[1], but traceline_currentTarget is not actually targeting a unit, so I get the message "no unit targeted", even though there are a bunch of neutral and enemy units between my unit and the probe. Am I missing something obvious here?
I'm attaching my map, which is basically a stripped-down version of One.Two's WoW map with some modifications to the camera and abilities. The attack trigger is under the folder "Player Spells" and it's called "Attack". In-game, press "f" to start 3rd person movement mode, and middle mouse button to bring back up mouse control.
Thanks!
--edited to reflect map update, now with camera that doesn't point directly at unit and crosshair. still doesn't work.--
0
Ok, sorry to revive a dead thread here, but I'm having trouble implementing the function. I created the traceline function as described with parameters:
Camera Position = (Position of Rogue [41.06, 88.89]) <Point>
Camera Height = TraceH <Real>
Player = 1 <Integer>
Where TraceH is:
TraceH = (+ (2.0, (Height of Main Unit), (Ground height at (Position of Main Unit)))) <Real>.
I then created an attack trigger:
Attack
Events
UI - Player 1 clicks Left mouse button Down.
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
traceline_currentTarget[1] == No Unit
Then
UI - Display "no unit targeted " for (All players) to Subtitle area
Unit - Create 1 Probe for player 1 at traceline_currentTargetPoint[1] using default facing (No Options)
Else
UI - Display (Name of (Unit type of traceline_currentTarget[1])) for (All players) to Subtitle area
Traceline((Position of Main Unit), TraceH, 1)
My problem is that the probe is being created (correctly) at traceline_currentTargetPoint[1], but traceline_currentTarget is not actually targeting a unit, so I get the message "no unit targeted", even though there are a bunch of neutral and enemy units between my unit and the probe. Am I missing something obvious here?
I'm attaching my map, which is basically a stripped-down version of One.Two's WoW map with some modifications to the camera and abilities. The attack trigger is under the folder "Player Spells" and it's called "Attack". In-game, press "f" to start 3rd person movement mode, and middle mouse button to bring back up mouse control.
Thanks!
--edited to reflect map update, now with camera that doesn't point directly at unit and crosshair. still doesn't work.--