Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2014-08-16 (original capture). Home · Forum · All archived topics · Downloads
August 15, 2014, 09:07:22 PM

Author Topic: es nearcoord problem  (Read 1039 times)

Offline Pearlsea

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • <3 WCS :)
es nearcoord problem
« on: October 20, 2010, 11:18:26 AM »
I've been coming up with a skill that will make an explosion at the coordinates. I've used wcs_ulti_suicide as a base and I'm fairly sure what I came up with would work if nearcoord worked. Can anyone help me or point me in the right direction of a workaround? Just to note theres some extra debugging lines to help me make sure I'm feeding the right coordinates into nearcoord. When I swap in est_near it will work but it's not what I want it to do.

http://pastebin.com/NuKYgtW2


Muse

  • Guest
Re: es nearcoord problem
« Reply #1 on: October 20, 2010, 11:29:41 AM »
Should be :


es nearcoord wcs_targetid server_var(wcs_team_targetn) server_var(wcs_x2) server_var(wcs_y2) server_var(wcs_z2)  radius radius radius "es_exists wcs_exists userid server_var(wcs_targetid);if (server_var(wcs_exists) = 1) then wcs_run_ulti_suicide1;if (server_var(wcs_exists) = 1) es_tell server_var(wcs_userid) failed


And this make nothing:

Code: [Select]
#
          es_xmath wcs_x2 add server_var(wcs_radius)
#
          es_xmath wcs_y2 add server_var(wcs_radius)
#
          es_xmath wcs_z2 add server_var(wcs_radius)
#
          es_xmath wcs_x3 subtract server_var(wcs_radius)
#
          es_xmath wcs_y3 subtract server_var(wcs_radius)
#
          es_xmath wcs_z3 subtract server_var(wcs_radius)

Offline Pearlsea

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • <3 WCS :)
Re: es nearcoord problem
« Reply #2 on: October 20, 2010, 12:02:35 PM »
I've just noticed that when I was in the shower, its funny how you can think about things better when you take a break. Anyways I've updated it to this and it's still not detecting.

http://pastebin.com/UMAtpWRH


Muse

  • Guest
Re: es nearcoord problem
« Reply #3 on: October 20, 2010, 12:23:47 PM »
then? does it works?

What anime in your sig from?

Offline Pearlsea

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • <3 WCS :)
Re: es nearcoord problem
« Reply #4 on: October 20, 2010, 12:35:34 PM »
I set the radius to 9000 and it still won't work.

The character is Mizore from rosario + vampire


Offline Pearlsea

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • <3 WCS :)
Re: es nearcoord problem
« Reply #5 on: October 20, 2010, 01:20:47 PM »
Using this line I found an error really similar to the one in this thread, can anyone help me with what would be the correct fix.

Code: [Select]
  es est_nearcoord wcs_targetid server_var(wcs_team_targetn) server_var(wcs_radius) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)  "es_exists wcs_exists userid server_var(wcs_targetid);if (server_var(wcs_exists) = 1) then wcs_run_ulti_suicide1;if (server_var(wcs_exists) = 0) es_tell server_var(wcs_userid) failed"      // no more needed

http://warcraft-source.com/board/index.php/topic,10670.0.html

Quote
*** EventScripts caught an exception:
Traceback (most recent call last):
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\es.py", line 341, in callBlock
    self.Blocks[blockname]()
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\_libs\python\cmdlib.py", line 173, in callbackServer
    cmd_manager.callback(cmd_manager.server_commands, es.getargv(0))
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\_libs\python\cmdlib.py", line 112, in callback
    cmdlist[name].execute(self.CMDArgs(es.getargv(x) for x in xrange(1, es.getargc())))
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\_libs\python\cmdlib.py", line 207, in execute
    self.callback(args)
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\estcommands\estcommands.py", line 168, in _callback
    if self.callback(args) is False:
  File "d:\program files\steam\steamapps\pearlsea\counter-strike source\cstrike\addons\eventscripts\estcommands\estcommands.py", line 2865, in nearCoord
    if player == userid:
NameError: global name 'userid' is not defined
0


Offline Yiyas

  • Level 7 Expert
  • *****
  • Posts: 494
  • The name's Bugger. De-Bugger.
Re: es nearcoord problem
« Reply #6 on: October 20, 2010, 01:28:42 PM »
Your estcommands seems different to me but from what I see on mine you should remove the "if player == userid: continue" part because it seems that it has been incorrectly left there after being copied from est_near (which is above it and similar).
I watch porn for the music.

Offline Pearlsea

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • <3 WCS :)
Re: es nearcoord problem
« Reply #7 on: October 20, 2010, 01:48:51 PM »
Your estcommands seems different to me but from what I see on mine you should remove the "if player == userid: continue" part because it seems that it has been incorrectly left there after being copied from est_near (which is above it and similar).

IT WORKED :D :D :D

Thank you very much. Tested with the 9000 and 170 radius, both seem to be working fine. Also any chance we can get an est commands fix sticky somewhere if any of these small errors come up which break the commands?

For future reference:
Code: [Select]
def nearCoord(args):
    """
    Executes a console command for every player in range of an x,y,z source
   
    @param str args[0] var The name of the variable which will be used to store the tempoary userid
    @param str args[1] est filter The filter that this near will pick up
    @param int args[2] distance The distance of the near command
    @param float args[3] x Source X Location
    @param float args[4] y Source Y Location
    @param float args[5] z Source Z Location
    @param str args[6] command The command string to execute for each player
    """
    source_x, source_y, source_z = map(float, args[3:6])
    for player in getUseridsFromFilters(args[1]):
        x, y, z = es.getplayerlocation(player)
        distance = ((source_x - x) ** 2 + (source_y - y) ** 2 + (source_z - z) ** 2) ** 0.5
        if distance <= float(args[2]):
            es.ServerVar(args[0]).set(player)
            es.server.cmd(args[6])
« Last Edit: October 20, 2010, 01:52:12 PM by Pearlsea »