SFRPG

The forum for Science Fiction Role Playing Game inspiration and information! So Say We All!
It is currently Fri Dec 15, 2017 3:58 pm

All times are UTC




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed May 31, 2017 1:49 pm 
Offline
User avatar

Joined: Thu Jul 03, 2008 5:41 am
Posts: 2153
Location: Yavne, Israel
As you may have seen from my previous threads, I am slowly teaching myself Python 3 by writing various RPG-related scripts, primarily for Traveller (or the Cepheus Engine).

I am intermittently working on my sector generator, but now am trying my hand at a character generator. This is a very useful project, as it allows me to experiment with Object-Oriented Programming. This is my FIRST EVER EXPERIENCE with OOP, and so far is going very well; I have already learned about Inheritance.

I also learned quite a lot about Dictionaries from dealing with the skill list.

The main concept is this is a super-class called Career which has all the chargen methods, then a specific career class which inherits from it and sets the career values (enlistment, survival, skill lists, etc), then the character himself who is also a class and inherits from the specific career class.

All classes except for the character itself will be in a "library" py file, with the program's "mechanics" (the generation process itself, saving to file, etc) being in the "main" py file.

Very enjoyable and educative so far!

_________________
We are but a tiny candle flickering against the darkness of our times.

Stellagama Publishing - Visit our Blog, Den of the Lizard King


Top
   
PostPosted: Wed May 31, 2017 4:17 pm 
Offline
User avatar

Joined: Mon Dec 02, 2013 1:43 pm
Posts: 294
Location: Queens, NY
I'm about to head to the library to pick up a copy of Learn Python the Hard Way that I placed on hold! Hopefully I can find some RPG-related opportunities to practice what I learn.


Top
   
PostPosted: Wed May 31, 2017 7:02 pm 
Offline
Administrator
User avatar

Joined: Thu Jul 03, 2008 1:22 am
Posts: 5296
that's pretty much how I learned what I know of Python too :). Though I'm not quite so advanced as to know how Lists and Dictionaries work.

_________________
SFRPG Owner/Admin
This post (or any other post I made here) may not be quoted or copied beyond the SF RPG boards without my explicit permission.
Check out the latest news from Spica Publishing!
evildrganymede.net - visit the The Worldbuilding Hub, and check out my Science Blog!


Top
   
PostPosted: Wed May 31, 2017 8:19 pm 
Offline
User avatar

Joined: Thu Jul 03, 2008 5:41 am
Posts: 2153
Location: Yavne, Israel
Lists and Dictionaries become two of your most powerful programming tools once you learn how to use them properly. They save you SO MUCH work and excess code.

_________________
We are but a tiny candle flickering against the darkness of our times.

Stellagama Publishing - Visit our Blog, Den of the Lizard King


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited