R0J0hound's Forum Posts

  • Sprite.VertexX(col,row) returns the displacement of that point. If 0 is returned, that point is not displaced from it's normal position.

    For displacement in pixels:

    Sprite.VertexX(col,row)*Sprite.Width

    for absolute position (math is fun when you're tired):

    Sprite.Left+(col/Sprite.MeshCols+Sprite.VertexX(col,row))*Sprite.Width

    Here's an example that sets displacement of a point to what it is (AKA it does nothing):

    -> Sprite: Set relative displacement at (0, 1) to XYZ(Sprite.VertexX(0, 1)*Sprite.Width, Sprite.VertexY(0, 1)*Sprite.Height, Sprite.VertexZ(0, 1)) UV(0, 0) 100 % 
    [/code:2ijpn1qi]
    
    Hope some of that info helps.
  • To get the unique id or UID of the currently picked sprite , use "Sprite.UID" in the expression editor.

    No python needed.

  • Global variables are not broken. My fault if I explained it badly on that topic.

    In python you can "set", "subtract from" and "add to" global variables just like in the event sheet:

    System.SetGlobalVar("lives",1)
    System.SubGlobalVar("lives",1)
    System.AddGlobalVar("lives",1)[/code:27ua0613]
    To use the value of a global variable in python use "globalvar("lives")" which is equivalent to "global('lives')" in construct's expression editor.
    
    So you can use global variables in python as easily as using events.  What's broken about that?
  • Same as with actions in the event sheet:

    System.SetGlobalVar("startGame", value)

    System.globalvar("startGame") only retrieves the value of the global variable, aka you cannot modify the global with an assignment operator.

  • With the particle object you can't change the motion of the individual particles after they are spawned. So you can't make the particles reverse their motion. But as a solution you can make your own custom particle spray using sprites. This gives full control over the particles so motion can be reversed easily. The only drawback is that using sprites requires you to reinvent the wheel to get most of the features that the particle object has.

    Here's an example:

    http://dl.dropbox.com/u/5426011/examples/customParticle.cap

    made with 0.99.84.

  • Look in the "Project Bar" under Global variables.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think a good way to go about it is to use the path behavior on a separate object and when the enemy doesn't have LOS of the player then move to the path.

    Here's a modification of your example:

    http://www.box.net/shared/l570zit850

  • In python no difference whatsoever, they both use the same action.

  • here's how to make it work:

    System.Create("Sprite",1,100,100)[/code:250y764g]
    Notice the quotes.
  • One way to do this would be INI files.

    I started making a quick example but got a little carried away.

    So here you go: InIdialog.cap made with 0.99.84

  • a)

    + System: Timer is Equal to 1000
    -> System: Create object Sprite on layer 1 at (400, 300)
    -> System: Create object Sprite2 on layer 1 at (Sprite.X, Sprite.Y)
    [/code:3napcu8k]
    Or if you will always be creating those two objects together, put both into a container so when one is created they will both be created.
    [code:3napcu8k]+ System: Timer is Equal to 1000
    -> System: Create object Sprite on layer 1 at (400, 300)
    -> Sprite2: Set position to object Sprite (image point 0)
    [/code:3napcu8k]
    
    b)
    [code:3napcu8k]+ Sprite: overlaps Sprite2 : offset (40,0)
    -> Sprite2: Flash for 2 seconds with 0.1 seconds interval
    [/code:3napcu8k]
    
    c)
    [code:3napcu8k]+ Sprite: Value 'color' Equal to Sprite2.Value('color')
    -> Sprite: Flash for 2 seconds with 0.1 seconds interval
    -> Sprite2: Flash for 2 seconds with 0.1 seconds interval
    [/code:3napcu8k]
    
    Hope that helps
  • That example was made with version 99.84.

    Here are the events I used

    + MouseKeyboard: Mouse is over Box
    -> Sprite: Set position to Minimap.MapToLayoutX(MouseX-Minimap.X), Minimap.MapToLayoutY(MouseY-Minimap.Y)
    
    + System: Start of layout
    -> Box: Make Invisible
    -> Box: Attach to object Minimap with 0 padding[/code:cmyymoiz]
  • The problem is that clicking on minimap doesn't work. The solution is to use a hidden object that can be clicked on, (box works well for that).

    Here's a quick example:

    http://www.filedropper.com/minimapclick

    PS: I forgot my box.net password, now where did I write it down.

  • Thanks for the cookies. As for requests, the short answer is no. But as I get more familiar with construct's code I will be able to do more, time permitting.

  • Python

    - [FIX] Script editor action names now better match the runtime (R0J0hound)

    - [FIX] Crash accessing private variables from Python (R0J0hound)

    - [CHANGE] 'global' system expression changed to 'globalvar' since 'global' is a reserved keyword in Python; allows access to global variables by name and index (R0J0hound)

    Runtime

    - [FIX] Crash drawing Sprites on non-SSE2 processors (R0J0hound)

    - [FIX] Incorrect sprite rotation when setting a corner filter (R0J0hound)

    hmm... After a few tests none of these seem to be in there. They're in the SVN, revision 151 but the changes don't seem to be in this build.