November 20, 2017, 10:29:09 AM

Author Topic: Warcraft GO v0.3.3.beta  (Read 14708 times)

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #60 on: October 30, 2016, 09:41:00 PM »
Heya, Me and Mahi are yet to post this fully, but we recoded the entire project again. We are both happier with this version, and I currently run a server with a few heroes and some complex skills. Unfortunately I cannot populate my server because I lack to community to do so. :( So I have not been creating any new content for it for a while. IP address is below for you. Add me on steam if you wish to try it out with some players.

wcgo.verygames.net:27015

https://github.com/Mahi/Warcraft-SP

http://steamcommunity.com/profiles/76561198200706498/

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #61 on: October 30, 2016, 09:44:44 PM »
Here is a hero I coded a while ago. This will not work with the most recent Warcraft-SP because of the callback decorator changes. However this will show you some of the more complex heroes on the server. :)

Contains 4 unique skills:

Skill 1 - Increased stealth. Fully stealthed when stood still.
Skill 2 - Marks a random enemy for death. You deal more damage to this player. (ABILITY)
Skill 3 - Poisons enemies you damage. Can kill the player (will use your current weapon if available).
Skill 4 - Teleport through an object. Press on a wall and appear on the other side. (This skill is not perfectly coded and you can get stuck sometimes. Just use your commen sense not to teleport into fckin ceilings...) (ULTIMATE)

Code: [Select]
from random import randint
from time import time

from colors import Color
from mathlib import Vector
from engines.trace import engine_trace
from engines.trace import ContentMasks
from engines.trace import GameTrace
from engines.trace import Ray
from engines.trace import TraceFilterSimple
from entities.entity import Entity
from events import Event
from filters.players import PlayerIter
from listeners.tick import Delay
from messages import SayText2
from players.constants import PlayerButtons

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

class Night_Elf_Hunter(Hero):
    'Night elves are impressive marksman of the Elune forest.'

    max_level = 40
    required_level = 50


@Night_Elf_Hunter.skill
class Shadowmeld(Skill):
    'Decreased visibility to enemies. Fully stealthed when stood still.'

    max_level = 8

    _is_invis = False

    _movement_buttons = (PlayerButtons.FORWARD,
        PlayerButtons.MOVELEFT,
        PlayerButtons.MOVERIGHT,
        PlayerButtons.LEFT,
        PlayerButtons.RIGHT,
        PlayerButtons.BACK)

    @property
    def _invis(self):
        return 255 - (self.level * 15)

    @callback('player_death', 'player_spawn')
    def _on_player_death(self, victim, **eargs):
        color = victim.color
        color.a = 255
        victim.color = color

    @callback('player_run_command')
    def _on_player_run_command(self, player, usercmd, **eargs):
        for button in self._movement_buttons:
            if usercmd.buttons & button:
                if self._is_invis:
                    color = player.color
                    color.a = self._invis
                    player.color = color

                    self._is_invis = False
                return

        if not self._is_invis:
            color = player.color
            color.a = 0
            player.color = color

            self._is_invis = True

@Night_Elf_Hunter.skill
class Hunters_Mark(Skill):
    'Mark a random enemy, and deal extra damage to him.'

    max_level = 8

    _effect = None
    _target = None

    _msg_a = '>> \x04Hunter\'s Mark: \x05{player} has \x02marked \x05{enemy} for \x02death!'

    @property
    def _multiplier(self):
        return 1.2 + (self.level * 0.1)

    def _kill_effect(self, effect):
        if not effect.basehandle.is_valid():
            return
        effect.call_input('Kill')

    @callback('player_spawn', 'player_upgrade_skill')
    def _on_player_spawn(self, player, **eargs):
        self._target = None
        self._cooldown = True

    @callback('round_end')
    def _on_round_end(self, player, **eargs):
        self._effect = None

    @callback('player_pre_attack')
    def _on_player_pre_attack(self, attacker, victim, info, **eargs):
        if self._target and self._target.userid == victim.userid:
            info.damage *= self._multiplier

    @callback('player_kill')
    def _on_player_kill(self, attacker, victim, **eargs):
        if self._target and self._target.index == victim.index:
            self._effect = None
            self._target = None

    @callback('player_ability')
    def _on_player_ability(self, player, number, **eargs):
        if self._cooldown:
            targets = []
            for target in PlayerIter():
                if player.team != target.team and not target.playerinfo.is_dead():
                    targets.append(target)

            if len(targets) == 0:
                return

            index = randint(1, len(targets)) - 1
            target = targets[index]
            self._target = target

            SayText2(self._msg_a.format(player=player.name, enemy=target.name)).send()

            # EFFECT

            if self._effect:
                self._kill_effect(self._effect)

            self._effect = effect = Entity.create('env_smokestack')

            location = target.origin
            location.z += 96
            effect.teleport(location, None, None)
            effect.base_spread = 24
            effect.spread_speed = 0
            effect.start_size = 7
            effect.end_size = 7
            effect.jet_length = 10
            effect.angles = Vector(90, 90, 90)
            effect.rate = 60
            effect.speed = 40
            effect.twist = 720
            effect.render_mode = 18
            effect.render_amt = 100
            effect.render_color = Color(255, 255, 3)
            effect.add_output('SmokeMaterial Effects/Redflare.vmt')
            effect.turn_on()
            effect.set_parent(target.pointer, -1)

            self._cooldown = False
            self._delay = Delay(10, self.__setattr__, '_cooldown', True)
        else:
            SayText2(
                '~ \x02Hunter\'s Mark \x01is on \x05cooldown for {} seconds.'.format(
                    int(self._delay.exec_time-time()))
                ).send(player.index)

@Night_Elf_Hunter.skill
class Serpent_Sting(Skill):
    'A chance for every target you injure to be poisoned.'

    max_level = 4

    _msg_a = '+ \x04Serpent Sting: \x04Poisoned \x01{name} for 6 seconds.'
    _poisoned = set()

    @property
    def _poison_damage(self):
        return 1 + self.level

    @property
    def _poison_chance(self):
        return 16 + (2 * self.level)

    def _kill_effect(self, effect):
        if not effect.basehandle.is_valid():
            return
        effect.call_input('Kill')

    @callback('player_attack')
    def _on_player_attack(self, attacker, victim, **eargs):
        if randint(1, 100) > self._poison_chance or victim.userid in self._poisoned:
            return
           
        self._poisoned.add(victim.userid)

        for index in attacker.weapon_indexes():
            break

        Delay(0.5, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(1, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(2, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(3, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(4.5, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(7, victim.take_damage, self._poison_damage, attacker_index=attacker.index, weapon_index=index)
        Delay(7, self._poisoned.discard, victim.userid)

        SayText2(self._msg_a.format(name=victim.name)).send(attacker.index)

        # EFFECT

        effect = Entity.create('env_smokestack')

        location = victim.origin
        location.z += 48

        effect.teleport(location, None, None)
        effect.base_spread = 12
        effect.spread_speed = 0
        effect.start_size = 3
        effect.end_size = 2
        effect.jet_length = 10
        effect.angles = Vector(90, 90, 90)
        effect.rate = 60
        effect.speed = 40
        effect.twist = 0
        effect.render_mode = 18
        effect.render_amt = 100
        effect.render_color = Color(0, 255, 0)
        effect.add_output('SmokeMaterial Effects/Redflare.vmt')
        effect.turn_on()
        effect.set_parent(victim.pointer, -1)

        Delay(7, self._kill_effect, effect)


@Night_Elf_Hunter.skill
class Wisp_Spirit(Skill):
    'Turn into a wisp to pass through walls. Ultimate.\nPress on a wall to activate.'

    max_level = 8

    def _get_trace(self, start, end, mask, index, trace):
        engine_trace.trace_ray(Ray(start, end),
            ContentMasks.ALL, TraceFilterSimple((index, )), trace)
        return trace

    @callback('player_spawn')
    def _on_player_spawn_reset(self, player, **eargs):
        self.cooldowns['ultimate'] = 4

    @callback('player_ultimate')
    def _on_player_ultimate(self, player, **eargs):
        _cooldown = self.cooldowns['ultimate']
        if _cooldown <= 0:
            origin = player.eye_location
            view_vector = player.view_vector
            view_trace = self._get_trace(
                        origin, origin + view_vector * 10000, ContentMasks.ALL, player.index,
                        GameTrace()
                        )
            if view_trace.did_hit_world():
                wall = view_trace.end_position

            if origin.get_distance(wall) > 200:
                SayText2('~ \x01You \x02must \x01be \x05closer \x01to a \x05wall.'
                    ).send(player.index)
                return

            teleport_vector = None

            for i in range(1, 4):
                tmp_vector = wall + view_vector * (100 * i)
                tmp_trace = self._get_trace(
                            tmp_vector, wall, ContentMasks.ALL, player.index,
                            GameTrace()
                            )
                if tmp_trace.did_hit_world():
                    teleport_vector = tmp_trace.end_position + view_vector * 80
                    break

            if not teleport_vector:
                SayText2('~ \x01You \x02cannot \x0bteleport \x01through this \x05wall.'
                    ).send(player.index)
                return

            teleport_vector.z -= 40

            safety_vector1 = safety_vector2 = teleport_vector
            safety_vector1.z += 80
            safety_vector1.x += 20
            safety_vector1.y -= 20
            safety_vector2.x -= 40
            safety_vector2.y += 40

            safety = self._get_trace(
                        safety_vector1, safety_vector2, ContentMasks.ALL, player.index,
                        GameTrace()
                        )

            if safety.did_hit_world():
                SayText2('~ \x02Cannot \x0bteleport \x04due to obstruction.'
                    ).send(player.index)
                return

            if engine_trace.is_point_outside_of_world(teleport_vector):
                SayText2('~ \x01You \x02cannot \0bteleport \x01out of the map!'
                    ).send(player.index)
                return

            player.teleport(teleport_vector, None, None)
            self.cooldowns['ultimate'] = 10
        else:
            SayText2('~ \x0bWisp Walk \x01is on \x05cooldown for {} seconds.'.format(
                    int(_cooldown))
                ).send(player.index)
« Last Edit: October 30, 2016, 09:49:22 PM by Predz »

Offline Akiro

  • Level 0 Beginner
  • Posts: 4
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #62 on: February 22, 2017, 04:04:25 PM »

I have some problems with the installation


Code: [Select]
02/22/2017 - 16:58:28 > Выполнена команда: sp plugin load wcgo
[SP] Loading plugin 'wcgo'...

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 193, in load
    plugin._load()
  File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "..\addons\source-python\plugins\wcgo\wcgo.py", line 24, in <module>
    import wcgo.configs as cfg
  File "..\addons\source-python\plugins\wcgo\configs.py", line 8, in <module>
    from wcgo.info import info
  File "..\addons\source-python\plugins\wcgo\info.py", line 8, in <module>
    info = PluginInfo()

TypeError: __init__() missing 1 required positional argument: 'name'


[SP] Plugin 'wcgo' was unable to be loaded.

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #63 on: February 26, 2017, 09:32:04 AM »
Hey !

Try to use one of new versions of Warcraft Go :
 - https://github.com/Mahi/Warcraft-SP
 - https://github.com/Predz/SP-Warcraft-Mod

You must modify heroes to use it with this versions.

Offline Joao

  • Level 7 Expert
  • *****
  • Posts: 604
  • Country: br
Re: Warcraft GO v0.3.3.beta
« Reply #64 on: March 12, 2017, 06:16:46 AM »
This mod had potentional. Too bad it requires programming skills (even it just a little) to make heroes.

I wish we had the same WCS as in CS:S (eventscripts). Makes me sad that will never happen.

Offline Kami

  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 719
  • Country: de
  • Pokemon Master!
Re: Warcraft GO v0.3.3.beta
« Reply #65 on: March 12, 2017, 09:58:15 PM »
The problem is, that those people capable of doing it are still too stubborn to just do it ;D

I released a somewhat similar version of WCS for Source Python some time ago, not sure if it even runs anymore, but you could give it a try:

http://warcraft-source.com/board/index.php?topic=17089.msg120556#msg120556


Offline Akiro

  • Level 0 Beginner
  • Posts: 4
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #66 on: March 14, 2017, 11:34:54 PM »
I think that the Warctaft GO are already not compatible with new versions of Source.Python. All my attempts to install the mod using a different combination of versions did not succeed. Maybe some people can upload working version of server? Or just "resource" and "addons" folders? (CS: Source not CS:GO)

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #67 on: March 15, 2017, 09:56:53 AM »
Akiro you are welcome to use my new version ;) https://github.com/Predz/SP-Warcraft-Mod

It has MySQL support as well for those looking for it.

Offline Akiro

  • Level 0 Beginner
  • Posts: 4
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #68 on: March 17, 2017, 01:12:11 PM »
Tried. Can you tell me what's wrong?


Code: [Select]
[SP] Loading plugin 'warcraft'...

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 193, in load
    plugin._load()
  File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "..\addons\source-python\plugins\warcraft\warcraft.py", line 13, in <module>
    from .heroes import *
  File "..\addons\source-python\plugins\warcraft\heroes\extensions.py", line 25
    def _on_pre_attack(self, player, take_damage_info, **kwargs):
                                                                ^

IndentationError: unindent does not match any outer indentation level


[SP] Plugin 'warcraft' was unable to be loaded.


Server is clean. Nothing installed exсept Source.Python v559 & EasyPlayer v2.0.1
« Last Edit: March 17, 2017, 01:17:00 PM by Akiro »

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #69 on: March 17, 2017, 08:40:51 PM »
Hey !
This error due to bad identation, sometimes 4 sometimes 8 spaces so just reindent all to file to 4 spaces.

Offline satoon101

  • Level 1 Trained Beginner
  • *
  • Posts: 36
  • Country: us
Re: Warcraft GO v0.3.3.beta
« Reply #70 on: March 18, 2017, 02:47:34 AM »
It's actually tabs, not 8 spaces.  I have created a pull request to fix this issue.  Once it's pulled, you can download the new version and try to load it again.
https://github.com/Predz/SP-Warcraft-Mod/pull/19

Offline Akiro

  • Level 0 Beginner
  • Posts: 4
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #71 on: March 18, 2017, 09:50:56 AM »
Kami's version of mod

Code: [Select]
[SP] Loading plugin 'wcs'...

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 193, in load
    plugin._load()
  File "..\addons\source-python\packages\source-python\plugins\instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "..\addons\source-python\plugins\wcs\wcs.py", line 42, in <module>
    from wcs import commands
  File "..\addons\source-python\plugins\wcs\commands.py", line 16, in <module>
    from effects import temp_entities

ImportError: cannot import name 'temp_entities'


[SP] Plugin 'wcs' was unable to be loaded.
03/18/2017 - 10:46:35 > Выполнена команда: sp plugin load rotd
[SP] Loading plugin 'rotd'...
test

[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\command.py", line 162, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 193, in load
    plugin._load()
  File "..\addons\source-python\packages\source-python\plugins\instance.py", line 76, in _load
    self.module.load()
  File "..\addons\source-python\plugins\rotd\rotd.py", line 12, in load
    races = wcs.wcs.racedb.getAll().keys()

AttributeError: module 'wcs' has no attribute 'wcs'


[SP] Plugin 'rotd' was unable to be loaded.


es_commands installed successfully

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #72 on: March 18, 2017, 10:33:43 AM »
I think you don't have  the great version of sp to run Kami's mod.

Code: [Select]
from effects import temp_entities

is replaced by

Code: [Select]
from effects.base import TempEntity

in new version of Sp if I'm not mistaken. So you must change all effects. So maybe check in orginal post of Kami if he specifies a Sourcepython version.

And for the Rotd just disable it. It's not a mandatory plugin.

Offline fini

  • Level 0 Beginner
  • Posts: 2
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #73 on: July 18, 2017, 05:03:06 AM »
Hello, I followed the instructions on how to install wcgo, I did everything right, but when I start the server the wcs mod does not work, can anyone help me? sorry for my English.
 :-\ :-\

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #74 on: July 18, 2017, 10:57:12 AM »
Hey, you should try my most recent version. I don't think there are any current problems but if there are just tell me and I will fix them. I am currently working on a extensions file to go into the Git which will include a lot of ready made skills. All people will need to do is subclass the skill they want to use and change the name, description and the property values :)

https://github.com/Predz/SP-Warcraft-Mod

EXAMPLE:

Code: [Select]
## ------------------------------
## ON SPAWN SKILLS
## ------------------------------

class spawnSpeed(Skill):
'Movement speed increased upon spawning.'
max_level = 8

@property
def addition(self):
return 0.1 + (self.level * 0.05)

@events('player_spawn')
def _on_spawn(self, player, **kwargs):
player.speed += self.addition

class spawnHealth(Skill):
'Increased health upon spawning.'
max_level = 8

@property
def addition(self):
return 10 + (self.level * 5)

@events('player_spawn')
def _on_spawn(self, player, **kwargs):
player.health += self.addition

class spawnGravity(Skill):
'Decrease your gravity when spawned.'
max_level = 8

@property
def percentage(self):
'The percentage of gravity that will still affect the player.'
return 1 - (0.08 * self.level)

@events('player_spawn')
def _on_spawn_set_gravity(self, player, **kwargs):
'Called upon the player spawning.'
player.gravity = self.percentage

@events('player_death')
def _on_death_reset_gravity(self, player, **kwargs):
'Called upon the player dying.'
player.gravity = 1.0

USAGE:

Code: [Select]
## TEST HERO

from . import Hero
from .extensions import spawnGravity, spawnSpeed

class Undead(Hero):
    name = 'Undead Scourge'

@Undead.skill
class Unholy(spawnSpeed):
    name = 'Unholy Aura'

    @property
    def addition(self):
        return 0.2 + (self.level * 0.05)

@Undead.skill
class Levitation(spawnGravity):
    name = 'Levitation'
« Last Edit: July 18, 2017, 11:01:34 AM by Predz »