R0J0hound's Recent Forum Activity

  • To correct the Z sorting you need to move the hot spots in all the Hero and Hero_det animations to the bottom of the frames, and move the hot spot of the Tree down about 8 pixels.

  • Here's another way to do it with only one platform behavior. You can override controls with the "set control state" action of the MouseKeyboard object.

    + System: Always (every tick)

    -> MouseKeyboard: Set control "Move Left" of player 1 to 0

    + MouseKeyboard: Key A is down

    -> MouseKeyboard: Set control "Move Left" of player 1 to 1

    Here's an example cap.

    http://dl.dropbox.com/u/5426011/examples2/controlswitch.cap

    made with 0.99.94

  • I've had similar issues with global and private variables in expressions. To fix it, specify in the expression what the type of the variable is: int, float or str.

    change this

    -> System: Set global variable 'Maxhealth' to global('Constitution')*32

    to this

    -> System: Set global variable 'Maxhealth' to int(global('Constitution'))*32

    -cheers

  • You need to rename some object and behavior names. Names with symbols or spaces will cause errors when using python.

    Rename "Mouse&Keyboard" to "MouseKeyboard" and rename the "Selection Box" behavior to "SelectionBox" in the objects SelectionBox and Gradient.

    -cheers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:h7i2jc08]is it feasible to use non-square collision bases?

    It's possible, but would require some modification of the collision detection and depth sorting to handle the new type of shape. Currently all the objects are defined as blocks, and the depth sorting will fail if the blocks overlap in iso space.

  • That problem has been there for a long time. Use global('globalvar1') instead of 'globalvar1', and they won't keep switching back to the first global variable.

  • Tulamide, they should work identically, I suspect the blank __init__.pyd caused it not to work. I didn't "import sys" because it was already imported when Construct initialized python.

  • Hi,

    If you have all you pyd files in a sub-directory named "joystick", then run this line once at the start of the program and it should work:

    sys.path.append(System.AppPath + 'joystick')[/code:un7xghsh]
    
    Alternatively it should work by just selecting the relevant pyd files when exporting to an exe.  What are the 11 pyd files?
  • [quote:11964ur1]File 'string' line 1061(??)

    def swap values (self,p0,p1,p2,p3)

    syntax error invalid syntax

    If you remove the S plug-in from your project it will eliminate that error.

    Some other fixes:

    r=System.getred(d)

    b=System.getblue(d)

    g=System.getgreen(d)

    Cell.SpawnObject('Cell',1,0)

    Add this event to initialize python at the start of layout:

    + System: Start of layout

    -> System: Run Script ("")

    Construct will crash if python isn't initialized and ~700 objects are created.

    Hope that helps.

  • Is this what you mean as a half sine? Fast at A and slow at B?

    a.x+(b.x-a.x)*abs(sin(lerp(0,180,timer/1000)))

  • What version of Construct are you using? You will need at least 0.99.93 to be able to access behaviors like that in python.

  • Taking Keeper's idea and cutting out the middleman, makes for one step after importing "boo". This is probably the least "hacky" way to go about it, and it keeps the code looking clean.

    boo.py

    def sayBoo():
        Text.Text = "Boo!"[/code:3csgmg65]
    editor:
    [code:3csgmg65]import boo
    boo.Text = Text
    
    boo.sayBoo()[/code:3csgmg65]
    
    And if the Text object is renamed only one line needs to be modified in the editor from
    [code:3csgmg65]boo.Text = Text[/code:3csgmg65] to [code:3csgmg65]boo.Text = tBoo[/code:3csgmg65]
R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound