Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2008-04-15 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
April 15, 2008, 11:58:22 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Remember to check on the FAQ before start posting.
It may save you time and effort.
Also here is the WCS Wiki!
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1] 2 3   Go Down
  Print  
This topic has not yet been rated! You have not rated this topic. Select a rating:
Author Topic: Firelord, any bugs?  (Read 325 times)
The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« on: March 02, 2008, 10:58:12 PM »

I haven't tested this race, and i just finished coding it...
I'd like feedback please, im gonna enter this race for the race competition, so i'd like to optimize it before i enter it.
Does anyone have idea's to add maybe, or have you found a bug? Please let me know
Anyways, here's the race:
Code
GeSHi (python):
'''
Firelord for WCSP, coded by Hawk. (The_Last_Ghost)
(Also my first race =D)
Alot of thanks to Joshtrav for all the testing he did!
'
''
import es, wcs, gamethread, random
from wcs import wcs
 
RaceName = 'Firelord'
race = wcs.Race(RaceName)
race.registerMinLevel(50)
 
race.registerSkill('Soul Burn', 5, 2, 'Deal damage over time and slow victim.') #use ability to Soul Burn the enemy you're looking at, damaging and slowing the target. (Can i disable "ability" and "ultimate" for victim?)
race.registerSkill('Consuming Fire', 5, 2, 'Consume the enemy flesh by attacking them to feed your eternal fire. /n(Respawns you if you have gathered enough energy, once/round.)') #Save the damage you deal into a dictionary, if above 50 then respawn player on death, max 200 spawning hp.
race.registerSkill('Incinerate', 6, 2, 'Deal additional damage for every hit, and explode victim if you kill.') #deal a small amount of extra dmg every hit, if the victim dies, he explodes.
race.registerUltimate('Volcano', 8, 8, 2, 'Channel a volcano to damage and stun enemies around you (and a small chance to do instant-kill).') #Channel a volcano, damaging and stunning nearby enemies every 3 seconds for 15 seconds, small chance for instant kill.
 
def player_hurt(ev):
   uid = int(ev['userid'])
   aid = int(ev['attacker'])
   playera = wcs.Command(aid)
   playeru = wcs.Command(uid)
   if ev['es_userteam'] != ev['es_attackerteam'] and aid:
       ConFireOn = playera.ReturnDict('ConFireOn')
       ConFire = wcs.GetLevel(aid, RaceName, 'Consuming Fire')
       if ConFireOn and ConFire:
           damage = int(ev['dmg_health'])
           temp = playera.ReturnDict('ConFireValue')
           damage = damage * 0.2 * ConFire
           if (temp + damage) > 200:
               damage = damage + temp - 200
           playera.ModDict('ConFireValue', damage)
       Incinerate = wcs.GetLevel(aid, RaceName, 'Incinerate')
       if Incinerate:
           damage = int(ev['dmg_health'])
           damage = damage * 0.03 * Incinerate
           playeru.Damage(damage, 32, aid)
           wcs.Effect().Beam2(uid, aid, 0.3, 200, 27, 28)
           if int(ev['es_userdead']):
               erange = Incinerate * 25
               edamage = Incinerate * 7.5
               if int(ev['es_attackerteam']) == 2:
                   targets = '#ct'
               elif int(ev['es_attackerteam']) == 3:
                   targets = '#t'
               randsound = 'weapons/%s' % random.choice(['explode3.wav', 'explode4.wav', 'explode5.wav'])
               es.emitsound(player, uid, randsound, 1.0, erange * 1.25)
               wcs.Effect().Smoke(uid)
               playeru.AreaDamage(targets, erange, edamage)
 
def player_death(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   ConFire = wcs.GetLevel(uid, RaceName, 'Consuming Fire')
   ConFireOn = playeru.ReturnDict('ConFireOn')
   if ConFireOn and ConFire:
       ConFireValue = playeru.ReturnDict('ConFireValue')
       if ConFireValue >= 50:
           es.tell(uid, '#multi', "#lightgreenYour flame builds again, you respawn in 3 seconds.")
           gamethread.delayedname(3, 'ConFireSpawn', playeru.Spawn)
           gamethread.delayedname(3.2, 'ConFireSpawn', playeru.Health, ConFireValue)
           gamethread.delayedname(3.3, 'ConFireSpawn', es.emitsound, (player, uid, 'ambient/fire/ignite.wav', 1.0, 200))
           playeru.UpdateDict('ConFireOn', 0)
           playeru.UpdateDict('ConFireValue', 0)
       else:
           es.tell(uid, '#multi', "#lightgreenYou didn't gather enough energy to respawn.")
 
def player_ability_on(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   cooldown = playeru.GetCoolDown('Soul Burn')
   if not cooldown:
       SoulBurn = wcs.GetLevel(uid, RaceName, 'Soul Burn')
       if SoulBurn:
           target = playeru.GetViewPlayer()
           if target:
               playert = wcs.Command(target)
               targetteam = es.getplayerteam(target)
               userteam = es.getplayerteam(uid)
               if targetteam != userteam:
                   duration = SoulBurn * 2
                   slow = SoulBurn * -0.1
                   damage = SoulBurn * 3
                   playert.Drain(damage, 3, duration)
                   playert.SpeedAdd(slow)
                   playert.BlockUlti(duration)
                   playert.BlockAbil(duration)
                   gamethread.delayedname(duration, 'SoulBurnSpeed', playert.SpeedAdd, -slow)
                   playert.SetCoolDown('Soul Burn', 20)
               else:
                   es.tell(uid, '#multi', '#lightgreenYou must be looking at an enemy target to use #greenSoul Burn!')
           else:
               es.tell(uid, '#multi', '#lightgreenYou must be looking at an enemy target to use #greenSoul Burn!')
 
def player_ultimate_on(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   volcano = wcs.GetLevel(uid, RaceName, 'Volcano')
   cooldown = playeru.GetCoolDown('Volcano')
   if volcano and not cooldown:
       es.tell(uid, '#multi', "#lightgreenYou start channeling a #greenVolcano!")
       es.setplayerprop(uid, 'CBasePlayer.m_fFlags', 32.0)
       playeru.SetCoolDown('Volcano', 30)
       vrange = volcano * 50
       volcanoexec(uid, vrange)
       playeru.UpdateDict('VolcanoOn', 1)
       gamethread.delayedname(12, 'VolcanoOff', player_ultimate_off_force, uid)
 
def player_ultimate_off(ev):
   uid = int(ev['userid'])
   playeru = wcs.Command(uid)
   volcano = wcs.GetLevel(uid, RaceName, 'Volcano')
   if volcano:
       player_ultimate_off_force(uid)
 
def player_ultimate_off_force(uid):
   playeru = wcs.Command(uid)
   es.cexec(uid, '-ultimate')
   es.tell(uid, '#multi', "#lightgreenYou stop channeling the #greenVolcano!")
   es.setplayerprop(uid, 'CBasePlayer.m_fFlags', 1.0)
   playeru.UpdateDict('VolcanoOn', 0)
   name = 'volcano_%s' % uid
   gamethread.cancelDelayed(name)
   gamethread.cancelDelayed('VolcanoOff')
 
def volcanoloop(uid, aid):
   playeru = wcs.Command(uid)
   playera = wcs.Command(aid)
   volcano = wcs.GetLevel(aid, RaceName, 'Volcano')
   damage = volcano * 4
   stun = volcano * 0.2
   instakill = volcano * 0.5
   es.emitsound(player, uid, 'ambient/explosions/explode_8.wav', 1.0, volcano * 55)
   wcs.Effect().Misc5(aid, 2, 3)
   wcs.Effect().Smoke(aid)
   if instakill > random.randint(1, 100):
       health = es.gethealth(uid)
       playeru.Damage(health, 32, aid)
       es.tell(uid, '#multi', "#lightgreenYou have been killed by a volcano rock") #Better luck next time! hehe...
   else:
       playeru.Damage(damage, 32, aid)
       playeru.Freeze(stun)
       es.tell(uid, '#multi', "#lightgreenYou have taken #green%s damage #lightgreenand been #greenstunned for %s seconds #lightgreenby a volcano") % (str(damage), str(stun))
   volcanoon = playera.ReturnDict('VolcanoOn')
   if volcanoon:
       name = 'volcano_%s' % aid
       gamethread.delayedname(3, name, 'volcanoloop', (uid, aid))
 
def volcanoexec(uid, vrange):
   playeru = wcs.Command(uid)
   userteam = es.getplayerteam(uid)
   if userteam == 2:
       targetteam = '#ct'
   elif userteam == 3:
       targetteam = '#t'
   playeru.Near(vrange, volcanoloop, targetteam)
 
def round_start(ev):
   for uid in es.getUseridList():
       wcs.Command(uid).UpdateDict('ConFireOn', 1)
 
def round_end(ev):
   gamethread.cancelDelayed('SoulBurnSpeed')
   gamethread.cancelDelayed('ConFireSpawn')
   gamethread.cancelDelayed('VolcanoOff')
   for uid in es.getUseridList():
       VolcanoOn = wcs.Command(uid).ReturnDict('VolcanoOn')
       if VolcanoOn:
           player_ultimate_off_force(uid)
 
 
Thanks in advance! 

*Edit: Added minimum level.
**Edit: Just realized I'm missing effects, i'll add those later, goodnight for now...
***Edit: Gave the delayname a rather unique name.
Code updated: added a force stop for ultimate.... Added effects for incinerate, respawn and volcano.

I haven't tested this race, and i don't have a server i can test on... Could anyone test for me? Just PM me with eventual bugs or things that needs fix (Or let me know if it's OP, i have a feeling that Volcano is a bit too powerful, if it worked )

Hmm, i have looked at the issue with the ultimate, and found out why you are kept frozen, and so i've (hopefully) fixed that. Though i can't rly figure out why it keeps looping, do you keep getting the message that the volcano stops?
« Last Edit: March 22, 2008, 02:35:44 PM by The_Last_Ghost » Logged

- I will tell you what u want to hear, but not mean anything!
freddukes
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 230



« Reply #1 on: March 02, 2008, 11:55:20 PM »

A few bugs I can see...

Code
GeSHi (python):
damage = ev['damage']
There is no ev['damage']... don't you mean ev['dmg_health'] and also, you need int(ev['dmg_health']) as all event_var's return as strings...

Code:
>>> '32' * 0.2 * 5

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    '32' * 0.2 * 5
TypeError: can't multiply sequence by non-int of type 'float'
>>>

That is what you're trying to do....

Also...
Code
GeSHi (python):
gamethread.delayedname(3.2, 'ConFireSpawn', playeru.Health)
... You don't pass on any value to health... That code will run wcs.Command(userid).Health()... You need to input a value, such as
Code
GeSHi (python):
gamethread.delayedname(3.2,'ConFireSpawn',playeru.Health,50)

Code
GeSHi (python):
def player_ability_on(ev):
   uid = es.getcmduserid()
 

There is no es.getcmduserid()... it is ev['userid']...

es.GetPlayerTeam should be es.getplayerteam (lowercase)

That's only a quick look... There maybe more.. This looks like a nice race, good job

-freddukes
Logged

The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #2 on: March 03, 2008, 09:11:47 PM »

*code updated*
Logged

- I will tell you what u want to hear, but not mean anything!
Jeff
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United States United States

Posts: 305



WWW
beastrace91
« Reply #3 on: March 04, 2008, 03:07:11 PM »

This is looking pretty good you to submit it in the race competition?

~J3ff
Logged

The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #4 on: March 04, 2008, 09:01:58 PM »

I will, when it's been tested, i just don't have a test server =(
Logged

- I will tell you what u want to hear, but not mean anything!
Jeff
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United States United States

Posts: 305



WWW
beastrace91
« Reply #5 on: March 04, 2008, 09:19:28 PM »

Use a dedicated server?... this is how I test most of my races (and I have a testing server )

~J3ff
Logged

The_Last_Ghost
Level 3 Trained Apprentice
***
Offline Offline

Denmark Denmark

Posts: 75




The_Last_Ghost
thelastkaas
« Reply #6 on: March 04, 2008, 09:37:45 PM »

My dedi is messed up, tottaly screwed, but maybe i've just got a place to test... that is when the server get's WCSP up and running =)
Logged

- I will tell you what u want to hear, but not mean anything!
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #7 on: March 07, 2008, 07:41:46 AM »

I am trying to test this now.

I am not 100% what I am doing.  I added all this info on the notepad, then saved it as Firelord.py

I then loaded Firelord.

It is telling me there is an error on line 41:
Code
GeSHi (python):
03/07/08 18:50:01
Traceback (most recent call last):
 File "C:\Program Files\Valve\HLServer\CSSserver\cstrike\addons\eventscripts\es.py", line 321, in loadModuleAddon
   newaddon = __import__(importname)
 File "C:\Valve\HLServer\CSSserver\cstrike\addons\eventscripts\wcs\races\Firelord\Firelord.py", line 41
   if int(ev['es_attackerteam']) = 2:
                                 ^
SyntaxError: invalid syntax
Could not open script for addons/eventscripts/wcs/races/Firelord/es_Firelord.txt
 

BTW, I will be more then happy to test out anyones race.

We have a dedicated box just for the python build to test it as it progresses.

Anyone is welcome to come in and test their races.  Just drop me a line to add it, and include your steam ID in the PM.  I will set you up with wcsadmin to give yourself levels and try em out.

Thanks again,
Josh
« Last Edit: March 08, 2008, 02:52:36 AM by joshtrav » Logged
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #8 on: March 08, 2008, 02:53:17 AM »

Just curious after looking at this.

Any clue why its looking for a es_Firelord.txt file? 
Logged
joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #9 on: March 08, 2008, 02:58:19 AM »

Actually had a chance to play this a few min ago.

None of the skills are listed in the panel.  It just shows firelord, and once you switch, its listing nothing.
Logged
Jeff
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United States United States

Posts: 305



WWW
beastrace91
« Reply #10 on: March 08, 2008, 03:01:27 AM »

Ok well to fix that trouble just change line 41 from
Code
GeSHi (python):
if int(ev['es_attackerteam']) = 2:
to
Code
GeSHi (python):
if int(ev['es_attackerteam']) == 2:

As for why it is looking for a .txt this is because if ES runs into an invalid syntax in a .py script it tries to then load the .txt version of that same script, if it exists.

~J3ff
Logged

Jeff
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United States United States

Posts: 305



WWW
beastrace91
« Reply #11 on: March 08, 2008, 03:02:08 AM »

The file will not load with the syntax error, thus it gets added to the menu but no skills are registered to it.

~J3ff
Logged

joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #12 on: March 08, 2008, 03:24:32 AM »

Ok.  Fixed the two instances of ==.

Error is now:
Code
GeSHi (python):
03/07/08 19:22:09
Traceback (most recent call last):
 File "C:\Program Files\Valve\HLServer\CSSserver\cstrike\addons\eventscripts\es.py", line 321, in loadModuleAddon
   newaddon = __import__(importname)
 File "C:\Valve\HLServer\CSSserver\cstrike\addons\eventscripts\wcs\races\Firelord\Firelord.py", line 154
   def volcanoexec(uid, vrange):
     ^
SyntaxError: invalid syntax
Logged
Jeff
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United States United States

Posts: 305



WWW
beastrace91
« Reply #13 on: March 08, 2008, 03:26:37 AM »

Line #152 is
Code
GeSHi (python):
gamethread.delayedname(3, name, volcanoloop, (uid, aid)
needs to be
Code
GeSHi (python):
gamethread.delayedname(3, name, volcanoloop, (uid, aid))

~J3ff
Logged

joshtrav
Level 2 Apprentice
**
Offline Offline

United States United States

Posts: 56



« Reply #14 on: March 08, 2008, 03:40:30 AM »

Alright.  We have liftoff!

The race is now functioning.  I will let you know how the testing goes.

-Josh
Logged
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
April 14, 2008, 08:47:37 PM
Seconds u there
April 14, 2008, 06:57:57 PM
Ty see u there
April 13, 2008, 11:00:29 PM
@overfinch123, your application has been accepted
April 13, 2008, 10:10:47 PM
ESELADDEN I entered your WCS tournament i left a reply want me to send itt to you?
April 13, 2008, 10:09:54 PM
Eseladden u there?
April 13, 2008, 08:30:55 AM
WCSUsers db file, move that file
April 13, 2008, 06:24:38 AM
Hey guys how do I move levels to another server?
Recent
[Today at 11:21:51 PM]

[Today at 09:22:37 PM]

[Today at 08:18:30 PM]

by West
[Today at 08:14:12 PM]

by Jeff
[Today at 06:51:25 PM]

[Today at 06:08:09 PM]

[Today at 06:03:36 PM]

[Today at 05:50:59 PM]

[Today at 04:20:36 PM]

[Today at 02:50:39 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.355 seconds with 24 queries.