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:11:31 AM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Hall of Fame
Must Visit it
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: (Yet another!?) WCS-Python  (Read 324 times)
Brett
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 156



WWW
slasher123
« on: January 10, 2009, 11:31:00 PM »

Much respect to both freddukes and Jeff91 for their amazing python version of the WCS script. I started looking through it, though, and found myself quite confused. I guess I still have a lot to learn.

Anyways, I've been bored lately so I decided to write my own version of WCS in python. I chose to take a more object oriented approach for ease of use and performance optimization. I noticed that, prior to the release of Jeff's script, there really wasn't much discussion about it. I want to give everyone the chance to offer their input on what they think should be in my script, and the directions they think I should take it. Furthermore, I want to extend an invitation to anyone interested in joining me. I'm doing this mostly for the fun of coding a project, and to improve my proficiency with the Python language.

So, now on to the good stuff... I started work on this script on December 29th. Since then, I've managed to throw together a very basic working copy. Many features are missing, but the core of the mod is present at just 653 lines. I also set up a google code project so I'd be able to track my progress, and so I can invite other people to become collaborators.

I realize I could have waited a few more weeks to polish the program and add more features, but I feel like it would be much more fun to work with someone on this, than to do it alone. I am not claiming this will be better than Jeff's version, and it probably won't even be as good as it. Jeff is an exceptional python coder from what I've seen, and so is freddukes. However, I do think that this could be a lot of fun for everyone, and should be a pleasure to use once it's been completed.

You can check out a semi-working copy on my server at: 72.167.163.59:27015

You can check out the google code project at http://code.google.com/p/css-wcs/
(either download the zip file from the downloads tab, or use your favorite svn client to pull it straight from the repository)

On that note, I open the floor to questions/comments!
Logged

Brett
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 156



WWW
slasher123
« Reply #1 on: January 11, 2009, 01:29:37 AM »

Gonna keep this post for features I want to implement. I could keep them local, but putting them here should give people a chance to offer their input.


-Compiled Races
After reading about this race-stealing drama, I think having compiled races would be a good idea. This would make it much more difficult to steal a race.
Logged

WCA | Berettonawak [FR]
Watchdogs
Level 7 Expert
*****
Offline Offline

France France

Posts: 1644


Big Berettonawak is watching you...



Bifkids

myServer 81.93.251.44:27015
(Warning: click connects through Steam)
« Reply #2 on: January 11, 2009, 12:34:31 PM »

Well, i think the best way of making a stable Python WCS would be just translating the shell version (instead of rewriting all by yourself).
And i don't think pyc races would be good... i hate guys who can't share their work Tongue

Would there be still a way to write races in Keygroups (like in jeff's wcs?)?
Logged


MY INTERNET:
Brett
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 156



WWW
slasher123
« Reply #3 on: January 11, 2009, 07:17:31 PM »

Yeah, in its current state it loads all of the keygroup races (at least the ones included with the latest WCS-ESS release). I still haven't come up with a new race format.

The problem with just rewriting the current mod in python is that the current mod isn't structurally designed to take advantage of the constructs of python. In my opinion, neither is Jeff/freddukes. The one I've been working on takes the most possible advantage of object oriented programming to keep code to a minimum and information easily accessible. Having to iterate through long dictionaries takes a while. When you have a class instance holding those variables, I believe it's easier for the processor to find the information it's looking for.

Don't take my word for it. Head to the google code project and download a copy of the zip, or just use your favorite svn client to pull the trunk. I think you'll find that the code is extremely easy to understand, especially if you are using PSPad and have enabled the code explorer (Ctrl+Shift+E)
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 #4 on: January 14, 2009, 07:09:33 PM »

Race-categories would save epople tons of time Smiley
Logged

freddukes
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 287



« Reply #5 on: January 21, 2009, 03:37:34 PM »

Nice work.. Have you seen this warcraft source python?. That is structured heavily upon OO....

IMO I think our mod meets it right (it relies heavily upon OO, yet it doesn't have a class for every little detail). When you consider:
- each race is it's own object (two if you consider the fact that they each have an object for configuration)
- each player is their own object
- the admin menu is it's own object
- the effects are their own object
- The shopmenu is it's own object

I didn't think it was necessary to make "every item" it's own object as it doesn't need to be.. It has 2 attributes and 1 function... Making it it's own object would make it "bloated" and unnecessary for such an easy task.

I believe writing everything as it's own object is unnecessary, and you must first consider what needs to be done.. Looking at your code it looks a mix between our version and bombcode's... It looks not as "user friendly" (messing with classes isn't exactly user friendly).

That's just my 2p

You've done a great job (I especially like the sqlite, I was going to do it but I felt it would be slightly difficult the way we've set it up), just remember not to go class savvy and create a new class for every little object Smiley

-freddukes
Logged

Raynos
Level 7 Expert
*****
Offline Offline

United Kingdom

Posts: 161



« Reply #6 on: February 17, 2009, 02:05:08 AM »

Hey, ive used your version of ESP wcs as a base for my mod, mainly the way you save data to the sql db and how you store it a dict called player_data temporarely.

It all works fine, for now, ive had to edit various gaps you left, but i have a horrible error,

"KeyError '2'" for example when my userid is 2,

this error means it doesnt read my userid properly and hence all events dont trigger because it doesnt read my userid, the only fix i have is reinstalling the mod resetting all data,

Im not sure if this is an error with ES itself, or the database or the mod, but i can't seem to iron it out,

My question is have you seen this error in your own mod and know where the problem lies?

Rayy
Logged
freddukes
WCS ESP Dev Team
Level 7 Expert

Offline Offline

United Kingdom

Posts: 287



« Reply #7 on: February 18, 2009, 09:07:18 AM »

It means somewhere along the line your userid has not been added, or been removed from the database and it tries to read it without checking if your userid exists first

-freddukes
Logged

Raynos
Level 7 Expert
*****
Offline Offline

United Kingdom

Posts: 161



« Reply #8 on: February 18, 2009, 10:28:31 AM »

i checked the db manually, the userid exists,

The only thing i can think of that somehow it changed the userid into a string and hence bugs out, ive thrown a whole bunch of int()'s in to hopefully make the bug dissapear,

if that fixes it im happy Smiley

if it doesnt you'll hear from me again
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.072 seconds with 26 queries.