gg_noblock issue and wish list :))

Ask questions and share info about GunGame 5

gg_noblock issue and wish list :))

Postby Shadow » Sun Jan 08, 2012 2:14 am

I used to use the NoBlock "Approved addon" from EventScript with GG Version 5.1.591 and had no issues with it.
http://addons.eventscripts.com/addons/view/bnb_nnt

Since I am on GG Version 5.1.610, I now get the below error and it keeps on scrolling none stop in the console:

KeyError: 3
*** EventScripts caught an exception:
Traceback (most recent call last):
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\es.py", line 279, in t
ick
    x()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 56, in _tickListener
    self.players[userid].setNoBlock()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 12, in setNoBlock
    if not self.isdead:
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 31, in isdead
    return self.properties['isdead']
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 23, in properties
    return es.createplayerlist(self.userid)[int(self.userid)]

I know GG51 has its own gg_noblock module but it's for all team! Would it be possible to have the option "no block Team only" in a NEAR future version :mrgreen: ?
Shadow

Corporal
Corporal
 
Posts: 204
Joined: Thu Mar 12, 2009 2:57 am

Postby satoon101 » Sun Jan 08, 2012 3:16 am

That error has nothing to do with GunGame, as it isn't even a Custom GG Addon. It is simply an EventScripts addon that can run alongside GG51. There should be at least 1 more line to that error, which would be what the actual error is. Could you post that, and maybe I can help you fix the error?

Also, since this isn't GG related, I moved it to a more appropriate forum.

As for having a built-in GG addon, I might look into using the new Alpha SPE to see if there is a better way to do this (which I'm sure there is). No promises, though, but I will look into it.

Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby Shadow » Sun Jan 08, 2012 5:21 am

It's all I get, at the speed it scrolls when it starts... it is so hard to try and copy/ paste it when it starts to occur... It freeses my remote control seesion just trying to select the Mark option and after try to copy it and paste it into a notepad!

*** EventScripts caught an exception:
Traceback (most recent call last):
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\es.py", line 279, in t
ick
    x()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 56, in _tickListener
    self.players[userid].setNoBlock()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 12, in setNoBlock
    if not self.isdead:
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 31, in isdead
    return self.properties['isdead']
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 23, in properties
    return es.createplayerlist(self.userid)[int(self.userid)]
KeyError: 3
*** EventScripts caught an exception:
Traceback (most recent call last):
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\es.py", line 279, in t
ick
    x()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 56, in _tickListener
    self.players[userid].setNoBlock()
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 12, in setNoBlock
    if not self.isdead:
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 31, in isdead
    return self.properties['isdead']
  File "D:\Valve\GG51-DEV\css\cstrike\addons\eventscripts\bnb_nnt\bnb_nnt.py", l
ine 23, in properties
    return es.createplayerlist(self.userid)[int(self.userid)]
Shadow

Corporal
Corporal
 
Posts: 204
Joined: Thu Mar 12, 2009 2:57 am

Postby satoon101 » Sun Jan 08, 2012 5:32 am

Ahh, ok, the error is in that one:That is what I was thinking it would be.

You might try this for the time being to remove that error (though it is really a harmless error):
import es
import vecmath
from playerlib import getPlayer

class FakeProperties(dict):
    def __getitem__(self, item):
        return False

class BnB(object):
    class Player(object):
        def __init__(self, userid):
            self.userid = userid
            self.player = getPlayer(userid)
       
        def setNoBlock(self):
            if not self.isdead:
                nearest = self.player.getClosestPlayer(2 if self.team == 3 else 3)
                if nearest[0] is not None:
                    distance = vecmath.distance(vecmath.vector(es.getplayerlocation(self.userid)), vecmath.vector(es.getplayerlocation(nearest[1])))
                    if distance <= 110:
                        self.player.noblock(0)
                    else:
                        self.player.noblock(1)
       
        @property
        def properties(self):
            player = es.createplayerlist(self.userid)
            if int(self.userid) in player:
                return player[int(self.userid)]
            return FakeProperties()
       
        @property
        def team(self):
            return self.properties['teamid']
       
        @property
        def isdead(self):
            return self.properties['isdead']
   
    def __init__(self):
        self.players = {}
   
    def insertUserid(self, userid):
        self.players[str(userid)] = self.Player(userid)
   
    def removeUserid(self, userid=0, clear=False):
        if not clear:
            del self.players[userid]
        else:
            self.players.clear()
   
    def scriptLoad(self):
        for userid in es.getUseridList():
            self.insertUserid(userid)
        es.addons.registerTickListener(self._tickListener)
   
    def scriptUnload(self):
        self.removeUserid(clear=True)
        es.addons.unregisterTickListener(self._tickListener)
   
    def _tickListener(self):
        for userid in self.players:
            self.players[userid].setNoBlock()

bnb = BnB()

def es_map_start(ev):
    bnb.removeUserid(clear=True)

def player_activate(ev):
    bnb.insertUserid(ev['userid'])

def player_disconnect(ev):
    bnb.removeUserid(ev['userid'])

def load():
    bnb.scriptLoad()

def unload():
    bnb.scriptUnload()
Satoon
satoon101

Site Admin
Site Admin
 
Posts: 1055
Joined: Thu Oct 09, 2008 4:27 pm

Postby Shadow » Mon Jan 09, 2012 12:50 am

Thank you very much for the quick fix it seems to be stable... So far so good , it is greatly appreciated :)
It was not preventing the server from working but it was making the console unusable. Couldn't even type "quit"
When you guys have new GG51 version to test, can I be added to your testers? I have a 24 /7 DEV server running all the time.
Shadow

Corporal
Corporal
 
Posts: 204
Joined: Thu Mar 12, 2009 2:57 am

Postby PlasteR » Sat Mar 24, 2012 2:44 pm

Welcome. It works well this noblock someone? On my server runs noblock, but some weapons falling into the ground + client crash ..
PlasteR

Private
Private
 
Posts: 15
Joined: Thu Feb 24, 2011 11:46 am
Steam Friends Name: PlasteR



Return to General Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

cron