Do you use Python in Construct?

This forum is currently in read-only mode.
  • Python is David's feature, so I'm afraid I'm going to leave it up to him to sort this one out.

  • Well Diaz pointed out to me that external libraries are working. I went back and tried my old example that was not working and figured out that I was making a stupid mistake. Construct was all along importing the library.

    So I am happy to say that Construct DOES support external libraries!

  • So wait... does that mean Construct can work with python libraries? Because that'd be too good to be true. Imagine using noise, AI and pathfinding libraries.

    Nah, definitely too good to be true!

  • Does one have to copy the python libraries along with the .exe for end-users?

  • I probably should do some more testing before I declare that Construct supports external libraries.

    The correct statement right now is that Construct supports running external libraries from .caps, which really doesn't mean much. I also did get it working with an .exe as well, but it is just on my development machine with Python and the Python module/library preinstalled. I also got an error message popup when executing the .exe so it is buggy, but still works.

    Does one have to copy the python libraries along with the .exe for end-users?

    I unfortunately don't have my system with Virtual Machines to test this with. Here is what I believe you would have to do to make this work as it is right now:

    1. Install Python 2.6.4 on end users system

    2. Install Python library on end users system (this may be an install or copy depending on library)

    3. Run the exe

    This is obviously not practical if you have to install the entire 14mb Python on end users system, but right now there is no python26.dll being copied along with the exported .exe. That leads me to believe that without Python preinstalled the .exe wont work. We need something like the py2exe program for construct. I'll do some more testing tomorrow and let you know what I find out.

  • Ok, I finished testing a couple of external libraries with Construct. Cool thing is Construct and Construct games work fine in Vmware 7 workstation w/ 3d accleration enabled so that has been nice for testing.

    Pretty much what I found is that you have to install Python 2.6.4 to get external libraries to work (at least without more work). I tried copying over the python26.dll file but still got lots of errors for missing dependencies. I also copied over a large number of .pyc files to try to cover the dependencies, but was not able to do it. I still believe there is a way since Py2exe does it.

    However, until that type of support is added you have to bundle Python and the Python libraries with your .exe. Also there is an error message I get when the .exe first runs:

    <img src="http://i47.tinypic.com/2dtd7kn.jpg">

    It still is pretty cool though the possibilities this opens up once it is working better.

  • http://www.tarind.com/depgraph.html

    That might help find dependencies. Still, Python tends to go very deep. I guess you'd have to copy a LOT of files.

  • I have tried using Python on a few occations and became frustrated because my knowledge of the language is almost nil but I believe that scripting is an asset in many circumstances...its just the learning curve that turns me off.

    As for Construct in general and Python specifically...a true help manual of basic use and technique

    would be a great help to the average low-level user. Im talking about a self-contained in-program help system not relying on internet access or even tutorials...just a straight up help .pdf file would be appreciated.

    Perhaps there already is one but I havent seen it. Everything Ive learned has been primarily from trial and error experimentation ... which has its own benefits but documentation should really be a top priority. Python can be learned from reading available reading material but reading material on construct seems to be piece-meal...hit and miss...where is the manual??? If you make a feature write it up in a .pdf file and add it to the manual and send the manual with the download...some people dont love to spend loads of time online searching for answers from other users.

    Just my thoughts...the Construct program with it's Python scripting is so powerful an idea but power is put to its greatest use with the knowledge of how to impliment that power...this I believe is where Construct falls short...maybe Im just ignorant of existing resources but please someone put out an in depth manual without the need to search posts and tutorials...I like one-stop-shopping.

    Not having to drive all over the plpace to find one tid-bit after another..Anyway

  • I dont use Python, but that is because I dont yet know how to use it. It is certainly true one of constructs features is that you dont need to use a scripting language to create a game. But to add my two pence worth, eventually only one open source game creater will be mainly used. And I think the piece of software that will prevail will be the one that offers three important things. Firstly, the ease at which you can get into the program. How many good open source programs are there out there (and I dont just mean game creating ones) that are probably good packages, but people dont use them because the learning curve is so steep, and it is not worth the time you invest into learning it when you can learn something else easier. Secondly, the program has to have a strong community behind it. If you have a question, its nice that you can toss a question into a forum and someone will answer it. Thirdly, some people will be more likely to use something if what they have to learn can be applied to something else. One of the considerations I had when I started to look at construct was that it would take Python code. Why was that so important? Well eventually (when I have the time) I would like to learn how to make a 3D game in Blender. Like construct you can make a game without using Python, but the fact that you can use a programming language that seems to be on its way up, will surely attract people who can program in python to look at (and maybe use the software). This can only be good for construct (and blender). So is python essential for construct? No, I dont think it is essential, but anything that expands the base of people using the software is a very big plus in my opinion.

  • Pretty much what I found is that you have to install Python 2.6.4 to get external libraries to work (at least without more work). I tried copying over the python26.dll file but still got lots of errors for missing dependencies.

    does this mean it works on machines without python installed if you dont have external libraries...iwasnt sure if that worked or not...and if so, oes it still get the weird error?

  • >

    > Pretty much what I found is that you have to install Python 2.6.4 to get external libraries to work (at least without more work). I tried copying over the python26.dll file but still got lots of errors for missing dependencies.

    >

    does this mean it works on machines without python installed if you dont have external libraries...iwasnt sure if that worked or not...and if so, oes it still get the weird error?

    I thought we tried this the other day in chat and had no luck getting it to work?

  • that cap was using pygame library

    i guess i shoulda tried it with a reglar no extra library python cap, too

    but alas...'tis too late

  • that cap was using pygame library

    i guess i shoulda tried it with a reglar no extra library python cap, too

    but alas...'tis too late

    Well if you can catch me while I'm awake in chat, we can always try again, since I've still not (and likely never will) install python.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • >

    > Pretty much what I found is that you have to install Python 2.6.4 to get external libraries to work (at least without more work). I tried copying over the python26.dll file but still got lots of errors for missing dependencies.

    >

    does this mean it works on machines without python installed if you dont have external libraries...iwasnt sure if that worked or not...and if so, oes it still get the weird error?

    Yes, that is correct. If you don't have external libraries then it works. However, I am still getting the weird error message. I also still had to copy over a bunch of .pyc files to cover dependencies. However, I bundled all of these up so if someone wants to try what I did then it will be easier.

    Here is a Hello World example w/ the required Python26.dll and the dependencies. You can either unpack into the same directory or unpack into a C:\Python26\dict directory.

    http://www.box.net/shared/eghvdkxm10

    I believe there will always be errors and issues until the support is added into Construct to have this all handled during "Build the exe time". That is when the input/export table is constructed and when links to libraries are set. It will probably always be buggy if we try to do this after the fact.

  • I dropped most of my development on Crooked because Python wasn't working at the time. If it was working, I'd probably pick it back up. Although, now that I know how to write a plugin, I could do most of my programmatic stuff in a plugin.

    My point is that people don't use Python because they aren't interested in using Python. They don't use it because it's broken, or because they believe it is broken. It's kind of a gray area.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)