SgtMe 46 Veteran Poster Featured Poster

Why don't you make like a text-based shopping checkout program? You can have a main class filled with all the main functions, like a welcome, ouput priter etc.
Then you can have an object class. It can have variables like name, price, quantity, etc. Then you can make new objects using the base class.

SgtMe 46 Veteran Poster Featured Poster

I think I heard that you have to sign up to the Apple Developer network to be able to distribute your apps. A good place to start is http://www.dragonfiresdk.com/index.htm
This is a windows C++ library. Two things you already have!

SgtMe 46 Veteran Poster Featured Poster

Have you looked in your site packages folder? (python/Lib/site-packages...). Are there any variations on how you can import it? (eg. import Tk/import Tkinter)

SgtMe 46 Veteran Poster Featured Poster

will if its mmo, you will do best keeping all the player data server-side, so that the players cannot access their own data. To stop people modifying all of your files, look at using file compresssion. Things like a .pk3 file (google it). These can be opened with programs and edited, but it does put a lot of people off. .p3k files are quite easy to open though, so think about using something else. You can also check if the player has added or removed any files to the game's directory tree. You can open the files that you use for maps, and check that they exactly match a server copy. There are lots more ways.

SgtMe 46 Veteran Poster Featured Poster
SgtMe 46 Veteran Poster Featured Poster

Is this just a normal game or an MMO?

SgtMe 46 Veteran Poster Featured Poster

I could be pretty much any language. Most likely this is just a list of strings. And no, you can't run a program from this. Seriously. Take more time to look at the code you want help with. Put in some effort. There is no way you can run this as a program. If that isn't obvious to you, you shouldn't be here.

SgtMe 46 Veteran Poster Featured Poster

Go to the Java forum and re-post this topic. Then tell them what the match events look like in notepad.

SgtMe 46 Veteran Poster Featured Poster

look...you need to provide more detail. What language are you using? What does the match events file look like? By link do you mean read?

SgtMe 46 Veteran Poster Featured Poster

Here's a brilliant site. I was confused when I started out, but this frankly BRILLIANT site helped me through.

http://lmgtfy.com/?q=python+documentation

^_^

SgtMe 46 Veteran Poster Featured Poster

http://www.pythonware.com/library/tkinter/introduction/
This is a great site for learning Tkinter it has example and well documented code.

SgtMe 46 Veteran Poster Featured Poster

I take it that you are using something like notepad to write the script and then you are just runnning the script through the python console straight off. There are several ways that I have been able to see errors. Print-screen can help sometimes, but not when the console is obscured by a window. There are some things that work for me that may not for you. For example, if I 'grab' and hold on to a PyGame/PyOpenGL window, it freezes the Python console whilst I have hold of it. If you still can't see it, then the only other way to do it would be to get an IDE. Netbeans is a great IDE for Python development. Just go on netbeans.org and download any one of the language specific IDE bases, and add Python as a plugin (PM me if you need help with this).

SgtMe 46 Veteran Poster Featured Poster

Thanks but I've solved it a different way :)

SgtMe 46 Veteran Poster Featured Poster

What problems are you having? What information do you need to find?

SgtMe 46 Veteran Poster Featured Poster

Say I have a file structure that looks like this

root folder/
    main.py
    -folder a
        -script.py
    -folder b
        -img.png

How could I load the img.png file from script.py?
Should I just have a function in main.py that gets the path of the root folder, and then tac the 'folder a' and 'folder b' bit on?

Thanks for your time.

SgtMe 46 Veteran Poster Featured Poster

C++ is definitely one of the top languages. It doesn't really matter what language you use, as long as you are good at it, and you can use it to create cross-platform games, if you want to distribute them or go commercial. From reading around, it seems that C# is the most frequently used these days, though you can be different.
Sorry but I can't really recommend you a book!

SgtMe 46 Veteran Poster Featured Poster

...and learn to post in the right forum

SgtMe 46 Veteran Poster Featured Poster

Unfortunately, PyGame is now being made for JavaScript. While you can still learn it now, there will be no support for major updates to Python in the future. While some versions of PyGame may work with updates to Python, there will not be full support. But hey, its awesome so let's use it while it's here.

SgtMe 46 Veteran Poster Featured Poster

That would be better overal, sergb, but I feel that GothLolita should start off using text-files. You can use this to have test data for testing your program, and add full databse support later.

SgtMe 46 Veteran Poster Featured Poster

Start by making a function that allows you to read and write the data from/into text files.

SgtMe 46 Veteran Poster Featured Poster

Sorry Tony, I got distracted after I started writing a reply and your post didn't show up until I had added mine!

SgtMe 46 Veteran Poster Featured Poster

Here is an example. Remember that after reading from a text-file, (if you read the whole line) you may get newline characters ("\n"). Also, you need to remove the spaces.

n = '$ 235.0 M'            #Example string
n = n.strip('$M ')         #Cut off the chars - including spaces!
n = float(n)               #Must convert to int because of the '.0' ('235.0')
##################
print n * 2                #Just to test if it works

Enjoy

SgtMe 46 Veteran Poster Featured Poster

your tutor is harsh

SgtMe 46 Veteran Poster Featured Poster

Sorry, but the link wasn't much help. I used to use C++ but I gave it up in favour of python a while ago. I suppose that you could take the base ideas and code from that and add in your own functionality.

SgtMe 46 Veteran Poster Featured Poster

Can you post a link to the tutorial?

SgtMe 46 Veteran Poster Featured Poster

erm...sorry im not getting your last post? What is the x and y of? or are x and y the values that you will use to make an array for your map?

SgtMe 46 Veteran Poster Featured Poster

It will be much simpler to do it this way:
1. Your map is in a text file and consits of numbers.
2. Your program will load this data into an multi-demisional array.
3. It needs to interpret the numbers as different object. (eg. 0 = nothing, 1 = block)
4. You need to have drawing and updating functions for sprites that you can use each time that sprite appears (no matter where)

SgtMe 46 Veteran Poster Featured Poster

Are you using arrays to make data that you can be turned into a map by your program?

SgtMe 46 Veteran Poster Featured Poster

Here is one of the problems.
I copied your program into notepad (correct indentation) and made the two appropriate gif images. I save the problem as a python script and ran it. It opened, drew, and then closed. The reason for this is that you only run through one cycle of updating and drawing the screen. You need to make a 'while loop'. This keeps the statements inside the loop repeating (in the order that they are in) until the 'while' conditions are not met. Using 'while 1' will give you an infinite loop. Inside the loop, you have the statements you want to carry out, but at the end you need to pause your program for a few milliseconds so that it does not crash from running too quickly for your hardware.
Here is what you need to do. Fill the code in in the right places...it should be simple enough ;)

while 1:
	<Clear screen> #use screen.fill((RGB))
	<Update> #Call all update events for all sprites
	<Draw> # Call all draw events for all sprites and draw background.
	<Pause> # use pygame.time.wait(milliseconds). 10-20milliseconds should be good. Try more if not.

Drop the new code lines in place of the 'o.update' and 'o.draw' lines

Just ask if you need more help

SgtMe 46 Veteran Poster Featured Poster

its just a test texture BTW ;)

SgtMe 46 Veteran Poster Featured Poster

I have finally managed to make some progress on PyOpenGL textures. Now I have another problem.

Here is my OpenGL init function (its in a script called gl2D.py:

def init():
	glEnable(GL_BLEND)
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
	glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE)
	glEnable(GL_TEXTURE_2D)
	glShadeModel(GL_SMOOTH)
	glClearColor(0.0, 0.0, 0.0, 0.0)
	glDisable(GL_DEPTH_TEST)
	glEnable(GL_ALPHA_TEST)
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
	glAlphaFunc(GL_NOTEQUAL,0.0)

And here is the main program:

from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import gl2D #Includes my init func

def loadImage(image):
	pygame.init()
	pygame.display.init()
	pygame.display.set_mode((640, 480), OPENGL|DOUBLEBUF)
	gl2D.resize((640, 480))
	gl2D.init()
	textureSurface = pygame.image.load(image)
 
	textureData = pygame.image.tostring(textureSurface, "RGBA", 1)
 
	width = textureSurface.get_width()
	height = textureSurface.get_height()
 
	texture = glGenTextures(1)
	glBindTexture(GL_TEXTURE_2D, texture)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, textureData)
	return texture, width, height

tex = loadImage('tex.bmp')
glBegin(GL_QUADS)
glTexCoord2f(-0.2, -0.2)
glVertex2f(-0.2, -0.2)
glTexCoord2f(-0.2, 0.2)
glVertex2f(-0.2, 0.2)
glTexCoord2f(0.2, 0.2)
glVertex2f(0.2, 0.2)
glTexCoord2f(0.2, -0.2)
glVertex2f(0.2, -0.2)
glEnd()
pygame.display.flip()
pygame.time.wait(1000)

If u look at the attatched images, you will see the texture, and the output...you should be able 2 tell which is which ;)

Help appreciated.
Thanks
Mark

SgtMe 46 Veteran Poster Featured Poster

Hi.

I am trying to get texturing to work in PyOpenGL in 2D. I have the following code so far for textures:

def tex(path):
    img = pygame.image.load(path)
    img.convert_alpha()
    try:
        ix, iy, image = img.get_width(), img.get_height(), pygame.image.tostring(img, 'RGBA')
    except SystemError:
        ix, iy, image = imgs.get_width(), img.get_height(), pygame.image.tostring(img, 'RGBA')
    ID = glGenTextures(1)
    glBindTexture(GL_TEXTURE_2D, ID)
    glPixelStorei(GL_UNPACK_ALIGNMENT,1)
    glTexImage2D(GL_TEXTURE_2D, 0, 3, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, image)
    return ID

This is in an external script that I call from my programs, and it produces the following error:

Traceback (most recent call last):
  File "<PATH>", line 39, in <module>
    Main()
  File "<MY_PATH>", line 20, in __init__
    self.menu()
  File "<MY_PATH>", line 23, in menu
    glGenTextures(1, glTex2D.tex('start.png'))
  File "<MY_PATH>", line 16, in tex
    glTexImage2D(GL_TEXTURE_2D, 0, 3, ix, iy, 0, GL_RGBA, GL_UNSIGNED_BYTE, image)
  File "C:\Python26\lib\site-packages\OpenGL\latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "C:\Python26\lib\site-packages\OpenGL\wrapper.py", line 791, in wrapperCall
    raise err
OpenGL.error.GLError: GLError(
        err = 1281,
        description = 'invalid value',
        baseOperation = glTexImage2D,
        pyArgs = (
                GL_TEXTURE_2D,
                0,
                3,
                270,
                100,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                '\xff\x00\x00\xff\xff\x00\x00\xff\xff...,
        ),
        cArgs = (
                GL_TEXTURE_2D,
                0,
                3,
                270,
                100,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                '\xff\x00\x00\xff\xff\x00\x00\xff\xff...,
        ),
        cArguments = (
                GL_TEXTURE_2D,
                0,
                3,
                270,
                100,
                0,
                GL_RGBA,
                GL_UNSIGNED_BYTE,
                '\xff\x00\x00\xff\xff\x00\x00\xff\xff...,
        )
)

Please can somebody help me with this.
Thank you very much for yoru time.
Mark

SgtMe 46 Veteran Poster Featured Poster

, but these were

SgtMe 46 Veteran Poster Featured Poster

It's very hard to read an excel file, but you could try reading an Excel XML file.

SgtMe 46 Veteran Poster Featured Poster

I'm not really sure. I think C# would be a good language to use in the long run if you plan to become a paid games programmer, but then Flash is great for publicity as you said. I am trying to learn Actionscript 3 right now, but I'm having trouble finding a decent tutorial that's not made in Flash CS, because I use FlashDevelop. If you chose Flash, would you be prepared to buy Flash CS? If not, check out this:
http://www.daniweb.com/forums/thread280530.html

It might be best to start with Flash and acquire an audience, then maybe convert some of your flash games into XBLA games later.

Good luck in whatever you do.
Mark

nsutton commented: I love you. +1
SgtMe 46 Veteran Poster Featured Poster

So yah...you go learn AS3?

SgtMe 46 Veteran Poster Featured Poster

Oh and let me know how your doing with Python ;)

SgtMe 46 Veteran Poster Featured Poster

the anser is: I don't really know! You'll just have to google around and find out what you can do. The answer is that you can probably do anything that you can in Flash CS, but in AS3 code. Not sure what you mean about "outside the IDE though".

SgtMe 46 Veteran Poster Featured Poster

OK...follow these steps very carefully:

1. Download the FlashDevelop IDE here

2. Download the debuggers: here and here

3. Download the Adobe Flex 4 SDK here

4. Extract the Flex SDK to somewhere like "C:\FlexSDK" and install the debuggers.

5. VERY IMPORTANT! Go to "<SDK location>/frameworks/libs/player" and make a new folder called 9.0 (if there isn't already). If there is a folder there already, check that there is the following file: "playerglobal.swc". If not, download it here. Copy "playerglobal.swc" from inside the zip into the new folder ("<SDK location>/frameworks/libs/player/9.0").

6. Open up FlashDevlop. On the toolbar click "tools" --> "program settings". Under AS3 context, under language, there should be a field for the FlexSDK location. This is just where you extracted the SDK zip (eg. "C:\FlexSDK").

7. Make a new AS3 project, write some AS3 code and click on the toolbar: "Project" --> "Test Movie".

8. When your finished click build to generate all the required files.

Enjoy!
Mark

<Rushes off to learn some AS3>

PS. If you have any problems regarding set-up, just ask me. I am trying to remember these steps from abotu 10 mins ago, but I wasn't taking it all in, so it might be wrong. However, I'm pretty sure I've covered everything.

SgtMe 46 Veteran Poster Featured Poster

there are a few cheap flash alternatives...unfortunately, in this case, they are free for a reason. Swish Max is probably the best alternative I have seen, but I'm not sure whether you can make games on it or if it's just animations...hey i've just found flashdevelop.org...im gonna check it out

SgtMe 46 Veteran Poster Featured Poster

I have recently purchased ToCA Race Driver 3 for my PC. I used systemrequirementslab.com to check that it would work, and the only issue that came up was that Windows 7 was not released at the time and it was not officialy compatible. I found this website and I followed the instructions, and the game worked perfectly:

http://www.gog.com/en/forum/toca_race_driver_3/unable_to_start_on_on_windows_7/_/1

(THE SECOND BIT AFTER THE DLL IS ON THE SECOND PAGE! IT IS THE FIXED EXE BIT!)

I can install and run the game perfectly. However, Windows says that it can't use one of the drivers and has to remove it because it has no digital signature (StarForce, I think).

When I boot my computer up, Windows says that it could not start correctly, and that it is searching for a solution or something. It finds a solution and says that it is fixing it. Then, I have to restart my computer, and everything is fine. But ToCA 3 has been "uninstalled". I put it in qoutes because it's not complete removal. The icon has gone from my desktop and I'm pretty sure that there's no registry value any more.

I am running Windows 7 Home Premium 64-bit.

Can anyone please help me?
Thanks very much for your time.

SgtMe 46 Veteran Poster Featured Poster

OK soda...it's just easier for installing other packages...you can use many compilers, not just one ;)

SgtMe 46 Veteran Poster Featured Poster

What programming language are you intending to use? decide then post in the forum for that programming language.

SgtMe 46 Veteran Poster Featured Poster

Erm...VC++ 2010 is good, but it's not dev-c++. Anyway I don't know much about OpenGL, just what's in my above post. Oh...this should be in the C++ forum BTW

SgtMe 46 Veteran Poster Featured Poster

Windows has "stuff" for running programs using OpenGL. It does not have anything on it for creating software with OpenGL. I tried out codeblocks but I didnt like it, so I switched to using dev-c++. You should do this to. This is because it has a package manager, where you choose what libraries you want to download and it installs them in the right place for you. Ask if you need any help!

SgtMe 46 Veteran Poster Featured Poster

Never mind! solved it...just converted the minute/hour/second values to float and divided by a float in the rotation bit.
Thanks again!

SgtMe 46 Veteran Poster Featured Poster

That bit works fine. But now how do I solve the problem of the fact that Python thinks that 7/12 = 0? This is the part of your code where the rotation is calculated.

SgtMe 46 Veteran Poster Featured Poster
(as a ratio), for example30 seconds = 1/2 minute, so you would put .5 for the rotations

So basically it's the mins over total minutes for the rotations?
Thanks for that!

PS
@jcao219: Yes I', confident with maths, and trig.
@tonyjv: No, not that confident ;)
"lol" is the term I think...

SgtMe 46 Veteran Poster Featured Poster

Hi.
I'm just trying to make a simple analogue clock as I learn to use TKinter with python. I need to know the maths behind calculating the x, y values for drawing the end of the hands.

I don't need to post the whole program, all you need to see how I've done what I've got of the stuff you need to know (draws breath), is right here:

- I'm using the 'datetime' module for getting seconds, minutes and hours

- Have a canvas of size (300, 300) inside a window also (300, 300)

- The clock circle bounding box is (5, 5, 295, 295)

- I want to draw the hands as different lengths, so not quite as far as the edge of the clock circle.

- Hands originate from (150, 150)

- I only need to know how to calculate the end x and y values for the hands (eg. [origin_x, origin_y, end_x, end_y)

Thanks for your time!

SgtMe 46 Veteran Poster Featured Poster

is this just distribution of an .exe or source code? or is it meant to be buit in to a web-page? what language is it written in?