R0J0hound's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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]
  • [quote:eq5613lp]it thrown an error "NoneType object is not callable"

    System.RGB(255,255,255)

    is incorrect, it's:

    System.rgb(255,255,255)

    Notice the lowercase.

    -cheers

  • If a Sprite has the Platform movement then it's done like this:

    SpritePlatform.IsOnGround()[/code:31kd3wv5]
    
    I recommend trying out Silent Cacophony's [url=http://www.scirra.com/forum/viewtopic.php?f=16&t=6158&start=0&hilit=pyshell]Pyshell[/url] for experimenting with python.  I use it whenever I use python in my caps to see the correct name of attributes and to see what's accessible.
    
    To find the names of all the attributes of SpritePlatform:
    * Open PyShell.cap
    * Add a Sprite object and give it a Platform Movement.
    * Run the cap
    * Type in "dir(SpritePlatform)" and press enter.
    
    -cheers
  • No, it's not possible in python. The "Solid" attribute can be added at runtime with events or python but it can't be removed.

  • Try this it will eliminate the teleport.

    + DirectionBlock: Value 'Direction' Equal to 0
    
       + MouseKeyboard: On key Right arrow pressed
       + playerCol: overlaps DirectionBlock : offset (10,0)
       |  -> DirectionBlock: Set collision mode to None
       |
       + MouseKeyboard: On key Left arrow pressed
       |  -> DirectionBlock: Set collision mode to Per Pixel
       |
       |  + playerCol: playerCol overlaps DirectionBlock
          |  -> DirectionBlock: Set collision mode to None
    [/code:1kvgwug0]
  • In Construct Random(2) will return 0 or 1, but not 2.

    A way that's simpler than checking for overlap at offset, just check for overlap. If it's true, undo the last movement and rotate 90 or -90.

    + Ghost: Ghost overlaps Wall
    -> Ghost: Move 0-Ghost[Bullet].Speed*TimeDelta pixels at Ghost.Angle degrees
    -> Ghost: Rotate {90,-90} @ (Random(2)+1) degrees clockwise
    [/code:33czl20k]
  • object2 should be in quotes:

    object1.Overlaps("object2")[/code:2x3quw2v]
    but that, although correct, causes construct to crash.
    
    Use OverlapsOffset instead:
    [code:2x3quw2v]if object1.OverlapsOffset("object2",0,0):
       Text.Text = "True"
    else:
       Text.Text = "False"[/code:2x3quw2v]
R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound