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 2009-02-26 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
February 26, 2009, 02:00:42 AM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Races and Items added into Download section from our great Race Coders!
Such as... HOLLIDAY|NovaKiller|Stinkyfax|Frodo|TeacherCreature|Phat_Wizard
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
This topic has not yet been rated! You have not rated this topic. Select a rating:
Author Topic: Issues with first race  (Read 315 times)
Gumbers
Level 0 Beginner

Offline Offline

United States United States

Posts: 1




gumbo117
« on: December 03, 2008, 07:16:47 AM »

I decided to create a new race and I am able to get it to load up in my server but I believe that the skills are not loading, as I open up spendlevels for the race, there are no skills listed. Any help/corrections for my race would be appreciated.





FULL VERSION (With Config)

Code
GeSHi (python):
import es
import random
import gamethread
import playerlib
 
import wcs
from wcs import wcs
 
 
 
""" Load the strings into the variable text """
text = race.loadStrings()
 
 
# Config
config = race.config()
 
# Uber Speed
config.addComment('********************')
config.addComment('Uber Speed')
config.addComment('This skill allows the player to')
config.addComment('run like Usain Bolt')
config.addComment('********************')
config.addComment()
speedMaxLevel = config.addVar('speedMaxLevel',8,'The maximum level of the Uber Speed skill')
 
# Invisibility Cloak
config.addComment('********************')
config.addComment('Invisibility Cloak')
config.addComment('This skill allows you to become')
config.addComment('fully invisible.')
config.addComment('********************')
config.addComment()
cloakMaxLevel = config.addVar('cloakMaxLevel',8,'The maximum level of the Invisibility Cloak skill')
 
# Levitation
config.addComment('********************')
config.addComment('Levitation')
config.addComment('This skill decreases a players')
config.addComment('level of gravity.')
config.addComment('********************')
config.addComment()
levitationMaxLevel = config.addVar('levitationMaxLevel',8,'The maximum level of the levitation skill')
 
# Longjump
config.addComment('********************')
config.addComment('Longjump')
config.addComment('This skill increases the')
config.addComment('distance you jump.')
config.addComment('********************')
config.addComment()
longjumpMaxLevel = config.addVar('longjumpMaxLevel',8,'The maximum level of the Longjump skill')
longjumpLevelInterval = config.addVar('longjumpLevelInterval',1,'The intervals between the abilities to upgrade their Longjump skill')
 
# Suicide Bomber
config.addComment()
config.addComment('********************')
config.addComment('Suicide Bomber')
config.addComment('This ultimate gives you a chance')
config.addComment('to blow up on death.')
config.addComment('********************')
config.addComment()
suicidebomberMaxLevel = config.addVar('suicidebomberMaxLevel',8,'The maximum level of the Suicide Bomber skill')
suicidebomberLevelInterval = config.addVar('suicidebomberLevelInterval',1,'The intervals between the abilities to upgrade their Suicide Bomber skill')
suicidebomberCoolDown = config.addVar('suicidebomberCoolDown',1,'The amount of seconds after a player has used their Suicide Bomber skill until they can use it again')
 
config.load(True)
 
# Skills
 
RaceName = 'Tequifa Okanewie'
race = wcs.Race(RaceName)
race.registerSkill('Uber Speed',int(speedMaxLevel),1,"Run like the Usain Bolt")
race.registerSkill('Invisibility Cloak',int(cloakMaxLevel),1,"Become fully Invisible")
race.registerSkill('Levitation',int(levitationMaxLevel),1,"Lower Gravity")
race.registerSkill('Long Jump',int(longjumpMaxLevel),int(longjumpLevelInterval),"Jump Farther")
 
# Ultimate
race.registerUltimate("Suicide Bomber",1,int(suicidebomberMaxLevel),int(suicidebomberLevelInterval),"Chance to blow up on Death")
 
# Define Skills
 
def player_Spawn(event_var):
userid = int(event_var['userid'])
if wcs.GetRace(userid) == 'Tequifa Okanewie':
UberSpeed_level = wcs.GetLevel(userid,raceName,'Uber Speed')
if UberSpeed_level:
       wcs.Command(userid).Speed(1+(UberSpeed_level/8)
Levitation_level = (wcs.GetLevel(userid,raceName,'Levitation')
if Levitation_level:
       wcs.Command(userid).SetGravity(1-(Levitation_level/16))
InvisibilityCloak_level = (wcs.GetLevel(userid,raceName,'Invisibility Cloak')
if InvisibilityCloak_level:
       wcs.Command(userid).Color(alpha=200-(InvisibilityCloak_level*25))
 
def player_jump(event_var):
userid = int(event_var['userid'])
LongJump = wcs.GetLevel(userid, raceName, 'Long Jump')*2.5
if LongJump:
       vec1 = es.getplayerprop(userid,'CBasePlayer.localdata.m_vecVelocity[0]')
       vec2 = es.getplayerprop(userid,'CBasePlayer.localdata.m_vecVelocity[1]')
       vec1 = (LongJump * vec1) * (1 / 4.1)
       vec2 = (LongJump * vec2) * (1 / 4.1)
       vector = es.createvectorstring(vec1,vec2,0)
       es.setplayerprop(userid,'CBasePlayer.localdata.m_vecBaseVelocity',vector)
 
def player_death(event_var):
userid = int(event_var['userid'])
SuicideBomber_level = wcs.GetLevel(userid,raceName,'Suicide Bomber')
       wcs.Command(userid).AreaDamage(SuicideBomber_level*10,SuicideBomber_level*5)

« Last Edit: December 03, 2008, 06:23:20 PM by Gumbers » Logged
shadowmaster
Level 0 Beginner

Offline Offline

United Kingdom

Posts: 6



« Reply #1 on: December 03, 2008, 04:01:30 PM »

i have the same prob on my race 2
Logged
Espeladden
Pwning ultra sexy beastly hot legend
Level 7 Expert
*****
Offline Offline

Norway

Posts: 583



WWW
Gastingor
Mursat

myServer 74.86.98.64:27017
(Warning: click connects through Steam)
« Reply #2 on: December 03, 2008, 07:46:35 PM »

As you can see in the top of the code, you have the var RaceName.
When you use GetLevel you use the var raceName, which means it looks for something that isnt there. If you change it to RaceName it should work fine
Logged

Akel
Level 0 Beginner

Offline Offline

United States United States

Posts: 10


But... I'm Probably Wrong.



Akel
akeldama

myServer 69.93.99.14:27016
(Warning: click connects through Steam)
« Reply #3 on: December 04, 2008, 02:22:42 AM »

Damned Code... Being Case Sensitive!! As An Addict Of Odd Casing Patterns It Hounds Me!! =P
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
Crowoner
February 25, 2009, 07:05:17 PM
lol i can't execute the program it gives me error CreateProcess Failed; Code 14001
February 25, 2009, 04:23:37 PM
or else test it on a ded and then do the same
February 25, 2009, 04:23:24 PM
download it and you can >.>
February 25, 2009, 04:21:37 PM
the server is rented i can't use hlsw
February 25, 2009, 04:09:53 PM
can you get the logs (with HLSW) when you say shopmenu2?
with eventscripts_debug 1 please :p
February 25, 2009, 04:04:15 PM
Yes it's all ok ... made es_load gold in autoexec all files are right as the tutorial of gold 0.4 says
no missing file I suppose as it's original
February 25, 2009, 04:01:04 PM
is it loaded well?
have you the "official" version?
no missing file? nothing else wrong?
Recent
[Today at 01:26:31 AM]

[Today at 01:24:52 AM]

[Today at 12:38:51 AM]

[Today at 12:34:28 AM]

[Today at 12:12:17 AM]

[February 25, 2009, 11:45:05 PM]

[February 25, 2009, 10:06:36 PM]

[February 25, 2009, 07:55:08 PM]

[February 25, 2009, 07:53:02 PM]

[February 25, 2009, 07:43:19 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.172 seconds with 26 queries.