September 26, 2017, 11:44:57 PM

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

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Warcraft GO v0.3.3.beta
« on: January 17, 2016, 08:53:11 AM »
 
Warcraft GO v0.3.3.beta


Description:
    Warcraft GO Edition designed by Predz and Mahi. Built upon the Source.Python plugin to be a huge upgrade to the old versions of WCS, works for CS:S and CS:GO.

Requirements:
    Source.Python (Update fully due to the new Warcraft GO version uses a lot of the new features!)
    EasyPlayer Package (Update using the current git files, because Mahi is yet to put a Release with my fixes!)

Download:
    v0.3.3.beta Release

Installation:
    Drag all content from zip/rar into the csgo directory.
    Add "sp load wcgo" to your server.cfg or autoexec.cfg.
    If you're having problems, watch Mahi's video tutorial to make sure you did everything right before asking for more help.

Configuration:
    Edit the config.py file to your preferences.
    Add custom heroes/items into their respective folders.
    Customize hero categories, levels, etc.

Credits:
    Manifest for him coding the effects, and supplying my test servers.
    Satoon for helping with a lot of the changes, when Source Python changes their libraries.

Extra:
    If you don't want people to use them then add an underscore (_) to the beginning of the Python file's name.
    The "models" dictionary supplied with this version auto-precaches everything. So just retrieving the item from the dictionary is enough.

Change Log:
[Spoiler]
    v 0.3.3.beta
    - Changed delays in Warcraft GO to use the new Delay class in Source.Python
    - Added a new ability class method to allow construction of multiple abilities in heroes. May change method of how this is done at a later date.
    - Updated the menus and heroes to use a new meet_requirements class method. This allows you to use custom requirements for each hero. Return True for the Buy button to be enabled, and return False for the Buy button to be disabled.
    - Other minor fixes, but not needed to go in depth with these.

    v 0.3.1.beta
    - Changed config system to use Source.Python's ConfigManager.
    - Updated menus to use new translation system.
    - Removed unnecessary checking of basehandles.
    - Fixed a few messages.
    - Updated the core to use new Source.Python versions.

    v 0.3.0.beta
    - Added support translations (special thanks to @satoon101 for most of the work) as well as English and Finnish translations
    - Fixed all the XP and level displays where `max_level` was set to `None` and thus it would display `X/None` instead of just `X`
    - Improved ultimate checks so you can no longer ultimate when dead (and the current heroes prevent ultimating between rounds too)
    - **Loads** of bug fixes (huge thanks to the http://www.warcraft-source.com community) and other minor improvements, which can all be seen through the [commit history]

    v 0.2.2.beta
    - Beta (check Github for changes)

Why we skipped a version:
    Currently I have skipped a version because we should of really made a release when Satoon had kindly updated our config files. So therefore I felt it was right to leave a space where it should of been.
« Last Edit: January 17, 2016, 08:54:52 AM by Predz »

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #1 on: January 17, 2016, 09:06:48 AM »
A lot of new features have been added with this update so I thought it was best for me to show you how to use them. Python programmers will probably find this not very useful, as I have tried to take advantage of Python by using these methods of implementation.



Below is an example of how to use the new ability decorator. We have added 2 new hero events along with this update, which are "player_use" and "player_ability".

Code: [Select]
@Paladin.ability
class Holy_Light(Skill):
    'Heal yourself or ally upon ability.'

    ability = 1
    max_level = 8

    _msg_a = '>> \x04Devotion Aura: \x05{name} \x02cannot \x05be healed.'
    _msg_b = '>> \x04Devotion Aura: \x05Healed {name} for {heal} health.'
    _msg_c = '>> \x04Devotion Aura: \x05You were healed by {name}.'

    @property
    def _heal(self):
        return 20 + self.level * 5

    @cooldown(5)
    def player_use(self, player, **eargs):
        target = player.view_player
        if not target:
            target = player

        if target.health > 60:
            self.player_use.remaining_cooldown = 0
            SayText2(self._msg_a.format(name=target.name)).send(player.index)
        else:
            target.health += self._heal
            SayText2(self._msg_b.format(name=target.name, heal=self._heal)).send(player.index)
            if player.userid != target.userid:
                SayText2(self._msg_c.format(name=player.name)).send(target.index)


"player_use" is to be registered in a ability, and is called upon the player using the "ability 1/2/3/4/etc" client command. On being called only the player instance is supplied.

"player_ability" is to be registered in any skill. It is the same as "player_use" however is called when ever ANY ability is fired. The "player_ability" method will be called using a player instance and a ability instance, which allows you to get the abilities data as well.



We also added the ability to create independent hero requirements in this update. So you can now have a hero which works upon gold/totallevel/herolevel being satisfied.

Below is an example which would only allow players with the hero "Death Knight" above level 6, to buy the hero "Paladin".

Code: [Select]
class Paladin(Hero):
    'Holy warrior, empowered by the light.'

    max_level = 40
    category = 'DEFAULT'
    requirements = 'Get Death Knight to Level 6'

    @classmethod
    def meet_requirements(cls, player):
        if 'Death_Knight' in player.heroes:
            return player.heroes['Death_Knight'].level >= 6
        return False

Offline HANGOVER

  • Level 1 Trained Beginner
  • *
  • Posts: 38
  • Country: ua
  • ❤ WCS ❤
Re: Warcraft GO v0.3.3.beta
« Reply #2 on: January 17, 2016, 04:20:02 PM »

excellent update only one error in the logs:
[Spoiler]
Code: [Select]
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\listeners\tick.py", line 54, in _tick
    self.pop(0).execute()
  File "..\addons\source-python\packages\source-python\listeners\tick.py", line 115, in execute
    return self.callback(*self.args, **self.kwargs)
  File "..\addons\source-python\packages\source-python\listeners\tick.py", line 399, in _execute
    self.callback(*self.args, **self.kwargs)
  File "..\addons\source-python\packages\source-python\menus\queue.py", line 238, in _radio_refresh
    queue._refresh()
  File "..\addons\source-python\packages\source-python\menus\queue.py", line 105, in _refresh
    menu._refresh(self._index)
  File "..\addons\source-python\packages\source-python\menus\base.py", line 92, in _refresh
    self._send(player_index)
  File "..\addons\source-python\packages\source-python\menus\radio.py", line 118, in _send
    ShowMenu(*self._build(player_index)).send(player_index)
  File "..\addons\source-python\packages\source-python\menus\base.py", line 102, in _build
    self.build_callback(self, player_index)
  File "..\addons\source-python\plugins\wcgo\menus\heroes.py", line 211, in _current_hero_menu_build
    player = wcgo.player.Player(index)
  File "..\addons\source-python\packages\custom\easyplayer\player.py", line 111, in __call__
    userid = userid_from_index(index)

ValueError: Conversion from "Index" (3) to "Userid" failed.


and when you add new heroes "Paladin", "Undead Scourge" is not loaded mod:
[Spoiler]
Code: [Select]
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\plugins\manager.py", line 77, in __missing__
    instance.globals['load']()
  File "..\addons\source-python\plugins\wcgo\wcgo.py", line 51, in load
    wcgo.utilities.import_modules(wcgo.heroes)
  File "..\addons\source-python\plugins\wcgo\heroes\hero.py", line 16, in <module>
    from listeners.tick import tick_delays

ImportError: cannot import name 'tick_delays'
« Last Edit: January 17, 2016, 04:53:23 PM by HANGOVER »

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #3 on: January 17, 2016, 05:04:15 PM »
Yeh I haven't updated the imports on Undead Scourge yet. I will fix them later :)

For the index errors. Those I honestly have no clue where they come from, and neither do Source.Python devs. But they dont cause any problems so shouldn't be a problem. :)

Offline Frogs

  • Level 0 Beginner
  • Posts: 12
  • Country: fr
Re: Warcraft GO v0.3.3.beta
« Reply #4 on: January 18, 2016, 02:05:47 PM »
Hey !
Nice update ! :) Thanks you

I have a problem to load sp on my server (my host is MtxServ) :
Code: [Select]
[SP] Loading plugin 'wcgo'...
[SP] Caught an Exception:
Traceback (most recent call last):
File '../addons/source-python/packages/source-python/plugins/manager.py', line 71, 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/wcgo/wcgo.py', line 25, in
File '../addons/source-python/plugins/wcgo/database.py', line 4, in
import sqlite3
import wcgo.database
File '../addons/source-python/Python3/sqlite3/__init__.py', line 23, in
from sqlite3.dbapi2 import *
File '../addons/source-python/Python3/sqlite3/dbapi2.py', line 26, in
from _sqlite3 import *
ImportError: libsqlite3.so.0: cannot open shared object file: No such file or directory
[SP] Plugin 'wcgo' was unable to be loaded.

But locally on my computer, I don't have this problem.
So why it's not works on the server ?

Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 25
  • Country: de
    • Source.Python
Re: Warcraft GO v0.3.3.beta
« Reply #5 on: January 18, 2016, 03:22:05 PM »
Try copying libsqlite3.so.0 from ../addons/source-python/Python3/plat-linux/ to your base directory (where srcds_linux is located).

Offline valerun

  • Level 2 Apprentice
  • **
  • Posts: 44
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #6 on: January 18, 2016, 04:10:55 PM »
Mysql will support?

Offline Frogs

  • Level 0 Beginner
  • Posts: 12
  • Country: fr
Re: Warcraft GO v0.3.3.beta
« Reply #7 on: January 18, 2016, 04:51:58 PM »
Quote
Try copying libsqlite3.so.0 from ../addons/source-python/Python3/plat-linux/ to your base directory (where srcds_linux is located).

It works ! Thanks you verymuch !

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #8 on: January 18, 2016, 05:19:14 PM »
Adding MySQL support is rather easy however not on my priority list atm. If enough people would like the support for it then I will get to work on it hopefully later this week. Sorry but I have driving test and stuff tomorrow.

Offline garry

  • Level 7 Expert
  • *****
  • Posts: 320
  • Country: ru
  • active years 2008-2012
Re: Warcraft GO v0.3.3.beta
« Reply #9 on: January 21, 2016, 07:58:35 AM »
Need help with the translation into Russian?

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #10 on: January 21, 2016, 08:47:28 AM »
Hiya garry. If you would like to do the russian translations, then feel free to put a pull request on Github for it. I am always for the community helping to update Warcraft GO, and would appreciate the translations :D

Offline zuzs980

  • Level 5 Trained Intermediate
  • *****
  • Posts: 101
  • Country: us
  • Epic
Re: Warcraft GO v0.3.3.beta
« Reply #11 on: January 23, 2016, 02:40:27 PM »
I am going to try to get this To work on my dedicated server from my computer and if i can get it to work ill be adding it to a live server to go along with my 1v1 server! Glad to see this mod is making a comeback, It was my favorite back in cSS.

EDIT:
Server Starts but the plugin wont load. Its a fresh installed dedicated server on my PC.


Code: [Select]
[SP] Caught an Exception:
Traceback (most recent call last):
  File '..\addons\source-python\packages\source-python\plugins\manager.py', line 71, 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\wcgo\wcgo.py', line 30, in <module>
    import wcgo.menus
  File '..\addons\source-python\plugins\wcgo\menus\__init__.py', line 4, in <module>
    from wcgo.menus.main import main_menu
  File '..\addons\source-python\plugins\wcgo\menus\main.py', line 10, in <module>
    import wcgo.player
  File '..\addons\source-python\plugins\wcgo\player.py', line 10, in <module>
    import easyplayer

ImportError: No module named 'easyplayer'


[SP] Plugin 'wcgo' was unable to be loaded.
exec: couldn't exec gamemode_casual_server.cfg
Commentary: Could not find commentary data file 'maps/de_dust2_commentary.txt'.
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
Initializing Steam libraries for secure Internet server
Logging into Steam gameserver account with logon token 'D11AF41Cxxxxxxxxxxxxxxxxxxxxxxxx'
Connection to Steam servers successful.
« Last Edit: January 23, 2016, 03:11:41 PM by zuzs980 »

Offline Kami

  • Watchdog
  • Level 7 Expert
  • *****
  • Posts: 731
  • Country: de
  • Pokemon Master!
Re: Warcraft GO v0.3.3.beta
« Reply #12 on: January 23, 2016, 03:27:18 PM »
You need the easyplayer module as stated in the first post :) There is a link to it too!

Offline zuzs980

  • Level 5 Trained Intermediate
  • *****
  • Posts: 101
  • Country: us
  • Epic
Re: Warcraft GO v0.3.3.beta
« Reply #13 on: January 23, 2016, 08:10:25 PM »
Maybe a dumb question...

But is there a List of Commands for this mod.
I cant find them in the files and all ive stumbled across is wcgo
« Last Edit: January 23, 2016, 08:14:10 PM by zuzs980 »

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 551
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #14 on: January 24, 2016, 08:02:50 AM »
The "wcgo" command is designed to access the main menu. At the moment there is no way to navigate straight to a submenu. However could be implemented easily.

If you go to the Source.Python website you will be able to see the way in which we can alter <Player> attributes to change the players stuff in game.

http://forums.sourcepython.com/

Code: [Select]
# Removes 20% of the player's speed.
<Player>.speed -= 0.2

# Adds 30HP to the player's health.
<Player>.health += 30
« Last Edit: January 29, 2016, 08:40:47 AM by Mahi »