Newbie Python (Game) Programming Question

Tina bad_addy at no_domain.com
Tue Mar 16 21:38:13 CET 2004


Hi,

I was wondering if there is a way to insert dynamic program code as data.
For some reason I'm thinking Python does this. But I may be confused with
another language or the article itself. I do think I could do this calling
Python thru C, but that seems a bit clunky.

I'm including some of my code to learn stuff as well in case there's a
better way to do things then how I currently am.

The program is a simple RPG character creator. (In this case from the
Stormbringer 4th Ed RPG) In this, each character has a nation they hail
from with attribute modifiers. These mods are listed under each nation as:

d100 to determine nation, nation name, 
[att # to mod, # of dice, die type, final static bonus]

The problem is there's a bunch of "what if's" that are comming up. Not only
for the nation list, but especially the character background list which is
different for most nations and based on different attributes mixed with
rolls. My initial thought is to include this list as a sub-list within the
main nation list.

One "what if" is for Myrrhyn women to have +1d6 CHA. Now I could put this in
the main code but I'm trying to make the basic generator as generic as
possible for re-use.

Any help is appreciated!

Tina

stats = ["STR","CON","SIZ","INT","POW","DEX","CHA"]

nation = [
  [2,"Melnibone",3,1,10,0,4,2,6,0,2,0,0,3],
  [5,"Pan Tang",3,1,8,0,4,1,8,0,2,0,0,1],
  [8,"Myrrhyn",3,1,6,0,4,1,6,0],
  [11,"Dharijor",1,1,4,0],
  [16,"Jharkor",5,1,4,0,6,1,-4,0],
  [24,"Shazaar",1,1,6,0],
  [29,"Tarkesh",1,1,4,0,2,0,0,-1],
  [37,"Vilmir"],
  [44,"Ilmiora",6,1,4,0],
  [49,"Nadsokor",1,1,6,0,6,1,-6,0],
  [56,"Weeping Waste",0,1,6,0,1,1,6,0,2,0,0,-1,5,1,4,0,6,1,-4,0],
  [60,"Eshmir",2,0,0,-2,3,1,4,0,4,1,6,0],
  [67,"Island of Purple Towns",0,1,4,0,1,1,6,0],
  [74,"Argimiliar"],
  [81,"Pikarayd",0,2,4,0,2,0,0,+1],
  [88,"Lormyr",3,1,-4,0,2,0,0,+2],
  [95,"Filkhar",5,1,4,0],
  [97,"Oin",1,1,6,0,3,1,-6,0,4,1,-6,0,5,1,-6,0],
  [99,"Yu",0,1,6,0,1,1,6,0,3,1,6,0,4,1,-6,0,6,1,-6,0],
  [100,"Org",0,1,4,0,1,1,8,0,2,0,0,-2,3,1,-6,0,4,2,-4,0,5,1,-6,0,6,2,-4,0]
 ]




More information about the Python-list mailing list