Resources > Tutorials
[Trigger] How to Target with Mouselook (Tracelines)
- 89 posts
- ← Previous
- 1
- 2
- 3
- 4
- 5
-
tutstuts Regular Shmoe
- Join date
- Sep 22, 2010
- Location
- Sweden
- Reputation
- 0
- Posts
- 2
- Last login
- Oct 11, 2010
-
RageQit Author
- Join date
- Aug 14, 2010
- Location
- Australia
- Reputation
- 0
- Posts
- 129
- Projects
- 1
- Last login
- Oct 14, 2011
is the reason the maps wont save is because the line
lv_closestUnit != gv_mainUnit
doesnt account for the fact that the mainUnit is an array for most people? therefore the line should read:
lv_closestUnit != gv_mainUnit[lp_player]
Please update your script to identify that by using an array the array number must also be identified
Last edited Oct 26, 2010 by RageQit
-
Reaper872 Regular Shmoe
- Join date
- Jan 08, 2011
- Location
- United States
- Reputation
- 0
- Posts
- 1,153
- Last login
- Jun 15, 2012
Hey guys. I am making a third person shooter and the line lv_closestUnit != gv_mainUnit doesn't work! I have tried and tried and tried. It keeps giving me errors even thought I looked over the tutural like 10 times! PLEASE HELP.
Want to be a member of a team who makes fun maps? Join Team War! We are a small, but idea filled new clan and we'd love new members.
-
Keyeszx Regular Shmoe
- Battle.net
- Keyeszx
- #854 NA
- Join date
- Aug 06, 2010
- Location
- United States
- Reputation
- 4
- Posts
- 1,518
- Team
- Last login
- Dec 31, 2012
I'm making a hero arena and want to use tracelines to target the other players. Similar to smashcraft. I want the unit to be where the line starts from and the point clicked to be where the line ends. So it could be more than 50 units or less. How would I deal with this?

-
admielke Author
- Join date
- Nov 25, 2010
- Location
- United States
- Reputation
- 0
- Posts
- 202
- Projects
- 1
- Last login
- May 16, 2013
Quote from rrowland: Go
In a recurring function (Every 0.0 seconds, etc). This is useful if you want to use the current target information to display info to the player about the unit they're looking at. You can see an example of this in my Reaper Madness videos. You can then use the SAME information (You don't have to run the traceline twice) to determine which unit or piece of terrain to shoot when the player hits the attack key (such as left mouse click).
Could you go more into this? I would like to just create a dialog item that displays the health (bar and percentage) of the traceline_currentTarget.
One other question if it is possible to do head shots? Maybe figure the height of each enemy mob and do an If Than Else* action to check to see what the traceline_currentTargetHeight is if it is between the specific "head" area. Is there any way to check to do a data reference on the "head" attachment origin of the traceline_currentTargetUnit through the Attachment Methods tab of the Data Editor.
-
vecor Regular Shmoe
- Join date
- Mar 25, 2013
- Location
- Canada
- Reputation
- 0
- Posts
- 4
- Last login
- Apr 05, 2013
hi if someone can helpi that will be apreciated
i dont understand this part
Next we'll want to start in on our code. As explained earlier, we will be checking each point in small intervals in a loop. So, we need to set up the loop. Create a variable named "Trace Distance" (real) and set its initial value to 0.0. This variable will keep track of how far along the imaginary line we are. Now we'll set up our loop:
while(lv_traceDistance < 50.0) { While Trace Distance is under our max range, 50, we want to run everything between the squiggly brackets: {} This is where all of our future code is going to go. lv_traceDistance += 0.5; At the end of the loop we increment our distance from the camera by 0.5 units. Since the maximum distance is 50.0, this loop will run up to 100 times. }
i dont understand what to do wit this what is it while(lv_traceDistance < 50.0) { While Trace Distance is under our max range, 50, we want to run everything between the squiggly brackets: {} This is where all of our future code is going to go. lv_traceDistance += 0.5; At the end of the loop we increment our distance from the camera by 0.5 units. Since the maximum distance is 50.0, this loop will run up to 100 times. }
sorry for bad english
- 89 posts
- ← Previous
- 1
- 2
- 3
- 4
- 5
rrowland AuthorThat error tells me your Closest Unit and Main Unit variables are not both Unit variables.
We are currently recruiting skilled individuals for Wired for Blood: