Tutorial: Online Multiplayer with PodSixNet

Post your own tutorials, guides and demos.

Post » Sun Aug 15, 2010 6:57 pm

Ok, so it is probably not a bug in Construct's Python implementation. If the exe's don't work (which I properly included StringIO and everything else) then it is a problem with your computer system's config.

You should never have to copy and paste StringIO.pyc or any other PYC into the directory.. that is why they are checked when building the executable. It sounds like you have Tulamide's exact problem.

If we can get enough people trying this out and getting the same error maybe we can troubleshoot what the problem is. To my knowledge only you and Tulamide have had this problem... so it is so rare we can't figure out what is wrong. It is some type of path problem where it isn't finding the Python library properly (since it worked when you ran it within Construct).
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Mon Aug 16, 2010 11:07 am

This is very strange. I uninstalled python and all the python addons i had. Still the same error. It seems to be looking in the wrong place for these libs... It works fine on my laptop (which never had python installed).

Maybe there is some python reference lurking in the registry?

EDIT - I made a game that was just "Sprite.X += 1" and it works when i preview in construct, but doesn't work when exported. I get the same error (regarding StringIO). what is happening to my life?

EDIT2 - Simple python program above works if i put it in the construct/data/python folder and put the python26.dll there too. However, the podsixnet stuff still doesn't work if i put it there.

EDIT3 - Put the simple python program in the Doc & Setting/Alee/Application Data/Scirra folder. Doesn't work still - however the Temp.exe file DOES WORK. They should be the exact same file surely?! But they are different sizes (Temp.exe is 709KB, pythontest.exe is 905KB) What is going on...
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Mon Aug 16, 2010 9:22 pm

[quote="alee":3hjevr7k]This is very strange. I uninstalled python and all the python addons i had. Still the same error. It seems to be looking in the wrong place for these libs... It works fine on my laptop (which never had python installed).

Maybe there is some python reference lurking in the registry?

EDIT - I made a game that was just "Sprite.X += 1" and it works when i preview in construct, but doesn't work when exported. I get the same error (regarding StringIO). what is happening to my life?

EDIT2 - Simple python program above works if i put it in the construct/data/python folder and put the python26.dll there too. However, the podsixnet stuff still doesn't work if i put it there.

EDIT3 - Put the simple python program in the Doc & Setting/Alee/Application Data/Scirra folder. Doesn't work still - however the Temp.exe file DOES WORK. They should be the exact same file surely?! But they are different sizes (Temp.exe is 709KB, pythontest.exe is 905KB) What is going on...[/quote:3hjevr7k]

That's exactly, and I really mean exactly, what happens to me too.
When selecting the .pyc modules, are they meant to be stored in the exe? When I export to exe, neither is the .dll copied to the folder (although Construct says so) nor are there any .pyc files.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 17, 2010 1:17 am

[quote="tulamide":a4gtmx5a]When selecting the .pyc modules, are they meant to be stored in the exe? [/quote:a4gtmx5a]
Yes, every .pyc module you select are stored in the exe. That message about the python26.dll being copied is wrong... I've asked for months for it to be fixed.. maybe someday the devs will. :-)

This a very weird problem. We need more examples of what works and doesn't work to nail it down. I just tried .99.92 and built up the chat client/server and they run fine on my laptop with Python 2.5 on it.

Do you by chance have values stored in your PATH or PYTHONPATH that could be causing this? Usually you do not need to have a PYTHONPATH variable.

Have you tried unziping the distributables.zip in the same directory? Although, that doesn't help with the stringio error.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Tue Aug 17, 2010 1:04 pm

[quote="scidave":28gba096]
Yes, every .pyc module you select are stored in the exe. That message about the python26.dll being copied is wrong... I've asked for months for it to be fixed.. maybe someday the devs will. :-)

This a very weird problem. We need more examples of what works and doesn't work to nail it down. I just tried .99.92 and built up the chat client/server and they run fine on my laptop with Python 2.5 on it.

Do you by chance have values stored in your PATH or PYTHONPATH that could be causing this? Usually you do not need to have a PYTHONPATH variable.

Have you tried unziping the distributables.zip in the same directory? Although, that doesn't help with the stringio error.[/quote:28gba096]
I think that at least for alee and myself the issue might simply be that either no .pyc are stored in the exe or somehow they get ignored. An example why I think so:
1) I export to exe
2) I create a folder in a randomly chosen place
3) I move the exe to this folder and copy the python dll to it

If I start the exe at this moment all I get is an error, saying something was going wrong but without stringsIO it can't tell me what. But exactly that (stringsIO mising) is what was going wrong! Because, if I do
4) I copy stringsIO to this folder

it immediatly works without any error message!

Currently there is no python install apart from the dll that is installed with Construct. I don't have a PYTHONPATH environment and PATH holds no paths that are related to python.

Crazy...
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Tue Aug 17, 2010 3:10 pm

There has to be something on our computers making it ignore the modules contained in the exe and look somewhere else? Because the exact same .exe file works on my laptop that doesn't have python installed on it...
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Wed Aug 18, 2010 10:14 pm

[quote="alee":1101d52u]There has to be something on our computers making it ignore the modules contained in the exe and look somewhere else? Because the exact same .exe file works on my laptop that doesn't have python installed on it...[/quote:1101d52u]
Yes, and that's what I don't understand. You have a python installation, I used to have one, then uninstalled it. It's like there's something still there that prevents python to look into the app-stored pyc. But that doesn't seem to make much sense...
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Aug 19, 2010 10:03 pm

Does this file exist?: "C:\Program Files\Scirra\Construct\Data\Python\StringIO.pyc"
If it doesn't, your exported exe will complain about no StringIO.pyc.

The python module search paths are in the list "sys.path".
I added an editbox and ran this script at the start of the layout:
[code:2yv3ty5w]for x in sys.path:
EditBox.AppendText(x + '\n')[/code:2yv3ty5w]

I ran that on one of my computers without python installed and a standard install of construct 0.99.92.

When I previewed the module search paths were:
[code:2yv3ty5w]C:\Documents and Settings\User\Application Data\Scirra\python26.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
C:\Documents and Settings\User\Application Data\Scirra
C:\Program Files\Scirra\Construct\Data\Python\
C:\Program Files\Scirra\Construct\Data\Python.zip[/code:2yv3ty5w]

and when I exported to the "C:\tmp" directory these were the module search paths:
[code:2yv3ty5w]C:\tmp\python26.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
C:\tmp
C:\Documents and Settings\User\Local Settings\Temp\capA4.tmp\Python\
C:\Documents and Settings\User\Local Settings\Temp\capA4.tmp\PythonLibs.zip
[/code:2yv3ty5w]

that PythonLibs.zip contains all the exported pyc files.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Fri Aug 20, 2010 3:59 pm

Thanks a lot ROJOhound! I think we're coming closer to the issue.

[quote="R0J0hound":p4b9i29b]Does this file exist?: "C:\Program Files\Scirra\Construct\Data\Python\StringIO.pyc"
If it doesn't, your exported exe will complain about no StringIO.pyc.[/quote:p4b9i29b]
Yes it does.

I've run the very same script and this is what I got from preview:
[code:p4b9i29b]D:\Dokumente und Einstellungen\tulamide\Anwendungsdaten\Scirra\python26.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
D:\Dokumente und Einstellungen\tulamide\Anwendungsdaten\Scirra
D:\Programme\Scirra\Construct-92\Data\Python\
D:\Programme\Scirra\Construct-92\Data\Python.zip[/code:p4b9i29b]

And now the important part. After exporting and manually adding StringIO.pyc to the directory, I got this (look at the last line):
[code:p4b9i29b]D:\Dokumente und Einstellungen\tulamide\Eigene Dateien\Construct\AI Example\python26.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
D:\Dokumente und Einstellungen\tulamide\Eigene Dateien\Construct\AI Example
D:\Dokumente und Einstellungen\tulamide\Lokale Einstellungen\Temp\cap342.tmp\Python\
D:\Dokumente und Einstellungen ulamide\Lokale Einstellungen\Temp\cap342.tmp\PythonLibs.zip[/code:p4b9i29b]
What you can see here is that "\t" is replaced by a tabulator. But only in this last line and only once. There is no valid path to the PythonLibs.zip

It doesn't matter where I export it to, of course. The path will always be the local user settings (so as long as I'm "tulamide" as user the error will occur):
[code:p4b9i29b]C:\Tmp\python26.zip
.\DLLs
.\lib
.\lib\plat-win
.\lib\lib-tk
C:\Tmp
D:\Dokumente und Einstellungen\tulamide\Lokale Einstellungen\Temp\cap345.tmp\Python\
D:\Dokumente und Einstellungen ulamide\Lokale Einstellungen\Temp\cap345.tmp\PythonLibs.zip[/code:p4b9i29b]
What I don't know is: Are we talking of a python issue or a Construct issue?
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Aug 20, 2010 5:24 pm

The exact same thing happens with me Tulamide. Can ash tell us whats been corrupted here perhaps? Because its not the .exe (or the way our construct exports it) as i can't run scidave's online dungeon demo on this computer - but it works from my laptop...

gah
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

PreviousNext

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 1 guest