Search found 241 matches
- Sun Jul 26, 2015 3:48 pm
- Forum: Plugin Development Support
- Topic: EntityPreHook bump_weapon lags
- Replies: 8
- Views: 7102
Just so you know, we are working on a weapon restrict system that will handle not only bumping weapons but also stops restricted players from purchasing them . I hope the bolded part is going to be optional! What if you want the player to still be able to drop items for his teammates, but not use t...
- Sat Jul 25, 2015 1:18 pm
- Forum: Plugin Development Support
- Topic: Getting the name of a game event in PostHook of firing an event?
- Replies: 1
- Views: 2047
Getting the name of a game event in PostHook of firing an event?
I'm trying to fire my own game event listeners after all the other listeners have been called. I'm using PostHook for this purpose, here's my code: FIRE_EVENT_FUNC = get_object_pointer(game_event_manager).make_virtual_function( 7 if PLATFORM == 'windows' else 8, Convention.THISCA...
- Fri Jul 17, 2015 5:16 pm
- Forum: News & Announcements
- Topic: New release July 2nd, 2015!!
- Replies: 14
- Views: 38342
When it was first added, we didn't have a built in way to slay a player. If someone saw that a PlayerEntity instance had a 'kill' method, they might try to use it and it would crash their server instead of kill the player. We do have a 'slay' method now, that we could also wrap with kill, which wou...
- Fri Jul 17, 2015 11:10 am
- Forum: News & Announcements
- Topic: New release July 2nd, 2015!!
- Replies: 14
- Views: 38342
- Sun Jul 12, 2015 11:17 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 42845
Thanks for the suggestion! I'm not sure what you mean by this? How's it an improvement over the current style? Avoid checking for None where, I don't think we need to check for None at the moment? Also, I don't see how your example supports multiple effects of the same type. EDIT: Ahh, you were refe...
- Sun Jul 12, 2015 5:51 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 42845
- Sat Jul 11, 2015 8:24 pm
- Forum: Plugin Development Support
- Topic: [TF2] *_from_index functions are screwed up...
- Replies: 20
- Views: 15151
- Tue Jul 07, 2015 12:05 pm
- Forum: Custom Packages
- Topic: EasyPlayer
- Replies: 15
- Views: 42845
EasyPlayer
EasyPlayer is an idea of a player class that automates all the player effects without having to worry about other people's plugins interfering with your plugin. A good example of this are move types: Your plugin gives noclip to someone for 10 seconds (using player.move_type = MoveType.NOCLIP ), but ...
- Mon Jul 06, 2015 5:53 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Mon Jul 06, 2015 3:09 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Mon Jul 06, 2015 2:24 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
Indeed, it wouldn't be ideal, which is why I tried metaclasses. However, there seems to be a metaclass conflict, apparently PlayerEntity already has a custom metaclass (coming from BaseEntity, couldn't find it elsewhere? I could be blind though): [SP] Caught an Exception: Traceback (most recent call...
- Mon Jul 06, 2015 9:36 am
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Sun Jul 05, 2015 2:29 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Sun Jul 05, 2015 9:55 am
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
If someone subclassed your Player class, they would have to overwrite your __new__ anyway and use a different dictionary. The global dictionary only holds one instance per index. I liked your other edits that you now seem to have edited out where you admitted your implementation is wrong. Setting i...
- Sat Jul 04, 2015 4:48 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Sat Jul 04, 2015 2:19 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Sat Jul 04, 2015 2:05 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
- Sat Jul 04, 2015 1:01 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
Using object.__setattr__() isn't a feasibule solution, as my class is designed to be subclassed, and I'd have to use object.__setattr__() in all the subclasses too. Would you guys have any workaround for this? I don't think it's desirable to have to call __init__ before you can set attributes on an ...
- Fri Jul 03, 2015 3:24 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
Check out how Entity overridesoverrides __new__. You need to call __init__ to construct the base class. Not sure what you mean by this. I can't define "just_an_attribute" in __init__, since it's something that needs to be defined only once. I ended up using object.__setattr__(inst, 'just_an_attribu...
- Fri Jul 03, 2015 1:17 pm
- Forum: Plugin Development Support
- Topic: Unable to add attributes to a subclass of PlayerEntity in __new__?
- Replies: 23
- Views: 12257
Unable to add attributes to a subclass of PlayerEntity in __new__?
from players.entity import PlayerEntity class MyPlayer(PlayerEntity): def __new__(cls, index): inst = super().__new__(cls, index) inst.just_an_attribute = True return inst Raises the following error when used: [SP] Caught an Exception: Traceback (most recent call las...