pyromanfo's Forum Posts

  • 8 posts
  • This works great, however what do you do when you have multiple sprites? How do you access the behavior of the second sprite?

    *edit* Similar syntax to the normal stuff

    SpritePlatform[0]

    SpritePlatform[1]

    ......

  • I finally found the answer here after much searching, in Construct-land this behavior is referred to as "picking".

    In the Python script editor, when you have a script that is a response to an event, then the objects involved in that event are part of the SOL object.

    In this case on a collision between the Player and a Statue

    SOL.Player is the player involved

    SOL.Statue is the statue involved

  • My bad, this seems to only happen periodically, not every time.

  • How do events work in the Python scripting?

    Let's say I have two types of objects, a Player and a Statue, and I put a script on them that fires when they collide.

    If I have two statues, how do I tell which one I just collided with?

    for s in Statue:
        if Player.Overlaps(s):
            .......
    [/code:z77wrael]
    
    This method doesn't seem to work as Overlaps never returns true, regardless of whether or not the two objects are actually overlapping.
    
    Then there's the OnCollide method in Python.  What does this do?  Is there a way to attach a callback to fire when this event fires?
  • So Python is whitespace sensitive, meaning tabs are used to denote scope.

    Yet when I hit Tab in the script editor, it tabs away from the script editor instead of actually inserting a tab.

    Is there something I'm supposed to do to insert a tab when I'm typing?

  • Thanks, that did it!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry I can't seem to figure out how to attach the CAP file

  • I started a new app using the 'RTS' template, and added a script in the Event Editor.

    Now regardless of the contents of the script, I get a Python error on startup about "name 'Mouse' not defined".

    The script at this point is actually just "print 'hi'"

  • 8 posts