08 Aug, 2010, GhostInAProgram wrote in the 1st comment:
Votes: 0
Thanks to everyone who has been helping me and believe me it's starting to pay off!

Okay I understand what people are trying to say, but I need more help on arrays (if I remember correctly that's what I'm using to store my data in).

I thought making a data structure was to make a class so I did:
class rooms():
def createroom(self, name, exits, description):
self.name = name
self.exits = exits
self.description = description
def exits(self):
print "(Exits: %s)" % self.exits
def description(self):
print "' %s '" % self.description
def name(self):
print "<%s>" % self.name

Which of course is false.

What is an array, how do I use them to manipulate movement, and how do I store data in them?

Thanks in advance.

-Ghost
08 Aug, 2010, Cratylus wrote in the 2nd comment:
Votes: 0
GhostInAProgram said:
What is an array, how do I use them to manipulate movement, and how do I store data in them?

Thanks in advance.

-Ghost


You really, really need to get a codebase in your favorite language, and read it until your eyeballs bleed.

Modify it until you understand why it is as it is.

The steps dont need to be in order.

But you are essentially asking for a programming-in-pythin tutorial.

Get a pythen codebase, get a pythan how-to, and get busy.

GhostInAProgram said:
What is an array

http://www.brpreiss.com/books/opus7/html...
http://effbot.org/zone/python-list.htm

GhostInAProgram said:
how do I use them to manipulate movement

http://en.wikipedia.org/wiki/Mu_(negativ...

GhostInAProgram said:
and how do I store data in them?

http://www.brpreiss.com/books/opus7/html...
http://effbot.org/zone/python-list.htm

-Crat
http://lpmuds.net
08 Aug, 2010, Kjwah wrote in the 3rd comment:
Votes: 0
You need to listen to what Crat is saying. Unless you have previous experience with programming, it's going to be a long and boring road. Not to sound like a douche but you'll more then likely quit learning how to program in all seriousness.

Grab a copy of NakedMUD and start to modify. It'll be good experience for you as it's core is written in C and then has Python embedded. You get to kill two birds with one stone. The C experience will come in handy because in the future, you may need to write some routines in C for performance issues when dealing with Python. :D

At least, that's my suggestion. :D
09 Aug, 2010, Chris Bailey wrote in the 4th comment:
Votes: 0
My personal opinion of how you should enjoy your hobby aside… I believe I already explained how you could use a multidimensional array to track player movement. It's like a coordinate plane, each position in the plane is populated with a room object. Each in game object can store a set of coordinates that specify which position (room) on the coordinate plane (2d array) that they reside in. Am I not making any sense? Do you have a more specific question?


EDIT: This is certainly not an ideal solution, but I used it in the past and it turned out to be a good learning experience. I believe it's a good simple place to start.
09 Aug, 2010, Runter wrote in the 5th comment:
Votes: 0
When I learn a new language I spend a week or two reading material and working on simple stand alone problems before I ever jump into a relatively big project.

Thus spending of literally 10's of hours may be boring but its simply the fastest road to competency. Also you don't have the fundamentals of programming down as concepts if you ask what an array is. These are questions anyone can google search and get answers that apply to all languages instantly.

If I sound mean I apologise. I simply want you to understand that programming is hard and there's no magic bullets. Jumping in this proverbial water is foolish.
09 Aug, 2010, Chris Bailey wrote in the 6th comment:
Votes: 0
They are all correct Ghost. I've learned entirely by doing and have hardly done any real reading or research. It is very difficult for me to do a lot of things because of that. =)
09 Aug, 2010, Ssolvarain wrote in the 7th comment:
Votes: 0
They're forgetting about the Montage approach, but I don't think it applies here.
09 Aug, 2010, chrisd wrote in the 8th comment:
Votes: 0
GhostInAProgram said:
Thanks to everyone who has been helping me and believe me it's starting to pay off!

Okay I understand what people are trying to say, but I need more help on arrays (if I remember correctly that's what I'm using to store my data in).

I thought making a data structure was to make a class so I did:
class rooms():
def createroom(self, name, exits, description):
self.name = name
self.exits = exits
self.description = description
def exits(self):
print "(Exits: %s)" % self.exits
def description(self):
print "' %s '" % self.description
def name(self):
print "<%s>" % self.name

Which of course is false.

What is an array, how do I use them to manipulate movement, and how do I store data in them?

Thanks in advance.

-Ghost


You are trying to write a MUD in Python. The code you posted above indicates that you are not familiar with the basics of that language. You should learn the language before you start trying to write your MUD. I highly recommend the following tutorial:
Non-Programmer's Tutorial for Python 2.6
Once you have completed that tutorial (it took me about 8 hours with no prior experience), the following book should prove quite useful:
Dive Into Python

Upon gaining a decent understanding of the Python programming language you will be able to start writing small scripts and modules for codebases such as NakedMUD. I strongly recommend that you use NakedMUD if you are interested in using Python - an entire game can be written in Python using NakedMUD. If you need help, NakedMUD has an active and helpful community but put some effort into actually learning the language you're trying to write a MUD in first.
0.0/8