October 19, 2017, 01:49:49 AM

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

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #105 on: July 31, 2017, 10:58:26 AM »
Hey :)

You can also create a new skill without using extension :

Code: [Select]
@Iron_Man.skill
class Tough_Armor(Skill):
    name = 'Tough Armor'
    description = 'Evade shot.'
    max_level = 6

    @property
    def _chance(self):
        return 5 * self.level - 5

    @events('player_pre_victim')
    def _on_player_pre_victim(self, attacker, victim, take_damage_info, **eargs):
        if randint(1, 100) > self._chance or self.level == 0:
            return

        take_damage_info.damage = 0


Offline phixious

  • Level 0 Beginner
  • Posts: 7
  • Country: us
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #106 on: July 31, 2017, 01:15:37 PM »
That looks great Predz. Thanks.

I think that keeping the logging as far forward as possible is probably the most reliable way to get the data without additional manipulations, so I would tend to agree that it should stay in the main python code.

Logging all arguments with debug mode 3 sounds like it will make things much easier to track down and trap issues a lot better for people attempting to make complex skills or skill chains where each skill can manipulate another.


Question for anyone more knowledgeable about CSGO engine: I know a lot of stuff has changed from source but is there a way to "lock" users to only using a knife now without losing their other weapons? Also, has anyone figured out the default model alpha issue or does Invisibility still going to require custom models?

Thanks for all the hard work Predz.

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #107 on: July 31, 2017, 01:32:21 PM »
That looks great Predz. Thanks.

I think that keeping the logging as far forward as possible is probably the most reliable way to get the data without additional manipulations, so I would tend to agree that it should stay in the main python code.

Logging all arguments with debug mode 3 sounds like it will make things much easier to track down and trap issues a lot better for people attempting to make complex skills or skill chains where each skill can manipulate another.


Question for anyone more knowledgeable about CSGO engine: I know a lot of stuff has changed from source but is there a way to "lock" users to only using a knife now without losing their other weapons? Also, has anyone figured out the default model alpha issue or does Invisibility still going to require custom models?

Thanks for all the hard work Predz.

Locking a person to their knife should be doable with the following virtual function, I think. Would take a lot of playing with to make it work perfectly though. That function is called upon someone scrolling through their weapons. Hope that help :)

As for invisibility. Player invisibility now works thanks to valve fixing shit by adding a new CVAR. Just set "sv_disable_immunity_alpha" to 1 in your server.cfg and that will now allow alpha to be given to a player.

Offline phixious

  • Level 0 Beginner
  • Posts: 7
  • Country: us
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #108 on: July 31, 2017, 02:25:42 PM »
Alright. Thanks for the info and quick reply.

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #109 on: July 31, 2017, 07:40:30 PM »
But invisibility doesn't work on weapons for the moment :(
« Last Edit: August 03, 2017, 10:12:31 AM by Existenz »

Offline Lysergsyredietylamid

  • Level 0 Beginner
  • Posts: 3
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #110 on: August 02, 2017, 05:11:56 PM »
Hey man!
Still can't really wrap my head around this.

Code: [Select]
  File "..\addons\source-python\plugins\warcraft\heroes\test.py", line 17, in <module>
    @Test.skill

AttributeError: type object 'Test' has no attribute 'skill'

In server console when i type

Code: [Select]
@Test.skill
class Evajzon(victimEvasion):
name = 'Avaiosion'
'Given a chance to avoid incoming attacks.'
max_level = 8

@property
def chance(self):
'The chance in which you will evade damage.'
return 16 + (self.level * 2)

And if I like before with the Undead.py file change @Undead.skill I get this

Code: [Select]
  File "..\addons\source-python\plugins\warcraft\heroes\undead.py", line 22, in <module>
    @Undeaddd.skill

NameError: name 'Undeaddd' is not defined

It looks for names to point to or something. Cause @Test.skill does not work whilst @Undead.skill works fine but just @Undead.skill, not a single letter more or less then it gives errors.

Where do I define or add names?  ???

Offline Existenz

  • Level 4 Intermediate
  • ****
  • Posts: 87
  • Country: fr
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #111 on: August 03, 2017, 10:06:15 AM »
Hey

Put this following test.py in heroes folder.

Code: [Select]
# test.py

from . import Hero
from .extensions import victimEvasion

class Test(Hero):
    name = 'Test'

@Test.skill
class Evajzon(victimEvasion):
        'Given a chance to avoid incoming attacks.'
name = 'Avaiosion'
max_level = 8

@property
def chance(self):
'The chance in which you will evade damage.'
return 16 + (self.level * 2)


Not tested but i think it must work :)

Offline Xoide

  • Level 0 Beginner
  • Posts: 4
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #112 on: August 13, 2017, 01:52:12 PM »
Hello! I dont know if this is allowed but i want to ask anyways, just remove my comment if it's not allowed.
I have been on an warcraft modded server with all there functions and races skills etc working and i'm wondering if they are running source.python, sourcemod or eventscripts, can't really get a straight answer from them and that's why i'm asking here. The servers name are  WCS | CEGamer.com. Reason why i'm asking is there are more explanations about where to start configuring sourcemod, haven't looked at ES due to there will be no updates to it but i hope i can get some answers or someone who is willing to learn me some about where to start. I know some basics but i'm not good at programming at all and i'm very intrested in learning new things. Have a nice day everyone!

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Warcraft GO v0.3.3.beta
« Reply #113 on: August 14, 2017, 10:27:19 PM »
Hiya Xiode. Now I believe Joshtrav runs those servers as he was able to show this code when I was coding some more complex stuff. Shown beneath.

Instead of doing a trace you can just check the player flags for 1<<0 (flag for being on ground)

You can look at what we run for it, in case it may simplify your code - been running it for a couple years now with no issues.

Code: [Select]
    for userid in player_airjump_reg:
        jumpkey = userid.getButtons() & 2
        if last_jumpkey.get(userid, 0) != jumpkey:
            last_jumpkey[userid] = jumpkey
            if jumpkey:
                if not userid.onGround() and not userid.getProp("m_nWaterLevel"):
                    sm.fireEvent("player_airjump", {"userid": userid})

From looking at the layout of that code, I think he may of been using a combination of SourceMod and SourcePython. Also I think maybe an old version of SP before all the modules were reworked. However someone may correct if I am wrong.

But to answer your question, they are not running any of my code that I know of. But from the code supplied by Joshtrav a while ago, all I can assume is that they run some abomination of SP+SM ;)

Offline joshtrav

  • Level 3 Trained Apprentice
  • ***
  • Posts: 66
  • Country: 00
  • www.CEGamer.com
    • Carbon Era Gamer
Re: Warcraft GO v0.3.3.beta
« Reply #114 on: September 16, 2017, 04:40:10 AM »
At http://www.cegamer.com we run SourceMod with a custom extension that ports SM's natives to Python 3.2.2

From there its really just a long time of trial and error to get things the way they are.  We often share and help other servers when diagnosing crashes, but our software isn't a "cookie cutter" setup.  Such that someone new to coding, or even relatively intermediate would be able to jump into.

There is very little in the way of documentation and 100s of imports.  We have custom coded everything, not just WCS.  The admin, the interfaces, console interaction, links to our website's API, etc.

Offline farmor

  • Level 0 Beginner
  • Posts: 1
  • <3 WCS :)
Re: Warcraft GO v0.3.3.beta
« Reply #115 on: October 15, 2017, 04:07:09 PM »
i got this error in my console: https://imgur.com/a/3Z1wo

I am running on windows server 2012, source python, CSGO, STEAM.
How can i FIX THIS?