Search found 241 matches

by Mahi
Wed Dec 29, 2021 10:00 am
Forum: Plugin Development Support
Topic: ClientCommand working for +lookatweapon but not +jump?
Replies: 2
Views: 6948

Re: ClientCommand working for +lookatweapon but not +jump?

That makes sense, thank you very much once again! :)
by Mahi
Tue Dec 28, 2021 7:46 am
Forum: Plugin Development Support
Topic: ClientCommand working for +lookatweapon but not +jump?
Replies: 2
Views: 6948

ClientCommand working for +lookatweapon but not +jump?

Hi, I'll show the code first as it explains the issue immediately: @ClientCommand('+lookatweapon') def on_lookatweapon(command, player_index): print('Yup, works') @ClientCommand('+jump') def on_jump(command, player_index): print(...
by Mahi
Mon Dec 27, 2021 8:31 am
Forum: Custom Packages
Topic: EasyEvents
Replies: 0
Views: 19500

EasyEvents

An easier way to use events: https://github.com/Mahi/EasyEvents Main features : ⋅  Automatically convert game event userid's to Player objects . Requires you to provide a PlayerDictionary object, thereby allowing any custom Player class to be used. ⋅  Split up multi-player events...
by Mahi
Sun Dec 26, 2021 9:13 am
Forum: Plugin Releases
Topic: [CSGO] Floating Damage Numbers
Replies: 22
Views: 99158

Re: [CSGO] Floating Damage Numbers

Just a quick suggestion without having read any of the code: you could try changing line 121 to

Syntax: Select all

except (ValueError, KeyError):
by Mahi
Tue Dec 21, 2021 11:41 am
Forum: Custom Packages
Topic: EasyPlayer
Replies: 15
Views: 73352

Re: EasyPlayer

I've chosen not to implement caching as I believe one should be using PlayerDictionary anyways, and subclassing to enable caching should be trivial. I've also attempted to use model_header for the hitboxes, but only managed to do so for the pelvis bone (index 0), as all other bones seem to have nons...
by Mahi
Mon Dec 20, 2021 7:13 am
Forum: Custom Packages
Topic: EasyPlayer
Replies: 15
Views: 73352

Re: EasyPlayer

Thanks for the feedback, I'll be fixing the issues shortly!

Why should I use caching though? Isn't that what PlayerDictionary is for?
by Mahi
Mon Dec 20, 2021 7:12 am
Forum: Plugin Development Support
Topic: Is it possible to use the newer style radio menus?
Replies: 2
Views: 6731

Re: Is it possible to use the newer style radio menus?

This isn't something I know how to do myself, so I'm just throwing ideas here, but couldn't we just show the menu client side and then react to different radio commands differently on the server? Nobody uses the radio commands anyways, just block them and do something else entirely :grin: Maybe you ...
by Mahi
Sun Dec 19, 2021 8:12 am
Forum: Plugin Development Support
Topic: Is it possible to use the newer style radio menus?
Replies: 2
Views: 6731

Is it possible to use the newer style radio menus?

I mean these: https://i.imgur.com/8Q2ok1v.jpg

Is it possible to create custom menus like this for our mods?
by Mahi
Sat Dec 18, 2021 4:17 pm
Forum: Plugin Releases
Topic: Hero-Wars 2
Replies: 0
Views: 18512

Hero-Wars 2

Hero-Wars 2 by Mahi My latest take on the age-old Warcraft-mod. Repository: https://github.com/Mahi/Hero-Wars It replaces all my existing Warcraft-mods: Hero-Wars , Warcraft-SP , and Warcraft:GO . Not that I was maintaining them anyways, but the repositories will be deleted soon. Hero-Wars probably...
by Mahi
Mon Dec 13, 2021 9:47 pm
Forum: Plugin Development Support
Topic: When to create and cache a TempEntity?
Replies: 4
Views: 9932

Re: When to create and cache a TempEntity?

Thank you for all the help L'In20Cible! :)
by Mahi
Mon Dec 13, 2021 9:45 pm
Forum: Custom Packages
Topic: EasyPlayer
Replies: 15
Views: 73352

Re: EasyPlayer

Haven't been updating the thread for a while as I don't think many other people are using the package, but EasyPlayer has since been updated to v2.1.1 and has a lot of new stuff, including easier event management: player_dict = PlayerDictionary(easyplayer.Player) # Can be your own custom Pla...
by Mahi
Mon Dec 13, 2021 9:40 pm
Forum: Plugin Development Support
Topic: When to create and cache a TempEntity?
Replies: 4
Views: 9932

Re: When to create and cache a TempEntity?

And I can reuse this throughout the plugin's entire lifetime? Just making sure :grin:
by Mahi
Mon Dec 13, 2021 3:34 pm
Forum: Plugin Development Support
Topic: When to create and cache a TempEntity?
Replies: 4
Views: 9932

When to create and cache a TempEntity?

Hi, how often should I create a new TempEntity instance? Say I'm creating a skill for an RPG mod and want to draw a laser beam between two people to indicate extra damage. I see three options: ⋅  Create a new TempEntity for every player_hurt event and only cache the models ⋅  Cre...
by Mahi
Sun Dec 12, 2021 6:40 am
Forum: Plugin Development Support
Topic: Creating a BeamRingPoint?
Replies: 4
Views: 17018

Re: Creating a BeamRingPoint?

I did have to use a different sprite, though (I used sprites/laser.vmt , since sprites/lghtning.vmt did not work on either of my tests). What game are you testing this on? I am testing on CS:S. Using sprites/laserbeam.vmt did the trick finally, neither lgtning nor laser worked for me. On CS:GO. Tha...
by Mahi
Sat Dec 11, 2021 8:34 am
Forum: Plugin Development Support
Topic: Creating a BeamRingPoint?
Replies: 4
Views: 17018

Creating a BeamRingPoint?

Hi, I am unable to create a simple BeamRingPoint: model = Model('sprites/lghtning.vmt') te = TempEntity('BeamRingPoint') te.model = model te.halo = model te.center = player.position te.start_radius = 40 te.end_radius = 60 te.frame_rate = 100 te.life_time = 1 te.start_...
by Mahi
Fri Dec 10, 2021 6:22 am
Forum: API Design
Topic: Improving LangStrings and TranslationStrings to be less restrictive
Replies: 9
Views: 56024

Re: Improving LangStrings and TranslationStrings to be less restrictive

Thanks for the reply, but I don't think that's quite what I'm after. Your example has three valid translatable strings being merged, while my example is about constructing a string on-the-fly from existing strings and data. Here's what my example would look like if put into an INI file... [Skill Upg...
by Mahi
Thu Dec 09, 2021 8:50 pm
Forum: API Design
Topic: Improving LangStrings and TranslationStrings to be less restrictive
Replies: 9
Views: 56024

Re: Improving LangStrings and TranslationStrings to be less restrictive

Right, my example was idiotic, what I meant is creating a TranslationString and pre-filling some TranslationStrings in without providing all of them. So in the solution you provided, I would like to pre-fill level_str and cost_str with existing TranslationStrings (to get a global message instance th...
by Mahi
Thu Dec 09, 2021 7:52 pm
Forum: API Design
Topic: Improving LangStrings and TranslationStrings to be less restrictive
Replies: 9
Views: 56024

Re: Improving LangStrings and TranslationStrings to be less restrictive

Is there any better way to achieve this, i.e. construct a string on-the-fly from existing TranslationStrings? def create_translation_string(message: str, **tokens: Dict[str, Any]) -> TranslationStrings: langs = set() for token in tokens.values(): if isinstance(token, Tran...
by Mahi
Thu Dec 09, 2021 5:20 pm
Forum: API Design
Topic: Improving LangStrings and TranslationStrings to be less restrictive
Replies: 9
Views: 56024

Re: Improving LangStrings and TranslationStrings to be less restrictive

If you pass a TranslationStrings instance as a token, it will automatically translate it for the current language I could have sworn that it didn't work when I tried this yesterday :confused: Thanks though, that solves a lot of my problems. And assuming it's recursive, then basically that's already...
by Mahi
Thu Dec 09, 2021 8:06 am
Forum: API Design
Topic: Improving LangStrings and TranslationStrings to be less restrictive
Replies: 9
Views: 56024

Improving LangStrings and TranslationStrings to be less restrictive

Hi, I understand the motivation is to have a uniform style for all plugins, but as it stands the LangStrings and TranslationStrings classes are both lacking and restricting. I've highlighted some of the key points I have in mind: ⋅  LangStrings attempts to always load from TRANSLATION_PATH...

Go to advanced search