I'm making an RPG, and am trying to split things up into multiple files to organize things better. (I mean, character creation alone was over 2000 lines.) But this is something that I've never done, and I'm really not sure how to do it. So, if I could get some general advice on how to set things up efficiently, etc. I would really appreciate it. I really haven't been able to find much on the subject, other than the page about modules on the python website, which I did read, but I'm still a little unclear about it. This is definitely the most confusing, least talked about, thing I've come across so far in programming... and I do hate asking vague questions like this, but I'm definitely not making any progress on my own, so I'm hoping one of you can put me on the right path.


I'll also give one specific example.

I'm wanting to put all of the character's stats and skills into one or two lists, so I can more easily use them with functions, and I have no clue how to use a list from another file as an argument for a function. This is what I've tried, and it seems like it should work. I'm importing this file into CharacterCreation, and then just using "StatCalculations.LevelUp(PLAYERSTATLIST)", but it says "'module' object has no attribute 'LevelUp'".

What am I doing wrong?

from CharacterCreation import BaseHEALTH, BaseMANA, BaseSTAMINA, BaseCAPACITY, BaseDEFENSE, STRENGTH, ENDURANCE, AGILITY, INTELLIGENCE, PERSONALITY, BaseSTRENGTH, BaseENDURANCE, BaseAGILITY, BaseINTELLIGENCE, BasePERSONALITY, PLAYERLEVEL, PLAYERNAME

def LevelUp(*PLAYERSTATLIST):
    HEALTH = BaseHEALTH + ( ENDURANCE / 2 ) + ( STRENGTH / 5 )
    MANA = BaseMANA + INTELLIGENCE + ( ENDURANCE / 10 )
    STAMINA = BaseSTAMINA + ( STRENGTH / 5 ) + ( ENDURANCE / 5 )
    CAPACITY = BaseCAPACITY + ( STRENGTH / 5 ) + ( ENDURANCE / 10 )
    DEFENSE = BaseDEFENSE + ( ENDURANCE / 10 ) + ( AGILITY / 10 ) + ( STRENGTH / 10 )
    PLAYERSTATLIST = [HEALTH, MANA, STAMINA, CAPACITY, DEFENSE, BaseHEALTH, BaseMANA, BaseSTAMINA, BaseCAPACITY, BaseDEFENSE, STRENGTH, ENDURANCE, AGILITY, INTELLIGENCE, PERSONALITY, BaseSTRENGTH, BaseENDURANCE, BaseAGILITY, BaseINTELLIGENCE, BasePERSONALITY, PLAYERLEVEL, PLAYERNAME]
    return PLAYERSTATLIST

hey do u need help with this game? I have probably a little more experience than you with python judging by your post and Im bored :) private message me

Edited 5 Years Ago by ret801: n/a

This article has been dead for over six months. Start a new discussion instead.