Search found 241 matches

by Mahi
Wed Mar 18, 2015 5:31 am
Forum: API Design
Topic: BaseEntity's __setattr__ prevents private attributes, for what?
Replies: 5
Views: 6963

Oh, right. Well that explains a lot. But still, it would be awesome if we'd get to create our own private attributes :) Sure I can just make them public, but I think it would be much better convention to make them private.
by Mahi
Wed Mar 18, 2015 5:12 am
Forum: API Design
Topic: BaseEntity's __setattr__ prevents private attributes, for what?
Replies: 5
Views: 6963

There was a purpose to that previously, but I have been meaning to look at possibly removing that portion. And no, it has nothing to do with _EntitySpecials. It has to do with attributes like _index, _playerinfo, _pointer, etc... that have a property that returns the private attribute. But isn't th...
by Mahi
Tue Mar 17, 2015 10:26 pm
Forum: API Design
Topic: BaseEntity's __setattr__ prevents private attributes, for what?
Replies: 5
Views: 6963

BaseEntity's __setattr__ prevents private attributes, for what?

def __setattr__(self, attr, value): """Find if the attribute is value and sets its value.""" # Is the given attribute private? if attr.startswith('_'): # Get the name of the private attribute name = attr[1:] # Is the attribute a property? if ...
by Mahi
Thu Mar 05, 2015 4:41 pm
Forum: Code examples / Cookbook
Topic: Stripping weapons
Replies: 45
Views: 120555

Is it possible to restrict a weapon completely? Like, to prevent a player for picking it up in the first place?
by Mahi
Tue Mar 03, 2015 9:42 pm
Forum: News & Announcements
Topic: New Translations module available!!!
Replies: 8
Views: 11607

Then, change the encoding or your file to UTF-8 . This worked just fine for me (did you miss this reply ?)! I did change it through notepad's save dialog, but didn't help :/ Edit: Ugh it's all messed up, I did a system restore earlier today and apparently the Source.Python files were affected... No...
by Mahi
Tue Mar 03, 2015 9:16 pm
Forum: News & Announcements
Topic: New Translations module available!!!
Replies: 8
Views: 11607

L'In20Cible wrote:You can set the encoding you want using the encoding keyword:[python]strings = LangStrings('file', encoding='encoding')[/python]

This did the job, with 'utf-8' :) Thank you
Edit: Never mind, I failed. It still doesn't work :/
by Mahi
Tue Mar 03, 2015 8:58 am
Forum: News & Announcements
Topic: A new release!
Replies: 7
Views: 25662

Yay! Good work guys, you're doing an awesome job :)
by Mahi
Mon Mar 02, 2015 7:35 pm
Forum: News & Announcements
Topic: New Translations module available!!!
Replies: 8
Views: 11607

L'In20Cible wrote:

Syntax: Select all

my_message = SayText2(my_strings['Test2'])
Should be:

Syntax: Select all

my_message = SayText2(message=my_strings['Test2'])
As for the keywords, pass them to the send method:

Syntax: Select all

my_message.send(index, keyword='hey', keyword2='oh')
Thank you very much. :)
by Mahi
Mon Mar 02, 2015 6:36 pm
Forum: News & Announcements
Topic: New Translations module available!!!
Replies: 8
Views: 11607

How do I format the translations? I think I'm supposed to use $key inside the translation string, but how exactly do I set the value of the key when I use the translation, for example with SayText2, or inside a menu's option? Edit: I just got an error even without trying to format the translation. t...
by Mahi
Wed Feb 25, 2015 4:52 pm
Forum: Plugin Releases
Topic: Hero Wars (Alpha)
Replies: 35
Views: 42183

Thanks a lot for the help :) I'll take a look at it later on, will try to adapt to the Source.Pyhton's way of doing things. I'm still not too sure about the __new__ vs __init__, to me it makes more sense to use what the base class is using. But I might change it someday, will have to think about it ...
by Mahi
Wed Feb 25, 2015 3:16 pm
Forum: Plugin Releases
Topic: Hero Wars (Alpha)
Replies: 35
Views: 42183

It is true that there are fixed parameters, but I would handle it completely differently anyway. I would only pass in the index, which it seems so far is all you do anyway, then set the gold afterwards. And again, I wouldn't store the language the way you do, but set lang_key to None in __init__ an...
by Mahi
Wed Feb 25, 2015 12:02 am
Forum: Plugin Releases
Topic: Hero Wars (Alpha)
Replies: 35
Views: 42183

Thanks for your feedback xancara, and good to know it's already being tested widely! It's not our first priority, but we will add a check to make sure there are players on both teams. Also, I must've forgotten the level up message completely, will add it tomorrow as soon as I wake up! Thank you for ...
by Mahi
Tue Feb 24, 2015 6:48 pm
Forum: Plugin Releases
Topic: Hero Wars (Alpha)
Replies: 35
Views: 42183

PlayerEntity's language property is the steam client's language, correct? I did a small quiz (<20 people) and almost everyone voted not to use the language used by steam, but instead let everyone decide their language through menus. What comes to the built-in translation system, I wasn't aware of it...
by Mahi
Mon Feb 23, 2015 7:40 pm
Forum: Plugin Releases
Topic: Hero Wars (Alpha)
Replies: 35
Views: 42183

Hero Wars (Alpha)

Hero Wars is a plugin for Source.Python that's designed to replace the outdated EventScripts addon called Warcraft: Source Hero Wars is still in alpha, and there are many bugs to fix as well as features to implement, but the plugin is already playable and thus we're releasing the alpha version. Here...
by Mahi
Sun Feb 22, 2015 3:13 pm
Forum: News & Announcements
Topic: Feature Requests
Replies: 28
Views: 63158

Alright, good to know they'll be coming eventually :) Thanks for the answer
by Mahi
Sun Feb 22, 2015 12:16 pm
Forum: News & Announcements
Topic: Feature Requests
Replies: 28
Views: 63158

This actually sounds really good, better than what I actually requested!
Is it still just an idea, or are you going to implement it already? If so, any eta. on the new update?
by Mahi
Thu Feb 19, 2015 1:48 pm
Forum: News & Announcements
Topic: Feature Requests
Replies: 28
Views: 63158

"Improving" PlayerEntity PlayerEntity lacks dozens of useful features, or the features are implemented in an unfriendly way for the people using Source.Python to create plugins. There's a lot of inconsistency between some properties, and some functions are completely missing. In my opinion, PlayerE...
by Mahi
Sun Feb 15, 2015 11:27 pm
Forum: General Discussion
Topic: Bug Report: TickRepeat's reduce() function stops the repeat when it shouldn't
Replies: 4
Views: 4236

Oh right, should've read all the changes, my bad there :) Well, thanks for the quick response!
by Mahi
Sun Feb 15, 2015 11:19 pm
Forum: General Discussion
Topic: Bug Report: TickRepeat's reduce() function stops the repeat when it shouldn't
Replies: 4
Views: 4236

You also seem to have removed the self._limit check. I'm not 100% sure about this so correct me if I got it wrong, but wasn't that still required? I figured that limit being zero probably means that the loop should run forever until manually stopped, so removing the check for limit makes it so the r...
by Mahi
Sun Feb 15, 2015 3:52 pm
Forum: General Discussion
Topic: Bug Report: TickRepeat's reduce() function stops the repeat when it shouldn't
Replies: 4
Views: 4236

Bug Report: TickRepeat's reduce() function stops the repeat when it shouldn't

Hey, there's a small bug in TickRepeat's reduce() method ../listeners/tick/repeat.py line 224-225: if (self.remaining and self._limit and self.status is TickRepeatStatus.RUNNING): I think it should say something like if (self.remaining <= 0 and self._limit and self.status is TickRepeatSt...

Go to advanced search