Search found 241 matches

by Mahi
Wed Oct 28, 2015 10:12 pm
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

Yeah I'm starting to lean on Ayuto's solution after the C++ argument (although I still don't agree with everything). Any possibility of adding a method which gets the event variables as a dict? Unless you plan on making the GameEvent object iterable/mapping, in which case I can't see much use for su...
by Mahi
Wed Oct 28, 2015 6:24 pm
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

The "event_name" workaround to keep the event name is problematic, because it can happen that an event has the event variable "event_name". In that case it would be overridden. Moreover it's not logical to put it in the dict, because it's obviously not an event variable. If someone wants to break t...
by Mahi
Wed Oct 28, 2015 2:58 am
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

The hitbox for the delete button seems to be messed up, it goes far below the visual button. But I'm going offtopic here, just felt like letting you know, and obviously can't edit the old comment due to the delete bug
by Mahi
Wed Oct 28, 2015 2:54 am
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

Did you look at the implementation in the new branch? The Event decorator just wraps event_manager.(un)register_for_event (same with PreEvent and pre_event_manager). The conversion just needs to take place prior to looping through the registered callbacks for the given event. Events Pre-Events I'm ...
by Mahi
Wed Oct 28, 2015 2:40 am
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

Python it is! If you end up using my implementation, feel free to modify it however you please. The __call__() method should probably take only one callback function as an argument, instead of argument amount of callback functions. Although, if possible, you're probably better off implementing this ...
by Mahi
Wed Oct 28, 2015 12:17 am
Forum: API Design
Topic: Time to get rid of the GameEvent objects and move to dictionaries?
Replies: 27
Views: 37683

Time to get rid of the GameEvent objects and move to dictionaries?

As far as I know, Source.Python has always had the following syntax (in one way or another) for event callbacks: def player_hurt(event): print('Userid: {0}'.format(event.get_int('userid')) print('Weapon: {0}'.format(event.get_string(...
by Mahi
Tue Oct 27, 2015 3:49 pm
Forum: Plugin Requests
Topic: Forum rules
Replies: 3
Views: 48955

Predz wrote:I wanna request a plugin, that when ever Predz is to join a server, he is given infinite god mode and infinite ammunition! :D

Everyone please use this plugin as Predz will appreciate very mooch.

Syntax: Select all

something_something_ban_predz_something_something()
by Mahi
Tue Oct 27, 2015 3:46 pm
Forum: Plugin Development Support
Topic: Error when subclassing PlayerEntity and adding new attributes
Replies: 2
Views: 2375

satoon101 wrote:You need to call the super class' __init__ prior to setting a new attribute.

I'm not calling it at all... How could I miss that, thanks!
by Mahi
Tue Oct 27, 2015 3:38 pm
Forum: Plugin Development Support
Topic: Error when subclassing PlayerEntity and adding new attributes
Replies: 2
Views: 2375

Error when subclassing PlayerEntity and adding new attributes

My EasyPlayer causes an error when trying to use it: [SP] Caught an Exception: Traceback (most recent call last): File '..\addons\source-python\packages\source-python\events\listener.py', line 92, in fire_game_event callback(game_event) File '..\addons\source-python\plugins\test\test.py', line 12, i...
by Mahi
Tue Oct 27, 2015 3:09 pm
Forum: Plugin Requests
Topic: Forum rules
Replies: 3
Views: 48955

*Joyful clapping*
by Mahi
Tue Oct 27, 2015 2:18 pm
Forum: Custom Packages
Topic: EasyPlayer
Replies: 15
Views: 36457

Version 1.0 is out, should be stable with the latest SP: https://github.com/MarkusMeskanen/EasyPlayer/releases/tag/v1.0
by Mahi
Mon Oct 05, 2015 10:13 am
Forum: Plugin Development Support
Topic: What IDE do you use?
Replies: 5
Views: 4477

Actually, you can do that with Notepad++ as well. To run the program with a Python interpreter you only need to install a plugin. Sublime also has multiple cursors. Notepad++ too. :) https://notepad-plus-plus.org/features/multi-editing.html You download Plugin Manager by executing one command throu...
by Mahi
Sun Oct 04, 2015 11:08 pm
Forum: Plugin Development Support
Topic: What IDE do you use?
Replies: 5
Views: 4477

IntelliSense works just fine, but there are better alternatives. If you want a full IDE with all the cool features, you should take a look at PyCharm. But before you do, please read through this post! A full IDE instead of a text-editor that's capable of doing IDE stuff is a bit of an overkill for P...
by Mahi
Thu Aug 13, 2015 9:05 pm
Forum: News & Announcements
Topic: Aug 2 - New Release!!
Replies: 22
Views: 49013

I will help as much as I can. Currently I am in the process of learning Python, I look forward to seeing it get support. Are you, by any chance, from r/learnpython? :D No I was looking around SourceMod and was considering learning C for SourcePawn, but I'd rather start with an OOP language to then ...
by Mahi
Thu Aug 13, 2015 11:14 am
Forum: News & Announcements
Topic: Aug 2 - New Release!!
Replies: 22
Views: 49013

Kakkoii wrote:I will help as much as I can. Currently I am in the process of learning Python, I look forward to seeing it get support.
Are you, by any chance, from r/learnpython? :D
by Mahi
Sat Aug 08, 2015 3:38 pm
Forum: API Design
Topic: EntityPreHook/EntityPostHook changes
Replies: 5
Views: 12185

Oh, that's probably what was causing some random (well, they seemed random at first, never had time to debug) crashes on my EasyPlayer! Since I usually tested the plugins while I was already on the server, I think it often crashed when I joined the server (thus the server adding bots before me). Als...
by Mahi
Sat Aug 08, 2015 1:41 pm
Forum: API Design
Topic: EntityPreHook/EntityPostHook changes
Replies: 5
Views: 12185

How is this an improvement over @EntityPreHook('player', 'bump_weapon'), does it allow more hooks to be made or something similar? Just curious, since "This implementation allows you maximum flexibility." doesn't tell much to a person who's not too knowledgeable of the Source engine. :)
by Mahi
Sun Aug 02, 2015 8:07 pm
Forum: API Design
Topic: PreEvent and changes to Event
Replies: 6
Views: 10992

That will only block the event itself, not the actual damage to the player. To block the damage itself, pre-hook on_take_damage and return False to block that function. Oh, right! So if I want to stop all skills in my Hero-Wars, as well as prevent the damage from being taken, I just pre-hook them b...
by Mahi
Sun Aug 02, 2015 12:50 pm
Forum: API Design
Topic: PreEvent and changes to Event
Replies: 6
Views: 10992

Awesome! I've personally (for no reason, just a personal preference) always preferred passing the name as a string to decorators, instead of having to rely on function names. Does the EventActions.BLOCK mean we can do a 33% evasion like so: from events.hooks import EventAction from events.hooks impo...
by Mahi
Sat Aug 01, 2015 8:04 am
Forum: Custom Packages
Topic: EasyPlayer
Replies: 15
Views: 36457

Updated: https://github.com/MarkusMeskanen/EasyPlayer/commit/e593e0ac0589fd8bdfe1fc6174d1bd26c0d92c88 Instead of using tick_delays.delay(), I've monkey-patched the events.listener._EventListener.fire_game_event method to call EasyPlayer's events after all other events have been called.

Go to advanced search