Hey guys today I'll show you how to use wcs_nearcoord! First of all do not try to use est_near, est_nearcoord or es nearcoord as they wont work propably!
For wcs_nearcoord we have the following syntax:
1. The first thing we have to do is to set the Variable.
If you want to use any variable with wcs_ infront of it thats most of the time enought. If you want to use your "own" variables (they can be whatever you want e.g xyz or uber_race_variable1) you have to "create" them first by adding:
Be sure to have that in the skill BEFORE you use the variable. For our example we will use wcs_players
2. Now we come to the identifier.
The identifier tells the wcs_nearcoord what team / what persons to affect and which persons it should leave alone.
Basicly there are the three "big" identifiers, #ct , #t and #all.
You can find the other identifiers here : http://www.eventscripts.com/pages/Foreach_player
Using identifier teamspecific within an ultimate will require you to get the players team first and then set the target team according to that. For example :
This would set targetteam to your enemys team. For using nearcoord on your own team just exchange #ct with #t.
3. The Coordinates:
This is quite easy as its the same for every nearcoord over and over again. You can either get the players location or the location he is looking at.
For players location it would be :
For viewcoords it would be:
Thats it for coords already.
4. Adjusting the range.
The range defines in what range your nearcoord command should work. A players height is about 90-100 game units (just to make it less abstract). So adding a 100 range to wcs_nearcoord would make it a circle that has 100 game units in every direction starting from the coordinates given. So range is the same as the geometrical word radius.
5. Last but not Least : The Command!
Now lets come to the command. Most commands require some userid given. For example wcs_setfx speed 2 = 2 5.
This would set speed of player with userid 2 to 2 for 5 seconds. But we dont have ONE specific userid so nearcoord gets around that using the variable we gave it before.
So in our case it would be :
Basicly Nearcoord loops through all userids in range and puts them to wcs_players variable.
6 The Result:
All together we had this:
For wcs_nearcoord we have the following syntax:
Code: [Select]
wcs_nearcoord <var> <identifier> <x coord> <y coord> <z coord> <range> <"command to run">1. The first thing we have to do is to set the Variable.
If you want to use any variable with wcs_ infront of it thats most of the time enought. If you want to use your "own" variables (they can be whatever you want e.g xyz or uber_race_variable1) you have to "create" them first by adding:
Code: [Select]
es_xset <variable> 0Be sure to have that in the skill BEFORE you use the variable. For our example we will use wcs_players
2. Now we come to the identifier.
The identifier tells the wcs_nearcoord what team / what persons to affect and which persons it should leave alone.
Basicly there are the three "big" identifiers, #ct , #t and #all.
You can find the other identifiers here : http://www.eventscripts.com/pages/Foreach_player
Using identifier teamspecific within an ultimate will require you to get the players team first and then set the target team according to that. For example :
Code: [Select]
es_getplayerteam wcs_team server_var(wcs_userid)
if (server_var(wcs_team) = 2) then es_xset wcs_targetteam #ct
if (server_var(wcs_team) = 3) then es_xset wcs_targetteam #tThis would set targetteam to your enemys team. For using nearcoord on your own team just exchange #ct with #t.
3. The Coordinates:
This is quite easy as its the same for every nearcoord over and over again. You can either get the players location or the location he is looking at.
For players location it would be :
Code: [Select]
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_userid)For viewcoords it would be:
Code: [Select]
es playerget viewcoords server_var(wcs_userid) wcs_x1 wcs_y1 wcs_z1Thats it for coords already.
4. Adjusting the range.
The range defines in what range your nearcoord command should work. A players height is about 90-100 game units (just to make it less abstract). So adding a 100 range to wcs_nearcoord would make it a circle that has 100 game units in every direction starting from the coordinates given. So range is the same as the geometrical word radius.
5. Last but not Least : The Command!
Now lets come to the command. Most commands require some userid given. For example wcs_setfx speed 2 = 2 5.
This would set speed of player with userid 2 to 2 for 5 seconds. But we dont have ONE specific userid so nearcoord gets around that using the variable we gave it before.
So in our case it would be :
Code: [Select]
es wcs_setfx speed server_var(wcs_players) = 2 5Basicly Nearcoord loops through all userids in range and puts them to wcs_players variable.
6 The Result:
All together we had this:
Code: [Select]
es_getplayerteam wcs_team server_var(wcs_userid)
if (server_var(wcs_team) = 2) then es_xset wcs_targetteam #ct
if (server_var(wcs_team) = 3) then es_xset wcs_targetteam #t
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_userid)
es wcs_nearcoord wcs_players server_var(wcs_targetteam) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 300 "es wcs_setfx speed server_var(Wcs_players) = 2 5"

