Hero Wars (Alpha)

Release your plugins here!
juse is bastard
Junior Member
Posts: 1
Joined: Tue May 12, 2015 3:23 pm

Postby juse is bastard » Wed May 13, 2015 12:54 pm

Is there now any difference between "skill" and "passive"?
Mahi
Senior Member
Posts: 213
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Thu May 14, 2015 8:26 am

Passives are always enabled, and they cannot be leveled using skill points.
Skills are enabled only when a player has spent his hero's skill points on them.
So the only difference is that you need to (and you can) level skills with skill points, whereas passives are enabled already on level 0 and they're not affected by your hero's level unless you explicitly define so.

Edit: We have our own forum stoo, although it's still missing quite a lot. Questions like this can be posted there to avoid this topic from flooding: http://www.hero-wars.com/
SpreadKiller
Junior Member
Posts: 5
Joined: Wed May 06, 2015 5:22 am

Postby SpreadKiller » Fri May 15, 2015 12:37 am

Thanks, And i've updated and now its spamming this in console, It shows the Menu once and thats all, You wont get EXP or anything :S.

Code: Select all

[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\player.py', line 40, in player_discon
nect
    save_player_data(player)
  File '..\addons\source-python\plugins\hw\database.py', line 65, in save_player
_data
    (player.steamid, player.gold, player.hero.cid)

AttributeError: 'NoneType' object has no attribute 'cid'
Mahi
Senior Member
Posts: 213
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Postby Mahi » Fri May 15, 2015 2:38 pm

SpreadKiller wrote:Thanks, And i've updated and now its spamming this in console, It shows the Menu once and thats all, You wont get EXP or anything :S.

Code: Select all

[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\player.py', line 40, in player_discon
nect
    save_player_data(player)
  File '..\addons\source-python\plugins\hw\database.py', line 65, in save_player
_data
    (player.steamid, player.gold, player.hero.cid)

AttributeError: 'NoneType' object has no attribute 'cid'
This shouldn't really happen, my best quess is you're still using the database from an old version of Hero-Wars. Try deleting hw.db from your \addons\source-python\plugins\hw folder and then try again.

EDIT: Also, please, all non Source.Python related issues to our forums at http://www.hero-wars.com/. Let's keep this topic on Source.Python stuff :)
User avatar
Doldol
Senior Member
Posts: 164
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: Hero Wars (Alpha)

Postby Doldol » Mon Sep 05, 2016 10:35 pm

Sad to see this die, site + repo down. Is the source still available somewhere?
Predz
Senior Member
Posts: 145
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Re: Hero Wars (Alpha)

Postby Predz » Tue Sep 06, 2016 8:15 am

Hey Doldol, the project hasn't gone far. Me and Mahi have collaborated to work on a more community driven plugin called Warcraft Source. I have a beta server running it atm, which I have been working on for the last week. The current git for the plugin is here: https://github.com/Mahi/Warcraft-SP

I personally have a large amount of extensions for the plugin to add new events, new experience gains, and other features. The IP to the server I am currently beta testing on is: playfort.eu:27019

The heroes on this server are far beyond the capabilities of the old Warcraft Source, and so I feel this is a massive step forward. Here is an example hero:

Syntax: Select all

from ..entities import Hero
from ..entities import Skill, callback

from effects.base import TempEntity
from engines.precache import Model
from entities.entity import Entity
from filters.players import PlayerIter
from listeners.tick import Delay, TickRepeat
from messages import SayText2

from random import randint
from time import time

class Orc(Hero):
'Battle-scorned orcs are known to be brutal in combat.'

max_level = 40
required_level = 0


@Orc.skill
class Critical_Strike(Skill):
'You are able to hit vital points, causing major damage.'

max_level = 8

laser = Model('sprites/lgtning.vmt')

@callback('player_spawn', 'player_upgrade_skill')
def _on_spawn_start_repeat(self, player, **eargs):
self._can_crit = True
self._counter = 0

self._repeat = TickRepeat(self._on_game_tick)
self._repeat.start(0.1, 0)

@callback('player_death')
def _on_death_stop_repeat(self, victim, **eargs):
if hasattr(self, '_repeat'):
self._repeat.stop()

@callback('player_pre_attack')
def _on_player_pre_attack(self, attacker, victim, info, **eargs):
if self._can_crit:
info.damage *= 1 + 0.2 * self.level
SayText2(
'+ \x04Critical strike \x05on \x0a{} \x05caused \x02vital damage!'.format(
victim.name)
).send(attacker.index)

self._can_crit = False
self._counter = 0

def _on_game_tick(self):
self._counter += 1
if self._counter == 60 - (self.level * 2):
self._can_crit = True

@Orc.skill
class Earthgrab_Totem(Skill):
'Root your enemies to the ground.'

laser = Model('sprites/lgtning.vmt')

max_level = 8

@callback('player_pre_attack')
def _on_player_pre_attack(self, attacker, victim, **eargs):
if randint(1, 100) <= 16 + self.level and not victim.stuck:
victim.stuck = True
Delay(1.5, victim.__setattr__, 'stuck', False)

SayText2('~ \x04Rooted \x0a{} \x01to the ground.'.format(victim.name)
).send(attacker.index)

@Orc.skill
class Reincarnation(Skill):
'Upon death, the shamans will ressurect you in your old location.'

max_level = 8

@callback('player_pre_victim')
def _on_pre_death_obtain_weapons(self, victim, **eargs):
self._weapons = [Entity(index).class_name for index in victim.weapon_indexes(
not_filters='knife')
]

@callback('player_death')
def _on_death_respawn(self, victim, **eargs):
if randint(1, 100) <= 25 + self.level:
Delay(0.5, victim.respawn)
for index in victim.weapon_indexes(not_filters='knife'):
entity = Entity(index)
Delay(0.7, victim.drop_weapon, entity.pointer, None, None)
for weapon in self._weapons:
Delay(1.2, victim.give_named_item, weapon)

SayText2('~ \x0cRespawning \x04in \x011 \x04second.').send(victim.index)


@Orc.skill
class Chain_Lightning(Skill):
'You channel a lightning rod which ricochets from player to player.'

max_level = 8
laser = Model('sprites/lgtning.vmt')

beam = TempEntity('BeamPoints', alpha=255, red=255, green=200, blue=200,
life_time=1.0, start_width=7, end_width=7, frame_rate=255)

def _find_closest_player(self, player, team, length=99999, exclusions=[]):
_target = None
for target in PlayerIter(not_filters=team):
_distance = player.origin.get_distance(target.origin)
if _distance < length and not target in exclusions:
_target = target
length = _distance
return _target

def _find_chain_players(self, player, length, count):
_last_target = player
team = ['t', 'ct'][player.team-2]
_targets = []
while count > 0:
if not _last_target:
break
_target = self._find_closest_player(_last_target, team, length, _targets)
_targets.append(_target)
_last_target = _target
count -= 1
return _targets

@callback('player_spawn', 'player_upgrade_skill')
def _on_player_spawn_reset(self, player, **eargs):
self._cooldown = False
self._delay = Delay(4, self.__setattr__, '_cooldown', True)

@callback('player_ultimate')
def _on_player_ultimate(self, player, **eargs):
if self._cooldown:
last_target = player
targets = self._find_chain_players(player, 500, 3)

if targets[0] == None:
SayText2('~ \x04Chain Lightning \x01found no enemies!').send(player.index)
return

for target in targets:
if not target:
continue
target.take_damage(20+4*self.level, attacker_index=player.index)
self.beam.start_point = last_target.origin
self.beam.end_point = target.origin
self.beam.model = self.beam.halo = self.laser
self.beam.create()
last_target = target

SayText2('~ \x04Chain Lightning \x02hit enemies!').send(player.index)
self._cooldown = False
self._delay = Delay(15, self.__setattr__, '_cooldown', True)
else:
SayText2('~ \x04Chain Lightning \x01is on \x05cooldown for {} seconds.'.format(
int(self._delay.exec_time-time()))
).send(player.index)


The critical strike skill is set on a recharge as you can see from the TickRepeat. So that players dont just get lucky and possibly hit 3 or 4 crits in a row. Now you can use this to be more skilled, and delay your shots to specifically get the crit you wanted. I personally play this hero with only deagle :D

Earthgrab Totem is designed to give this hero a counter to other heroes with a lot of speed. So I added a small root to give it that. This also checks that the player isn't currently rooted, meaning for no double roots, etc. Just a bit for the healthiness of the hero in game.

I am sure I could improve on the optimisation of the ultimate, however it is clean and chains from player to player nicely. If any of you have more optimised ways of coding it, I would love suggestions :)

I have coded a few really complex heroes, however would like to keep them to my server for the meantime. :smile: I have created a hero which can create portals through walls on the map. Sorta like Bard from League of Legends.
Last edited by L'In20Cible on Sat Sep 10, 2016 1:30 am, edited 2 times in total.
Reason: self.model/halo → self.beam.model/halo
User avatar
L'In20Cible
Project Leader
Posts: 932
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Hero Wars (Alpha)

Postby L'In20Cible » Tue Sep 06, 2016 10:04 am

A bit off topic but, you could highly optimize by globalizing your TempEntity instance and simply update its location before the create() call. You could also place it in your class, for example:

Syntax: Select all

@Orc.skill
class Chain_Lightning(Skill):
'You channel a lightning rod which ricochets from player to player.'

max_level = 8
laser = Model('sprites/lgtning.vmt')

beam = TempEntity('BeamPoints', alpha=255, red=255, green=200, blue=200,
life_time=1.0, start_width=7, end_width=7, frame_rate=255)

@callback('player_ultimate')
def _on_player_ultimate(self, player, **eargs):
...

self.beam.start_point = last_target.origin
self.beam.end_point = target.origin

# This can't be globalized, since the precache tables are freed every
# map change.
self.model = self.halo = self.laser

self.beam.create()


You could be surprized timing the difference. I would always recommend to globalize your TempEntity instances and reuse them updating what was unknown at loading time upon creation.

Also, I modified to use the non _index attributes, TempEntity accepts Model/Decal instances directly. Could also do the same for red/green/blue/alpha, they could be replaced using "color" attribute set to a Color instance.
Predz
Senior Member
Posts: 145
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Re: Hero Wars (Alpha)

Postby Predz » Tue Sep 06, 2016 10:35 am

Thanks, too used to using the old temp_entities object we had access too. Still adjusting to the new way. Have adjusted it already. :)
User avatar
L'In20Cible
Project Leader
Posts: 932
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Hero Wars (Alpha)

Postby L'In20Cible » Tue Sep 06, 2016 10:52 am

temp_entities, ITempEntsSystem singleton, was wrapping the global CBaseTempEntity instances so you had to set all values before creation. The TempEntity class, is basically allocating a new object which copy the global one (mainly for its dispatch table) allowing you to change values without affecting any other instances - this seemed the best approach to me. As for the wrapped types, you can find them in the data files. For example, BeamPoints is wrapping color, model and halo internally setting the correct values based on the given instance.
Mahi
Senior Member
Posts: 213
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: Hero Wars (Alpha)

Postby Mahi » Tue Sep 06, 2016 1:42 pm

Also Doldol, and anyone else still interested in this project, my military service will end in eight days and while I'm quite likely going to spend the first week or so mostly with my friends and family, I will be back on the project (hopefully other projects and even SP too) in no time! It's been long 9 months, but you should be hearing a lot more of me from now on :)
Predz
Senior Member
Posts: 145
Joined: Wed Aug 08, 2012 9:05 pm
Location: Bristol, United Kingdom

Re: Hero Wars (Alpha)

Postby Predz » Tue Sep 06, 2016 3:53 pm

Pleased to see you back Mahi :cool:
Mahi
Senior Member
Posts: 213
Joined: Wed Aug 29, 2012 8:39 pm
Location: Finland

Re: Hero Wars (Alpha)

Postby Mahi » Tue Sep 06, 2016 5:36 pm

Still a few days to go, but thanks! :)
User avatar
Doldol
Senior Member
Posts: 164
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: Hero Wars (Alpha)

Postby Doldol » Thu Sep 08, 2016 6:08 am

That sounds great Mahi & Predz :)
rafau94
Junior Member
Posts: 2
Joined: Sun Nov 13, 2016 12:57 am

Re: Hero Wars (Alpha)

Postby rafau94 » Mon Jul 17, 2017 6:53 pm

I assume project is dead since your repo is down ?
User avatar
iPlayer
Developer
Posts: 534
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: Hero Wars (Alpha)

Postby iPlayer » Mon Jul 17, 2017 7:50 pm

rafau94 wrote:I assume project is dead since your repo is down ?

I believe it's reincarnated as Warcraft-SP
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
rafau94
Junior Member
Posts: 2
Joined: Sun Nov 13, 2016 12:57 am

Re: Hero Wars (Alpha)

Postby rafau94 » Mon Jul 17, 2017 8:40 pm

iPlayer wrote:
rafau94 wrote:I assume project is dead since your repo is down ?

I believe it's reincarnated as Warcraft-SP

Ah,ok, thanks :)

Return to “Plugin Releases”

Who is online

Users browsing this forum: No registered users and 1 guest