Ashley's Forum Posts

  • Use this forum to discuss the Python scripting language, and anything relating to how Python integrates with Construct (the script editor, how Python uses Construct objects, etc...). Remember for general queries about the Python language, http://www.python.org is the official site and may answer your question, and there are many other Python-specific forums out there who may be able to better answer questions solely about Python itself.

    This forum was added because some people may want to avoid scripting and just use events and vice versa, so we'll keep Python/scripting posts here.

    Construct 0.91 is the first build with Python.

  • http://downloads.sourceforge.net/constr ... irror=osdn

    Construct 0.91 is a milestone in Construct's development, introducing the ability to Python script your games with a high level of integration between scripts, events and objects. For information on Python, visit (you don't need to run the Python installer to use it in Construct - everything you need is included).

    Python Scripting - Construct Wiki

    To insert a script, right-click and pick 'Insert Script'. 'Enable scripting' must be enabled in application properties. You'll be prompted if it is off when you insert a script. Scripts can be inserted as sub-events to run only when an event is true, or in the main event list, where it runs on the equivalent of an Always event.

    Applications using Python require the distribution of Python25.dll alongside the exported EXEs in this build. You can find it in the Construct directory. Hopefully this is a requirement we can eliminate in a future build, by packaging the DLL inside the exported EXE, but for now - don't forget it if you use Python!

    The script editor includes a kind of intellisense that filters out the available functions to you as-you-type. Objects are directly accessible and modifiable in Python: if you have an object named Sprite, you will be able to modify it like so in Python scripts:

    Sprite.X = 100

    Sprite.Angle += 1

    etc. The aim is to have all actions/expressions/conditions accessible through Python, and you should be able to find all of these through the intellisense filter in the script dialog.

    The editor also makes some corrections to code as-you-type:

    • Auto-indent (indentation is significant in Python)
    • Adding : if forgotten on certain lines
    • Substituting = (assignment) for == (equality) if accidentally typed in an if statement
    • Bracket highlighting and insertion of missing brackets

    These are experimental adjustments and they will either be kept, expanded or removed depending on community feedback, so let us know!

    This is the first Python build, so let us know your thoughts and questions. Soon I will be posting more Python tutorials and information to help you get started.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's pretty good These 3D demos make a very good case for better 3D capabilities!

  • Ergh, two days without eating anything... well, I'll try have it sorted today, I'm not going anywhere like this! I don't think it was anything I ate, just some kind of stomach bug... bleh.

  • If you have the latest build, just add a .wav file in a resource, and the simplest way to play it is via 'Autoplay resource'. Alternatively have the file on disk and play it using 'Autoplay file'.

    Only 'Play music' supports MP3 files, the rest are sound effects and must be .wav format.

  • Ive heard a few people mention this, but have never been able to reproduce it myself... could you send that .cap to ?

  • Well so far I've had a look and the reason the animation is stuck on frame 1 is because of your coding: make the red detector visible that you use to check if the player is standing on the ground, and it goes flying off somewhere because you made some kind of hinge. You really should remove its physics movement and just fix it in place with set X/set Y actions. Then it never gets stuck on the first frame, because it can properly tell when you're on the ground.

    As for the object changing size, that's a bug in Construct I need to hunt down

  • Yeah sorry for lack of updates, was gonna have Python ready this weekend but ended up with a stomach bug! We should have 0.91 ready soon and then we're rolling again...

  • Could you send the .cap which is doing this to so I can take a look? Thanks.

  • Could you send the .cap doing this to ? Thanks.

  • Use str() to convert numbers to strings, or use the & operator which converts anything which isn't a string to a string. Eg.:

    "Score: " & currentscore & "/" & highscore

  • [quote:kfr9anei]Virus scanners mostly go for viruses and not code like deleting files in your system32 folder.

    Actually, if you're paranoid about this, Vista is actually a good operating system to go for! I know it's pretty unpopular, but on Vista applications don't have access to any of your personal/system files on disk, and you'll most likely get a UAC warning if it does attempt anything suspicious. Personally, I'm happy with XP though.

  • Well there is risk associated with running any EXE file at all, and antivirus software is a line of defence against that. I wouldn't run any files off the internet without a virus scanner.

    You could always just download the .cap source files if they're provided, so you can check the code etc. yourself.

  • The watch thing is already implemented in the debugger!

  • How about double clicking debugger items, to add them to the watch page? You can use that to pluck out a handful of values from different objects that you want to track, and view them in one list in the watch tab.