.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Scenarios, Maps and Mods (http://forum.shrapnelgames.com/forumdisplay.php?f=146)
-   -   Spellbook script 0.2 (http://forum.shrapnelgames.com/showthread.php?t=32182)

B0rsuk December 6th, 2006 09:26 PM

Spellbook script 0.2
 
1 Attachment(s)
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)
<font class="small">Code:</font><hr /><pre>
python spellbook.py FFDNN
</pre><hr />

...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)

NTJedi December 6th, 2006 09:49 PM

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.

B0rsuk December 6th, 2006 09:56 PM

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.

Endoperez December 6th, 2006 10:23 PM

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.

B0rsuk December 8th, 2006 09:25 PM

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.

Horst F. JENS December 9th, 2006 10:51 AM

Re: Spellbook script (in progress) (Python) (fun!!
 
nice update. I start to like your program.


All times are GMT -4. The time now is 05:32 AM.

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