Search found 218 matches

by Mahi
Sat May 06, 2017 8:54 am
Forum: Custom Packages
Topic: [Any] Idle Manager
Replies: 5
Views: 12624

Re: [Any] Idle Manager

Looks really nice, good job! One thing that catches my eye is the naming conventions. Function names should be snake_case instead of CamelCase , according to the PEP8 at least. So you should probably make these changes: ⋅  ResetIdleTimer => reset_idle_timer ⋅  SetIdle => set_idle...
by Mahi
Wed Apr 12, 2017 9:35 am
Forum: General Discussion
Topic: Python 3.6 support?
Replies: 13
Views: 7552

Re: Python 3.6 support?

Glad to hear it's under the radar! Not to hurry, but can't wait! :wink:
by Mahi
Tue Apr 11, 2017 12:49 pm
Forum: General Discussion
Topic: Python 3.6 support?
Replies: 13
Views: 7552

Python 3.6 support?

Are there any plans or ETA to add Python 3.6 support? There are a few huge things in it, namely faster dicts, f-strings, and __init_subclass__(), last of which I'd love to get my hands on already. I believe the f-strings make it worthy upgrade for almost any SP plugin though.
by Mahi
Fri Mar 24, 2017 4:27 pm
Forum: Whatever
Topic: Hello everyone! i didn't know where to post so here i am!
Replies: 7
Views: 12355

Re: Hello everyone! i didn't know where to post so here i am!

Sorry for the late. Well, about the python is slow i worked a lot with web frameworks and it was really slow i think it was about 2000 request per seconds... Python is on the slower end surely, but I believe even the worst frameworks do better than that. Flask can do 10000 requests per second and a...
by Mahi
Fri Feb 24, 2017 5:54 pm
Forum: Plugin Development Support
Topic: Error when trying to use Player's metaclass with SQLAlchemy's
Replies: 17
Views: 8439

Re: Error when trying to use Player's metaclass with SQLAlchemy's

Bumping the thread due to starting to work on this again :D We started working on a fix for this this morning, but we realized that any fix for this would mask the same error happening when someone forgets to call super().__init__ in their inheriting class. That is certainly not something we would w...
by Mahi
Tue Feb 21, 2017 3:59 pm
Forum: Plugin Development Support
Topic: Apply skin cause csgo game crash
Replies: 16
Views: 7349

Re: Apply skin cause csgo game crash

Is this the whole code? Since this should not work. You're mixing the events from my Wacraft mod with Source.Python's default events. You should try something like this: from players.entity import Player _model = Model('models/props/cs_militia/toilet.mdl') @Event('player_spaw...
by Mahi
Fri Oct 14, 2016 9:42 am
Forum: Plugin Releases
Topic: [ANY] Infinite Jumping (aka AutoBHop)
Replies: 6
Views: 5422

Re: Infinite Jumping (aka AutoBHop)

CS:GO just got a new update which implements this http://blog.counter-strike.net/index.php/2016/10/16312/ — sv_enablebunnyhopping (default 0): Disables the air-velocity clamping to 110% of maximum running speed. — sv_autobunnyhopping (default 0): Holding +jump causes players to automatically re-jump...
by Mahi
Wed Oct 05, 2016 10:46 am
Forum: Plugin Development Support
Topic: Is it possible to check if a function has been decorated with a listener?
Replies: 1
Views: 1913

Is it possible to check if a function has been decorated with a listener?

For example, is it possible to know from my_listener that it has been decorated here: @OnLevelChange def my_listener(...): pass I'm using a class decorator and I need to loop through all of the class's methods, and if they have been decorated with a listener, I need to wrap them. Basically t...
by Mahi
Sat Oct 01, 2016 3:39 pm
Forum: Plugin Development Support
Topic: Error when trying to use Player's metaclass with SQLAlchemy's
Replies: 17
Views: 8439

Re: Error when trying to use Player's metaclass with SQLAlchemy's

Thanks, I'll take a look at the workaround tomorrow! :) We started working on a fix for this this morning, but we realized that any fix for this would mask the same error happening when someone forgets to call super().__init__ in their inheriting class. That is certainly not something we would want ...
by Mahi
Fri Sep 30, 2016 5:49 pm
Forum: Plugin Development Support
Topic: Error when trying to use Player's metaclass with SQLAlchemy's
Replies: 17
Views: 8439

Re: Error when trying to use Player's metaclass with SQLAlchemy's

I've done some further testing, and this is 99% the issue. The following code works fine and creates a database of all jumping players with boolean value of 1 to the _player column: from sqlalchemy import create_engine, Boolean, Column, Integer from sqlalchemy.orm import sessionmaker from sqlalchemy...
by Mahi
Thu Sep 29, 2016 2:02 pm
Forum: Whatever
Topic: Split screen support! Probably just spectating, but maybe...
Replies: 5
Views: 4160

Re: Split screen support! Probably just spectating, but maybe...

I'll update if I got time later on today! :) Also, lol at this guy: https://www.reddit.com/r/GlobalOffensive/comments/551au0/split_screen_multiplayer_or_official_split_screen/d86vrsv Edit: Nvm he deleted it, it said something like "First I wondered why would your plugin break from this -- then ...
by Mahi
Thu Sep 29, 2016 10:18 am
Forum: Whatever
Topic: Split screen support! Probably just spectating, but maybe...
Replies: 5
Views: 4160

Split screen support! Probably just spectating, but maybe...

Apparently player events got a new splitscreenplayer argument: https://www.reddit.com/r/GlobalOffensive/comments/551au0/split_screen_multiplayer_or_official_split_screen/ If this ends up being a multiplayer split screen, we could have some new ideas for new mods! Some kind of duo puzzle which "...
by Mahi
Tue Sep 27, 2016 3:59 pm
Forum: Plugin Development Support
Topic: Why does this missing import NOT raise an error?
Replies: 2
Views: 2340

Re: Why does this missing import NOT raise an error?

Ohhh, that's exactly it! I didn't know that it's enough for one file to import it like that if it's all in the same package. TIL, thanks :)

Edit: Just to be sure, I recommend nobody to start doing this just because it works.
by Mahi
Tue Sep 27, 2016 2:38 pm
Forum: Plugin Development Support
Topic: Why does this missing import NOT raise an error?
Replies: 2
Views: 2340

Why does this missing import NOT raise an error?

It seems like I've forgotten an import, but for one reason or another the code runs just fine and no errors are raised: https://github.com/Mahi/Warcraft-SP/blo ... ft.py#L186

I never import warcraft.listeners...
by Mahi
Sun Sep 25, 2016 10:23 pm
Forum: Plugin Development Support
Topic: Error when trying to use Player's metaclass with SQLAlchemy's
Replies: 17
Views: 8439

Re: Error when trying to use Player's metaclass with SQLAlchemy's

Ayuto wrote:The problems are caused by the implementation of Entity.__getattr__ and Entity.__setattr__. If you use BaseEntity instead of Player, it seems to work fine.
So this is an SP problem for sure? Should I put up an issue on GitHub :confused:
by Mahi
Sun Sep 25, 2016 7:09 pm
Forum: Plugin Development Support
Topic: Need help to decide which cooldown method is best
Replies: 10
Views: 6025

Re: Need help to decide which cooldown method is best

When you are talking about readability: yes. Indeed, and that means a lot since I value readability and easiness very high! I want these skills to be readable and copy/paste-able by beginners too so they can make their own skills with very little knowledge of Python. And a hundred subclasses is sli...
by Mahi
Sun Sep 25, 2016 6:08 pm
Forum: Plugin Development Support
Topic: Need help to decide which cooldown method is best
Replies: 10
Views: 6025

Re: Need help to decide which cooldown method is best

Would you rather override __init__() in a hundred subclasses and define separate cooldown manually for every method which happens to need them, or would you have self.cooldowns = defaultdict(Cooldown) in the base class and then never have to worry about initializing your cooldowns in...
by Mahi
Sun Sep 25, 2016 5:13 pm
Forum: Plugin Development Support
Topic: Need help to decide which cooldown method is best
Replies: 10
Views: 6025

Re: Need help to decide which cooldown method is best

Well, say for example, upon 'player_attack' (which activates automatically whenever you attack someone) you gather one "blood stack" with a maximum of one stack every 5 seconds (player_attack method needs 5 second cooldown), and then upon player_victim (which activates automatically whenev...
by Mahi
Sun Sep 25, 2016 4:16 pm
Forum: Plugin Development Support
Topic: Need help to decide which cooldown method is best
Replies: 10
Views: 6025

Re: Need help to decide which cooldown method is best

A skill can be activated via any event (including user "activating" it manually via console commands), so @callback('player_spawn') might have different cooldown than @callback('player_jump')
by Mahi
Sun Sep 25, 2016 3:08 pm
Forum: Plugin Development Support
Topic: Need help to decide which cooldown method is best
Replies: 10
Views: 6025

Re: Need help to decide which cooldown method is best

I was thinking of similar Cooldown class as yours, but for my implentation each skill has its own dict, not one dict for all skills. This allows different methods of the skill to have different cooldowns. But most people seem to agree to use the first method, I guess that's it then :)

Go to advanced search