R0J0hound's Forum Posts

  • [quote:2pn9fm58]+ System: "Solid" at (Sprite[RTS].DestX, Sprite[RTS].DestY)

    It's the System condition 'Object overlaps point'. And yes it works with an attribute instead of an object.

  • New Version:

    Path Movement 1.4

    Download:http://dl.dropbox.com/u/5426011/pathmovement/PathMovement1.4.zip

    After a short coding sprint here is a new version. I am now shortening the version number from 1.40 to 1.4, as there aren't any subversions. The major addition here is "acceleration" which allows for easing in and out with minimal events.

    New Features/Changes:

    + Added set/get speed (direction of motion is preserved)
    + Added Acceleration.
    + Added option to set location on path to either move the object or just the path under it.
    + Added option to compare path distance by 'floating point' or 'integer.
    + Added compare path distance in range.
    + Added compare path distance from endpoints.[/code:1jzg7mip]
  • GMG

    Here's a modification of your solution that should work.

    + System: While

    + System: "Solid" at (Sprite[RTS].DestX, Sprite[RTS].DestY)

    -> Waypoint: Set X to Random(DisplayWidth)

    -> Waypoint: Set Y to Random(DisplayHeight)

  • When you set the editbox's text limit you need to take into account the editbox's text length.

    e.g. instead of

    -> Eb_Str: Limit text to ST_Face.Value('LeftoverStringLength') characters

    use

    -> Eb_Str: Limit text to len(Eb_Str.Text)+ST_Face.Value('LeftoverStringLength') characters

    Also on the "HUD" event sheet, event 14,

    invert the condition

    then change it to less or equal instead of greater or equal.

    The only other issue that comes up is that limiting text length to 0 does nothing. so if you use up all 25 characters on the first two edit boxes, you will still be able to input one character on the others.

    Here's a quick example:

    Setup:

    * 3 different Editboxes

    * make all the edit boxes members of the Blue Family

    Code:

    + System: Always (every tick)
    -> System: Set global variable 'extra' to 25-len(EditBox.Text)-len(EditBox2.Text)-len(EditBox3.Text)
    -> Blue: Limit text to len(Blue.Text)+global('extra') characters
    
    + System: global('extra') Equal to 0
    + Blue: Pick by len(Blue.Text) Equal to 0
    -> Blue: Set read only On
    
    + System: Else
    -> Blue: Set read only Off[/code:1u2i8k3a]
    
    -Cheers
  • No need for math, do this:

    + System: Always (every tick)
    -> Sprite: Set angle to Sprite[CustomMovement].Angle
    [/code:2n8intol]
  • Don't use UID use for each:

    + Button: On Button clicked
    -> System: Set global variable 'das' to 1
    	+ System: For each Sprite
    	-> Array: Set index (global('das'), 1) to Sprite.x
    	-> System: Add 1 to global variable 'das'[/code:2o5p8cj4]
    
    A UID is assigned to every object (text, sprite, mouse and keyboard, etc...) and every behavior.  Say you have a cap with only one "Sprite" with a "drag and drop" behavior.  The Sprite will have a UID of 0, and it's behavior "drag and drop" will have a UID of 1. So if you then add another instance of Sprite it's UID will be 2.
  • In general if you have an array with sizes: sizeX, sizeY and sizeZ,

    and X,Y and Z are the current positions,

    then here is the general formula:

    X+sizeX*(Y-1)+sizeX*sizeY*(Z-1)

    or if written in construct:

    @(Array.CurrentX + Array.SizeX*(Array.CurrentY - 1) + Array.SizeX*Array.SizeY*(Array.CurrentZ - 1))[/code:exdklix3]
    and if it's just a 2d array:
    [code:exdklix3]@(Array.CurrentX + Array.SizeX*(Array.CurrentY - 1))[/code:exdklix3]
    
    The other formula I gave you fills the Y column before increasing X.  It was in this form:
    [i]Y+sizeY*(X-1)[/i]
  • [quote:1gnjibfz]how would you go about using that in a 2 dimensional array?

    Like this:

    + System: Start of layout
    -> Array: Set size to 3 x 2 x 1
    	+ Array: For Each element
    	-> Array: Set index (Array.CurrentX, Array.CurrentY) to {"one","two","three","four","five","six"}@((Array.CurrentX-1)*2+Array.CurrentY)
    [/code:1gnjibfz]
  • I don't think that a hash table is the right tool for the job in this case.

    Try an array:

    example

    requires 0.99.84

  • I've been using relatively unused "at" or array access operator. It is fairly simple and requires no python.

    + System: Start of layout
    -> Array: Set size to 3 x 1 x 1
    	+ Array: For Each element
    	-> Array: Set index Array.CurrentX to {"one","two","three"}@Array.CurrentX
    [/code:1uak4www]
  • D?j? vu I think I've seen this before...

    Ah here it is:

    http://www.scirra.com/forum/viewtopic.php?f=3&t=5999&hilit=rts+path

    And I still like the solution I presented there.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:1vf99tpj]I've found a bug here though. apparently capturing the manual control somehow makes the "Click" control I set up not register when the user actually clicks the mouse himself so I had to make a separate event for that. Posting a bug report now...

    You need to click the dropdown and select "Left mouse click". No really, that fixed it. It seems that even though "Left mouse click" is shown as the default for a new custom control, it isn't actually selected by default.

  • How did you get it to crash? Can you post a cap.

  • [quote:qmw8w9st]... how it is decided which bugs get fixed first?

    I can only speak for myself when I say: "Whichever bug I investigate and am able to fix."

    [quote:qmw8w9st]... I think ACE should work reliably before anything else.

    As an amateur bug fixer for construct I concur. Those type of bugs are of interest to me.

  • I like it! Very useful.