.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old December 6th, 2006, 09:26 PM
B0rsuk's Avatar

B0rsuk B0rsuk is offline
Second Lieutenant
 
Join Date: Mar 2004
Location: Gdansk, Poland
Posts: 420
Thanks: 0
Thanked 15 Times in 4 Posts
B0rsuk is on a distinguished road
Default Spellbook script 0.2

Hey

I'm developing a script, which allows you to see what spells can a specific mage cast without boosters. Without it, the game is unplayable unless you're willing to memorize all spells yourself. Manual is disappointing in this aspect. First working version is finished, but it's far from complete. But it's still very useful, and I encourage you to try it. Post suggestions for features here.
You're allowed to tinker with it, but do not dare to improve and post it here.. I'm trying to learn Python, don't spoil the fun for me !
----------

You need:
- Python interpreter
- basic ability to use commandline
- you might need a program to convert unix newline characters to windows ones if you insist running it with windows.
Don't complain, if I wanted to annoy you I'd use bash + grep + awk .

I attach two files. spellbook.py is the executable, necronomicon is the spell data file (only Evocation school for now). You can view source code and check it for malicious code. It's all open.

Put both files in the same directory. Then run spellbook.py with magic paths as parameter. For example (linux)
Code:

python spellbook.py FFDNN



...and you should get list of Evocation spells castable with these paths.
-------------
Todo:

- complete spell list, all other schools and holy, too.
- make simple mage list with few values, such as paths, gold cost(sacred?), randoms
- generate castable spell list for all nations and their mages. Output in plain text, html, laTeX
- ability to handle random paths (I intend to implement it by splitting one mage to a long list of path permutations, with probability/estimated cost next to each spell-mage.
- rewrite/cleanup using functions/methods for the sake of readability and flexibility
- nail the strange 'index out of range' bug (commented out)
Attached Files
File Type: zip 476628-spellbook0_2.zip (4.5 KB, 100 views)
__________________
Those who do not understand Master Of Magic are condemned to reinvent it - badly.
Reply With Quote
  #2  
Old December 6th, 2006, 09:49 PM
NTJedi's Avatar

NTJedi NTJedi is offline
General
 
Join Date: Jun 2003
Location: az
Posts: 3,069
Thanks: 41
Thanked 39 Times in 28 Posts
NTJedi is on a distinguished road
Default Re: Spellbook script (in progress) (Python) (fun!!)

Quote:
B0rsuk said:
Manual is disappointing in this aspect.
I completely agree... the way spells are listed in the manual should have been a decision by the whole community, not one individual.
__________________
There can be only one.
Reply With Quote
  #3  
Old December 6th, 2006, 09:56 PM
B0rsuk's Avatar

B0rsuk B0rsuk is offline
Second Lieutenant
 
Join Date: Mar 2004
Location: Gdansk, Poland
Posts: 420
Thanks: 0
Thanked 15 Times in 4 Posts
B0rsuk is on a distinguished road
Default Re: Spellbook script (in progress) (Python) (fun!!

That's not what I meant. There are LOTS of spells, some useful and some not, and the way paths and research schools interact means you spend a LOT of time trying to figure out which spells you can actually cast.
I hope to remedy this.
__________________
Those who do not understand Master Of Magic are condemned to reinvent it - badly.
Reply With Quote
  #4  
Old December 6th, 2006, 10:23 PM
Endoperez's Avatar

Endoperez Endoperez is offline
National Security Advisor
 
Join Date: Sep 2003
Location: Eastern Finland
Posts: 7,110
Thanks: 145
Thanked 153 Times in 101 Posts
Endoperez is on a distinguished road
Default Re: Spellbook script (in progress) (Python) (fun!!

The spells are listed by path. Fire 1, Fire 2, Fire 3... etc. AFAIK, it's the best way to find out just this kind of things. Chhecking three pages in the manual would probably give the same answers yous script does, unless it lets you only look through spesific schools.

In-game, this isn't that hard either. You can browse with 'f', 'd' and 'n' in all screens where spells are listed.

Your script does help those who don't appreciate the manual, but I've been using it extensively for a while now. IMO, it's great.
Reply With Quote
  #5  
Old December 8th, 2006, 09:25 PM
B0rsuk's Avatar

B0rsuk B0rsuk is offline
Second Lieutenant
 
Join Date: Mar 2004
Location: Gdansk, Poland
Posts: 420
Thanks: 0
Thanked 15 Times in 4 Posts
B0rsuk is on a distinguished road
Default Re: Spellbook script (in progress) (Python) (fun!!

I updated attachment in the first post.

New in version 0.2:
- spellbook.py renamed to pathspells.py
- code cleanup or obfuscation, depending on how you look at it.
- slightly different output by default
- new script: nationspells.py . At the moment just run it without any arguments. It will print you spells castable by each mage listed in mages data file. It works very well, but it doesn't take randoms into account at all.
- new data file: mages . So far, contains mages for Machaka, Ermor, Pythium, Arcoscephale, Man - all from middle era. Won't contain pure priests: waste of time, it's not hard to remember their spell list. But contains priest/mage hybrids. Note: the file has variable amount of columns, which may present a difficulty in parsing. Last optional columns are magic randoms. See for yourself.
- necronomicon data file updated: added Conjuration, Construction, and Holy spells. New column: battle/ritual.

Both data files are nicely grepable.

Basic functionality is alredy here. I'm especially proud from nationspells.py . It still needs a lot of work (randoms), but I think I'll focus on finishing data files now.

You need to put all the files in the same directory, because it's all hardcoded at the moment.
__________________
Those who do not understand Master Of Magic are condemned to reinvent it - badly.
Reply With Quote
  #6  
Old December 9th, 2006, 10:51 AM
Horst F. JENS's Avatar

Horst F. JENS Horst F. JENS is offline
Sergeant
 
Join Date: Oct 2003
Location: Vienna, Austria, Europe
Posts: 234
Thanks: 62
Thanked 11 Times in 6 Posts
Horst F. JENS is on a distinguished road
Default Re: Spellbook script (in progress) (Python) (fun!!

nice update. I start to like your program.
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 04:49 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.