bitworks's Forum Posts

  • Well, to be honest I solved it somehow, but why exactly it broke down is still a mystery for me. I depend heavily for Python in my projects, so I do most stuff with it.

    First, even a simple script like: Function.Call("my_function",0) didn't work in a new , empty project (aside for the function plugin). Then I reinstalled CC, same problem but NOT with this new, empty project. So I downloaded Python 2.6 and manually copied the StrinIO.pyc into CC Data folder. Well... that didn't help.

    But what did was deleting all other StringIO.pyc from other locations - it seems that in desperation I copied that file into the project folder and it was a 2.7 version. After deleting it, and tweaking the code - so I deleted all the in-developement parts and left only those that I knew would work - I could resume coding again.

    I posted all this for anybody in the future with the same problem. Oh, and Jayjay, I didn't try exporting the game yet. That would test something, out of curiosity?

  • Uuuhh, I messed up. :/ Something happened this afternoon that rendered Python in my CC absolutely useless. Nothing works, it seems, as there's only the "An error occured in python, but construct is unable to obtain any error information without StringUO.pyc".

    I've tried feeding the DATA\Python StringIO.pyc from both Python 2.6 and Python 2.7, tried reinstalling CC but to no avail. Is there another place where StringIO.pyc persists after reinstall? I really don't know how to fix it, and this happened when I finally get going with my project (downloaded Spriter and I'm in heaven right now).

    Any, ANY advice on this would be appreciated!

    Edit: I suppose I should add that this was not a problem before, as Python worked with my CC pretty well. The error seems to be project-specific, but anyway... could somebody point me what version of Python does CCr2 use?

  • F'course we can help you. :) The first thing you must know while working with Construct (or any game building engine) is that to think in multiple ways how to cheat reality and use the tools you're given.

    So, let's say that we have a ball falling.

    1. Create a ball object.

    2. Set ball position to X,Y.

    3. Ball object, apply movement type: physics.

    4. On collision with obstacle - ball object movement: static.

    5. On collision with player - ball object angle = player angle, speed = 100 (or just any other values / change movement that suits your needs)

    There's no need for particle system to do any work here. I didn't provide you with the straight solution, but I hope I did help you to develop a kind of framework for thought. :)

  • But.. what are your methods? :) It would be really great if you would elaborate, I myself aren't a genius, but maybe I could help you improve some of them.

  • Hm... well, it seems that you need to build a simple question / answer database. Some simple array like:

    • Question 1 | Answer A | Answer B | Answer C | Right Answer
    • load question
    • if Player Answer = Right Answer -> +1 point, next question

    Try using an array object. :)

  • Well.. do you mean "slow down to almost zero and stay like that for X time" thing? I can think of a few possibilities to make that happen. A simple counter/value type would do...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • About the spikes... Koronello, did you try "if player X = spikes X -> spikes fall down" type of actions? I don't know about multiple instances, but in theory, it should work.

  • Sorry for bumping an old thread, just making sure that anybody who wants the solution will find as much info as they can get.

    I recently run into the "no module" ImportError, and figured out this:

    • CC comes with some of the modules preloaded in the ..CC\DATA\Python directory
    • some of it, like my base64 module are missing
    • download Python 2.6, install it, find the modules that you're lacking
    • if you have only *.py files, you have to convert them into *.pyc files (probably)
    • to do that, use Python! [import py_compile / py_compile.compile("base64.py")]
    • copy the *.pyc file (module) that you're missing into ..CC\DATA\Python directory
    • import and enjoy, should work :)

    My original problem and the extended solution: scirra.com/forum/topic67855.html.

    Cheers!

  • I've looked into it. Well, for starters - you made your enemies ALWAYS (event #7) have the speed of 80, so even if they collide with something, they will instantly gain the speed of 80. :)

    Try using something else, for example:

    1. if ENEMY is NOT colliding with obstacle AND ENEMY speed < 80 - set ENEMY speed = 80

    2. if ENEMY collides with obstacle AND ENEMY speed >= 80 - set speed to 5 / bounce / something else

    The problem is that every each second (or tick) the program makes your monsters have the speed of 80, so collisions don't work.

  • Hey! I'd love to help you with your problem, but I have a hard time understanding what are you trying to do exactly (no offense, I know that communicating in English can be difficult for some people :) ) Can you post in points, point after point what would you like to happen in your game? Cheers!

  • Yup, I bump that! Posting solutions, even if simple ones can be tremendously helpful to all community. :)

  • Okay... i tried to copy the base64.pyc from my Python installation folder (I use Python 2.7) to Scirra\Construc Classic\Data\Python but now it gives me... an ImportError: Bad magic number in ..\Data\Python\base64.pyc.

    Is there... magic involved? I need a witch doctor!

  • Hi there! (ah, so I finally joined the forum, sorry to post a problem as my first post)

    Me and my little indie game team are working on some projects, and we use CC as our primary app, mostly due to it's Python support, which really adds power and flexibility. Until now it went smoothly enough, but suddenly, a little something came up. I'll get into details right now (after this ad!):

    • we're using a separate "PYTHON Event Sheet" that is imported at a start of every layout
    • the "PYTHON ES" contains all classes and default functions, as well as import module lines
    • it works OK in most cases, imported string, math, random, time modules without any problem

    The problem is: I can't import base64 module! Nothing I try works, and Aptana Studio imports and uses base64 without any problem. Rest of the modules work pretty well, never had this error before. It's ImportError: no module named base64.

    Any suggestions? Does Construct need to have these modules in a specific location? Or does it just hate base64? :P Any help would be greatly appreciated! Cheers!

    Edit: SOLVED! For all those who will encounter this problem in the future: Construct Classic seems to come with some of the modules stored in <CC path>\Data\Python but not all of them. If you encounter an "ImportError: no module named XYZ" that means that it's missing it in that directory. You can add manually the *.pyc file to this directory, but it has to be Python 2.6 and not a higher version. I tried to copy a Python 2.7 base64.pyc and that gave me the "magic number" error - the versions were not compatible. So, I downloaded Python 2.6 installation and found that all modules were *.py and not *.pyc. I wrote a small compiler [import py_compile / py_compile.compile("base64.py")], and made a *.pyc out of the base64.py. Then, copied it to the CC\Data\Python directory and it works like a charm!

    Sorry for the messed up description, I hope it will become handy to someone. Cheers!