Hero Wars (Alpha)

Release your plugins here!
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Hero Wars (Alpha)

Postby Mahi » Mon Feb 23, 2015 7:40 pm

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
User avatar
La Muerte
Administrator
Posts: 180
Joined: Sun Jul 15, 2012 1:48 pm
Location: Belgium
Contact:

Postby La Muerte » Mon Feb 23, 2015 11:46 pm

Promising! Looking forward to seeing this unfold.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Feb 24, 2015 4:16 pm

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__.
Image
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Tue Feb 24, 2015 6:48 pm

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__
xancara
Junior Member
Posts: 7
Joined: Tue Feb 24, 2015 5:12 pm

Postby xancara » Tue Feb 24, 2015 10:19 pm

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.

" 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.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Wed Feb 25, 2015 12:02 am

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
xancara
Junior Member
Posts: 7
Joined: Tue Feb 24, 2015 5:12 pm

Postby xancara » Wed Feb 25, 2015 12:49 pm

Thanks for the quick response Mahi!

Those are the commands that I was looking for.

I will keep testing for you and get a few of our community members testing it as well. Hopefully, I'll have some good reports for you.

Cheers!
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Feb 25, 2015 2:42 pm

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.
Image
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Wed Feb 25, 2015 3:16 pm

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 :)
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Wed Feb 25, 2015 3:48 pm

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__.
Image
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Wed Feb 25, 2015 4:52 pm

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.
xancara
Junior Member
Posts: 7
Joined: Tue Feb 24, 2015 5:12 pm

Postby xancara » Fri Feb 27, 2015 1:32 pm

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.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sat Feb 28, 2015 4:49 pm

If you are testing with CS:GO, using 0 has issues. You can bind 0 to "menuselect 0" to fix it on your client, but it isn't feasible for everyone to have to know that trick.
Image
SpreadKiller
Junior Member
Posts: 5
Joined: Wed May 06, 2015 5:22 am

Postby SpreadKiller » Wed May 06, 2015 6:38 pm

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.
Predz
Senior Member
Posts: 158
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Postby Predz » Wed May 06, 2015 6:44 pm

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))
SpreadKiller
Junior Member
Posts: 5
Joined: Wed May 06, 2015 5:22 am

Postby SpreadKiller » Wed May 06, 2015 7:33 pm

Predz wrote: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:

Thanks man :) .
SpreadKiller
Junior Member
Posts: 5
Joined: Wed May 06, 2015 5:22 am

Postby SpreadKiller » Wed May 06, 2015 8:36 pm

I have another problem, The menu's isnt showing, Tried all commands no menu's.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Thu May 07, 2015 9:50 am

SpreadKiller wrote:I have another problem, The menu's isnt showing, Tried all commands no menu's.

!hw in the chat should do it :) And if it doesn't work, check your server's console and see if there are any error messages.
SpreadKiller
Junior Member
Posts: 5
Joined: Wed May 06, 2015 5:22 am

Postby SpreadKiller » Mon May 11, 2015 4:24 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.
User avatar
Mahi
Senior Member
Posts: 236
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Mon May 11, 2015 9:09 am

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.
You have an outdated version, update your Hero-Wars.

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 19 guests