R0J0hound's Recent Forum Activity

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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]
  • Here's an example for an 8 direction grid movement:

    http://dl.dropbox.com/u/5426011/examples2/8dirGrid.cap

    made in 0.99.94

    I haven't used XAudio2 much but autoplay works fine the first time with any other wav file I've used. For a fix for that particular file throw in an event like this:

    + System: TickCount Lower than 3
    -> XAudio2: Autoplay file "C:\Documents and Settings\Rhino\My Documents\Downloads\Amaranthine\Amaranthine\Sounds\tick.wav" (No loop)[/code:3dghcu4n]
    and the tick will play the first time you hit a key.
    
    In the last problem the reason it's not working is arrays are 1 based.  (1,0,0) doesn't exist so no value is getting set,  change it to (1,1,1).
    
    -cheers
  • One way to do it without plug-ins would be to give objects A and B two private variables each, storing their angle and distance from object C. Then just update A and B's position and angle every frame relative to object C.

    Here's an example of that and mouse rotation:

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

    made in 0.99.94

  • It's a valid question, setting and getting .xy in python is incomplete and doesn't work. You can only set and get x and y individually.

    -cheers

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound