R0J0hound's Forum Posts

  • Are global variables broken in python? They work for me. The crash related to text global variables was fixed a few builds ago. I made a typo with the syntax of accessing global variables in my other post. I forgot the "System.".

    System.globalvar('ip')[/code:1gtlnmm4]
    The name of the variable is case sensitive.  Is the name "ip" or "IP" in your cap?
    Also globalvar doesn't show in the right bar, it's just not listed.
  • Global variables can be accessed like this:

    globalvar('ip')[/code:1ptszih6]
    
    System.Close does work but you have to put parenthesis at the end since it is a action:
    [code:1ptszih6]System.Close()[/code:1ptszih6]
    
    And that bug is because scripting is enabled, 700 objects created and no scripts being run.
    There are two ways to avoid that bug:
    1 If you aren't using python at all but uncheck "enable scripting"
    2 Just run a script every frame.  It doesn't even have to do anything, a comment will work.
  • Hi,

    A posted cap along with a description of the problem always gets a solution faster than just a description.

    I recreated what you described in your second post and it work fine.

    + MouseKeyboard: On key Shift pressed
        + Sprite: Value 'crouching' Equal to 0
        -> Sprite: Set 'crouching' to 1
        + System: Else
        -> Sprite: Set 'crouching' to 0
    + Sprite: Value 'crouching' Equal to 0
    -> Sprite: Set height to 50
    + Sprite: Value 'crouching' Equal to 1
    -> Sprite: Set height to 25[/code:1ziy5fze]
    
    In your cap is the initial value of the crouching variable set to one of the two 0,1 or is it another value.  It may just be something that's amiss with the order of your events, although I can't say for sure.  If you post the cap a solution should be found fairly quickly.
  • To be able to restore the window change the script to:

    from ctypes import *
    hwnd=Window.AppWindow
    region=windll.gdi32.CreateEllipticRgn(0,0,640,480)
    oldRegion=windll.user32.SetWindowRgn(hwnd,region,0)[/code:297le7j1]
    then later when you want to restore the window shape run this:
    [code:297le7j1]windll.user32.SetWindowRgn(hwnd,oldRegion,0)[/code:297le7j1]
  • Python doesn't work too well in 0.99.62, you'll need a newer version since python support has gotten better in newer versions. You can install multiple versions of Construct at the same time, just install to different folders.

  • I did some tests to shed some light on the cause.

    The max y position reached when jumping can be calculated with the following formula:

    StartingY - (jumpStrength^2)/(2 * gravity)[/code:1lcbmjqd]
    It seems that the platform behavior goes about 20 pixels higher than what is calculated when running 60fps.
    I switched to unlimited framerate and it was only higher by 2 pixels on my computer.
    
    The platform behavior seems to have a more accurate jump height with higher framerates, and a less accurate one with lower framerates.
    
    Here's my test of the platform movements jump height with two other methods of computing motion.
    [url]http://dl.dropbox.com/u/5426011/examples3/JumpTest.cap[/url] made in 0.99.96
    
    A workaround could be to set gravity to zero and manually change the vertical velocity every tick with a more accurate method like Verlet.
    
    Hope some of this is helpful.
  • chrisbrobs,

    Method 1 is all that is needed to get it to run: Just extract the zip file and run the cap.

    The fact that construct crashes when you try to open the cap usually means that you are trying to open a cap file made in a newer version of construct than you have installed.

    The example was made with Construct 0.99.96, so you need at least that version to run the example.

    If the crashes occur after opening the cap file when you click "run layout" then it is perhaps another problem. In which case what are the error messages, as they will help me figure out what the problem is.

  • What are the crash messages? Also what version of Construct are you using? The example was made with 0.99.96. If you can't open the cap then either you're opening it in a older version of Construct or the cap is corrupted.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Uncheck the Application property "Enable Scripting", unless you are using python scripts.

  • Do you have the Application property "Enable Scripting" checked? That property should only be used if using python. If you aren't using python and that's enabled then construct will crash if ~ 700 objects are created without running any python scripts.

  • After a few minutes of experimentation it would seem that with an "Eye Distance" setting of 500 that a sprite with ZElevation of 250 will appear twice the size it is when it's ZElevation of 0.

  • You can add attributes at runtime with the action "System" -> "Add/ Remove attributes from object". Be advised that trying to remove an attribute with that action does nothing as it is not implemented. Another idea if you use sprite objects is you can enable\disable collisions with the "set collision mode" action.

  • Here is a barebones example for making a ellipse window. All the required python files are included in "py.zip" so no python install is needed. Just keep "py.zip" in the same directory as the cap or exported exe.

    http://dl.dropbox.com/u/5426011/examples3/ellipseWindow.zip

  • 1.

    On the AI event sheet change event 4 change "Start of Layout" to "Timer equal to 0" and add a "For each npc_zefi_tier1ship" condition.

    + System: Timer is Equal to 0
    + System: For each npc_zefi_tier1ship
    + npc_waypoint_generic: Pick one at random
    -> npc_zefi_tier1ship: Move to npc_waypoint_generic 
    [/code:2vp89ioj]
    Also on event 7 remove the "Delay 2000 ms" condition as it causes all the enemy ships to be picked.
    
    2.
    The fixes for 1 pretty much fix 2.
    
    3.
    What PixelRebirth said.
  • To prevent going into the wall you could add a "overlapping at offset" condition to check for collisions before motion.

    + MouseKeyboard: Key Left arrow is down
    + Sprite: [negated] Sprite: overlaps "Solid" : offset (-1,0)
    -> Sprite: Set X to.X-1
    
    + MouseKeyboard: Key Right arrow is down
    + Sprite: [negated] Sprite: overlaps "Solid" : offset (1,0)
    -> Sprite: Set X to.X+1
    
    + MouseKeyboard: Key Up arrow is down
    + Sprite: [negated] Sprite: overlaps "Solid" : offset (0,-1)
    -> Sprite: Set Y to.Y-1
    
    + MouseKeyboard: Key Down arrow is down
    + Sprite: [negated] Sprite: overlaps "Solid" : offset (0,1)
    -> Sprite: Set Y to.Y+1
    [/code:31phvxjq]