Hero Wars (Alpha)
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's a download link for anyone interested: https://github.com/MarkusMeskanen/Hero-Wars
More information will be provided as the plugin evolves.
Also for the super interested people, here's a link to a topic about Hero Wars on warcraft-source.com
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's a download link for anyone interested: https://github.com/MarkusMeskanen/Hero-Wars
More information will be provided as the plugin evolves.
Also for the super interested people, here's a link to a topic about Hero Wars on warcraft-source.com
Awesome work!!! I do have a question, though. Why aren't you using the built-in translation system? All messages automatically send the proper translated message to each individual player. And a player's language can already be gotten with the PlayerEntity.language property. I would also suggest not overwriting PlayerEntity's __new__, but instead it's __init__.
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 its existence until recently, and haven't had enough time to switch to it yet. Now that you mentioned, I just might put it on top of my to-do list. Will have to study the translations package a little more though.
Why __init__ over __new__? I don't think it's even possible to use __init__ if the base class is using __new__ with fixed amount of parameters, you have no other option but to override __new__
What comes to the built-in translation system, I wasn't aware of its existence until recently, and haven't had enough time to switch to it yet. Now that you mentioned, I just might put it on top of my to-do list. Will have to study the translations package a little more though.
Why __init__ over __new__? I don't think it's even possible to use __init__ if the base class is using __new__ with fixed amount of parameters, you have no other option but to override __new__
I am running a test server for the mod and will be able to supply some feedback from my community for you guys.
First thing I found, you might want to put in some player detection so people can't solo level through map objectives. You could have it configurable (>2 players online before xp starts to generate) or force it for at least 2 players to be on the server.
Also, do you have a list of any commands that are currently available or should I dig through the source for them? (perfectly fine with that, just wanted to check before doing so)
Awesome work so far guys. Thanks!
Edit: I found that when levels are gained, there is no prompt for it happening until the round start message is displayed.
First thing I found, you might want to put in some player detection so people can't solo level through map objectives. You could have it configurable (>2 players online before xp starts to generate) or force it for at least 2 players to be on the server.
Also, do you have a list of any commands that are currently available or should I dig through the source for them? (perfectly fine with that, just wanted to check before doing so)
Awesome work so far guys. Thanks!
Edit: I found that when levels are gained, there is no prompt for it happening until the round start message is displayed.
" wrote:Test Hero #1 - lvl 2 - 105/150 exp
+30% speed from Passive.
+15 exp for plating the bomb.
+25 exp for bomb exploding.
Test Hero #1 - lvl 2 - 145/150 exp
+30% speed from Passive.
+15 exp for plating the bomb.
+25 exp for bomb exploding.
Test Hero #1 - lvl 3 - 35/175 exp
+30% speed from Passive.
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 the report
And what do you mean by commands? Currently only chat commands available are !hw or !herowars and !ultimate
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 the report

And what do you mean by commands? Currently only chat commands available are !hw or !herowars and !ultimate
Mahi wrote: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.
Actually, it uses the player's cl_language value, which is typically determined by their Steam language. Using a menu instead seems silly to me. At the very least, you should by default use their cl_language value and then allow them to change it with the menu. I would also recommend using settings.player.PlayerSettings for player settings.
Mahi wrote:What comes to the built-in translation system, I wasn't aware of its existence until recently, and haven't had enough time to switch to it yet. Now that you mentioned, I just might put it on top of my to-do list. Will have to study the translations package a little more though.
We still need to work on the wiki pages for that. In the meantime, feel free to ask questions about it if you need to.
Mahi wrote:Why __init__ over __new__? I don't think it's even possible to use __init__ if the base class is using __new__ with fixed amount of parameters, you have no other option but to override __new__
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__ and set it to their PlayerSettings setting, if they have chosen a different language, afterwards.
satoon101 wrote: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__ and set it to their PlayerSettings setting, if they have chosen a different language, afterwards.
I still don't see the benefit of using __init__ over __new__ in this case, even though it is true that I manually set the gold anyways. Just a personal preference of yours, or...?
satoon101 wrote:Actually, it uses the player's cl_language value, which is typically determined by their Steam language. Using a menu instead seems silly to me. At the very least, you should by default use their cl_language value and then allow them to change it with the menu. I would also recommend using settings.player.PlayerSettings for player settings.
If I were to switch over to PlayerSettings and cl_language, can you give me a quick example how to use it? Are the settings saved automatically, or do I still need to store the language in my own database? How would a player access these settings, say to change his cl_language?
Sorry, I've got zero experience with the Source game engine, I only know Python.
satoon101 wrote:We still need to work on the wiki pages for that. In the meantime, feel free to ask questions about it if you need to.
Okay so I'm going to switch over to the built-in translations package, can you give an example of the .ini files and how to access them through Python?
Just a quick few line example of the commands will do, if you got some spare time

You should really only override __new__ if you are modifying the actual creation of the class. BaseEntity and PlayerEntity both use __new__ so that they can verify the edict_t instance and IPlayerInfo instance exist for the given index.
As far as PlayerSettings, did you look at the link I provided to the wiki page? The settings do save automatically on map change. We store the settings in a dictionary, and then save them to file on map change so as not to cause lag during gameplay. Some functionality of PlayerSettings is not working 100% at the moment. I need to get back to finishing up that package. I believe string values currently work, it is just the integer and float types that need menus implemented and I hope to add a boolean type, as well.
You can change your cl_language setting in your client's autoexec.cfg file or any file that gets executed on the client before joining a server. This might not work in some games, I cannot remember. I will have to do some testing when I get a chance later. However, you should still use this as the default, as players 'should' be using this value properly so that their game shows the correct text itself.
I meant to provide an example of the translations package, but forgot. Here is the release announcement:
http://forums.sourcepython.com/showthread.php?200
*Edit: to be a bit more helpful, maybe we should add *args and **kwargs to BaseEntity and PlayerEntity __new__.
As far as PlayerSettings, did you look at the link I provided to the wiki page? The settings do save automatically on map change. We store the settings in a dictionary, and then save them to file on map change so as not to cause lag during gameplay. Some functionality of PlayerSettings is not working 100% at the moment. I need to get back to finishing up that package. I believe string values currently work, it is just the integer and float types that need menus implemented and I hope to add a boolean type, as well.
You can change your cl_language setting in your client's autoexec.cfg file or any file that gets executed on the client before joining a server. This might not work in some games, I cannot remember. I will have to do some testing when I get a chance later. However, you should still use this as the default, as players 'should' be using this value properly so that their game shows the correct text itself.
I meant to provide an example of the translations package, but forgot. Here is the release announcement:
http://forums.sourcepython.com/showthread.php?200
*Edit: to be a bit more helpful, maybe we should add *args and **kwargs to BaseEntity and PlayerEntity __new__.
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
However, *args and **kwargs would be awesome, if someone someday actually needs them more than I do.

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

Found a few more things from the latest build.
1. Close on menu not enabled or usable - The "0" option doesn't work. I attempted a menuselect 0 as well, but that didn't work. Not sure if Source.Python recognizes the native menu inputs from console or not (so not sure if source.python or the mods menu).
2. Show Player Gold Total on Round Start with the XP message - It would be nice to see how much gold you have at the start of each round. I didn't check for this in the newest update, rather this was added to my list from the initial build
3. Warm-up Round - No XP or awards for players on warm-up - I noticed that during warmup round, I was still able to obtain gold and xp from kills. Most of my servers have warmup round completely disabled, but for those servers that use it as a buffer for people to load into the game, it could be a potentially exploitable vector.
4. Gold buy menu doesn't work yet - When attempting to purchase "Test Item 1" to gain experience, it checks your gold (currently I have 11 so maybe it is just a calculating error somewhere) but gives nothing. I tested to make sure that it wasn't just happening when I wasn't at a buy zone or within the allotted buy time, but to no avail. Couldn't get it to purchase with gold. Skill purchasing worked fine, so far.
I honestly haven't had much time to test in the past two days due to work but I will continue to test this weekend.
1. Close on menu not enabled or usable - The "0" option doesn't work. I attempted a menuselect 0 as well, but that didn't work. Not sure if Source.Python recognizes the native menu inputs from console or not (so not sure if source.python or the mods menu).
2. Show Player Gold Total on Round Start with the XP message - It would be nice to see how much gold you have at the start of each round. I didn't check for this in the newest update, rather this was added to my list from the initial build
3. Warm-up Round - No XP or awards for players on warm-up - I noticed that during warmup round, I was still able to obtain gold and xp from kills. Most of my servers have warmup round completely disabled, but for those servers that use it as a buffer for people to load into the game, it could be a potentially exploitable vector.
4. Gold buy menu doesn't work yet - When attempting to purchase "Test Item 1" to gain experience, it checks your gold (currently I have 11 so maybe it is just a calculating error somewhere) but gives nothing. I tested to make sure that it wasn't just happening when I wasn't at a buy zone or within the allotted buy time, but to no avail. Couldn't get it to purchase with gold. Skill purchasing worked fine, so far.
I honestly haven't had much time to test in the past two days due to work but I will continue to test this weekend.
-
- Junior Member
- Posts: 5
- Joined: Wed May 06, 2015 5:22 am
Getting an error trying to run the plugin.
Code: Select all
[SP] Loading plugin 'hw'...
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\plugins\manager.py', line 72, in __missing__ instance = self.instance(plugin_name, self.base_import)
File '..\addons\source-python\packages\source-python\plugins\instance.py', line 82, in __init__ self._plugin = import_module(import_name)
File '..\addons\source-python\plugins\hw\hw.py', line 21, in <module> from hw.heroes import *
File '..\addons\source-python\plugins\hw\heroes\test.py', line 11, in <module> from hw.players import Player
ImportError: No module named 'hw.players'
[SP] Plugin 'hw' was unable to be loaded.
Yeh you will need to recode the hero because it hasn't been updated yet. If you cant be asked to update it yourself here is an updated version below:
Syntax: Select all
# ======================================================================
# >> IMPORTS
# ======================================================================
# Hero-Wars
from hw.entities import Hero, Skill
from hw.tools import chance, chancef
from hw.tools import cooldown, cooldownf
# Source.Python
from filters.players import PlayerIter
# ======================================================================
# >> Test Hero #1
# ======================================================================
class TestHero1(Hero):
name = 'Test Hero #1'
description = 'First testing hero, limited alpha release edition.'
authors = ('Mahi', 'Kamiqawa')
@TestHero1.passive
class HealthSpeed(Skill):
name = 'Speed&Health Passive'
description = 'Gain speed on spawn and health on attack.'
def player_spawn(self, user, **eargs):
entity = user.get_entity()
entity.speed = 1.3
user.message('+30% speed from Passive.')
@chance(33)
def player_attack(self, user, **eargs):
entity = user.get_entity()
entity.health += 5
user.message('+5 health from Passive.')
@TestHero1.skill
class Damage(Skill):
name = 'Damage'
description = 'Deal 2x damage with attacks.'
max_level = 1
def player_attack(self, user, **eargs):
# Not implemented attacker.damage(defender.index, eargs['damage'])
user.message('You dealt 2x damage!')
@TestHero1.skill
class Ignite(Skill):
name = 'Ignite'
description = 'Ignite all enemies for 3-4 seconds when you spawn.'
max_level = 2
def player_spawn(self, user, **eargs):
target_team = user.get_entity().team == 2 and 'ct' or 't'
for target in PlayerIter(is_filters=('alive', target_team), return_types='player'):
target.ignite_lifetime(2 + self.level)
user.message('You burned your enemies!')
@TestHero1.skill
class Noclip(Skill):
name = 'Noclip'
description = 'Ultimate: Get noclip for 2-4 seconds'
max_level = 3
cost = 2
required_level = 5
@cooldownf(lambda self, **eargs: 20 - self.level * 2)
def player_ultimate(self, user, **eargs):
duration = 1 + self.level
## entity.noclip(duration)
user.message('You got noclip for {0} seconds!'.format(duration))
-
- Junior Member
- Posts: 5
- Joined: Wed May 06, 2015 5:22 am
-
- Junior Member
- Posts: 5
- Joined: Wed May 06, 2015 5:22 am
-
- Junior Member
- Posts: 5
- Joined: Wed May 06, 2015 5:22 am
Code: Select all
(Counter-Terrorist) SpreadKiller @ House: !hw
L 05/10/2015 - 21:19:26: "SpreadKiller<197><STEAM_1:1:********><CT>" say_team "!hw"
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\events\listener.py', line 93, in fire_game_event callback(game_event)
File '..\addons\source-python\plugins\hw\hw.py', line 338, in player_say index = index_from_userid(userid)
NameError: name 'userid' is not defined
Thats the error in the Console.
You have an outdated version, update your Hero-Wars.SpreadKiller wrote:Code: Select all
(Counter-Terrorist) SpreadKiller @ House: !hw
L 05/10/2015 - 21:19:26: "SpreadKiller<197><STEAM_1:1:********><CT>" say_team "!hw"
[SP] Caught an Exception:
Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\events\listener.py', line 93, in fire_game_event callback(game_event)
File '..\addons\source-python\plugins\hw\hw.py', line 338, in player_say index = index_from_userid(userid)
NameError: name 'userid' is not defined
Thats the error in the Console.
Who is online
Users browsing this forum: No registered users and 91 guests