Search found 241 matches
- 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: 37645
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...
- 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: 37645
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...
- 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: 37645
- 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: 37645
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 ...
- 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: 37645
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 ...
- 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: 37645
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(...
- Tue Oct 27, 2015 3:49 pm
- Forum: Plugin Requests
- Topic: Forum rules
- Replies: 3
- Views: 48748
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()
- Tue Oct 27, 2015 3:46 pm
- Forum: Plugin Development Support
- Topic: Error when subclassing PlayerEntity and adding new attributes
- Replies: 2
- Views: 2375
- 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...
- Tue Oct 27, 2015 3:09 pm
- Forum: Plugin Requests
- Topic: Forum rules
- Replies: 3
- Views: 48748
- Tue Oct 27, 2015 2:18 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 36280
Version 1.0 is out, should be stable with the latest SP: https://github.com/MarkusMeskanen/EasyPlayer/releases/tag/v1.0
- 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...
- 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...
- Thu Aug 13, 2015 9:05 pm
- Forum: News & Announcements
- Topic: Aug 2 - New Release!!
- Replies: 22
- Views: 48833
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 ...
- Thu Aug 13, 2015 11:14 am
- Forum: News & Announcements
- Topic: Aug 2 - New Release!!
- Replies: 22
- Views: 48833
- Sat Aug 08, 2015 3:38 pm
- Forum: API Design
- Topic: EntityPreHook/EntityPostHook changes
- Replies: 5
- Views: 12169
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...
- Sat Aug 08, 2015 1:41 pm
- Forum: API Design
- Topic: EntityPreHook/EntityPostHook changes
- Replies: 5
- Views: 12169
- Sun Aug 02, 2015 8:07 pm
- Forum: API Design
- Topic: PreEvent and changes to Event
- Replies: 6
- Views: 10970
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...
- Sun Aug 02, 2015 12:50 pm
- Forum: API Design
- Topic: PreEvent and changes to Event
- Replies: 6
- Views: 10970
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...
- Sat Aug 01, 2015 8:04 am
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 36280