R0J0hound's Forum Posts

  • It helps to visualize if you draw a picture or move the scroll_pane around in the editor. Clamp is used to limit how high and low the scroll_pane goes. Basically we're doing this: "set y to clamp(self.y, low_y, high_y)". To find the low_y move the scroll_pane as far up as possible so the frame object covers the last bottom portion. Where the y position of the scroll_pane in relation to the frame. It's the scroll_pane's height above the bottom of the frame or "frame.BBoxBottom-scroll_pane.Height". Next to find the high_y move the scroll_pane as far down as possible so the frame object covers the topmost portion. Notice that the top's of both objects are the same so high_y is "frame.BBoxTop". Now if the hotspot of the frame is topleft it also is valid to use frame.Y instead of frame.BBoxTop.

    Generally you want the scroll_pane at least as big as the frame. Also you could also use two events to compare scroll_pane's y position instead of using clamp for the same effect.

  • Doc Ai

    The Construct 2 (C2) behavior "Scroll to" is the same as Construct Classic's (CC) "center view on me" attribute. Click on an object and browse the property panel on the left to find attributes. Also "Solid" is an attribute in CC.

    "Bound to layout" is new for C2 but the simplest way to do it in CC is to put a tiledBackground object with the solid behavior just outside the whole edge of the layout.

    Also with a C2 licence you can export to exe with node webkit. It's one of the export options.

    nyway,does C2 have everything CC has?

    No, they are very similar but they both have features that the other doesn't have.

  • TwinTails

    Close, vx and vy are the horizontal and vertical velocities and ax and ay are the horizontal and vertical accelerations. Also g is the acceleration for gravity. In event 10 the acceleration is used to change the velocity and the velocity is used to change the position. Of course the player only actually is moved up and down and the terrain is changed by the horizontal position.

    When the player is in the air ax is 0 and ay is g. But when the player is on the ground the acceleration's direction is changed to be along the slope.

    Here is the math behind the slope acceleration:

    http://www.physicsclassroom.com/class/vectors/u3l3e.cfm

    Increasing the acceleration would be one possible way to boost the player. Adding a event like this to the end of the event sheet will multiply the acceleration by 10 while spacebar is down.

    Key spacebar is down:

    --- player: set ax to self.ax*10

    --- player: set ay to self.ay*10

  • How's this:

    https://dl.dropboxusercontent.com/u/5426011/examples20/bitwise_tilemap.capx

    If you want tiles you placed in the editor to autotile you'll have to call "bitwise update" for each tile at the start of the layout.

  • Tinkering around with this all you need is a object with the drag and drop behavior, objects pinned to that and a layer to do the masking. The extent of the math needed is a clamp() to limit the range of scrolling. Unless of course you want a widget on the right that indicates the scroll position, then you'll need a bit more math.

    https://dl.dropboxusercontent.com/u/5426011/examples20/scrollbox.capx

    enjoy.

  • Actually after re-reading the previous posts I realize that my post is redundant because LittleStain said the same thing before me. My apologies.

  • You're adding floor(0.1) or 0 to the variable so it won't ever change.

    Just add 0.1 to your variable and set the text to floor(variable1) to do what you want.

  • Well there shouldn't be a limit. Actually I think this may be bug that comes up from time to time where objects in the editor have conflicts with their id's. I made a utility to fix caps with that issue. Here's the download:

    https://dl.dropboxusercontent.com/u/5426011/utility/addobjfix.zip

    To use it extract it and put your cap file in the same folder.

    Then open "addobjfix.cap" and edit the script so instead of this:

    #------------------------
    #------------------------
    # change to your filename.
    filename='wewe1.cap'
    #------------------------
    #------------------------

    wewe1.cap is replaced by the name of your cap.

    Finally run the project and a fixed copy of your cap will be made.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I like to take a visual approach. Given that you're putting the values in a 2d grid, I imagine you may eventually create sprites to visualize it. So why not create the sprites with 36 animation frames for each value and have a animation speed of 0. You can either create the grid of sprites in the editor or use events to make it. The events would like the following.

    Start of layout:

    --- destroy sprite

    Start of layout:

    for "x" from 0 to 5:

    for "y" from 0 to 5:

    --- create sprite at (loopindex("x")*32+200, loopindex("y")*32+200)

    Start of layout:

    for each sprite ordered by random(1) ascending:

    ---- set animation frame to loopindex

  • It's in r153 beta which was just released.

  • Apply an additional force to move the object to a 45 degree direction:

    ex:

    Apply force -10*(spring_angle-45) at angle spring_angle+90

    10 is the strength and 45 is the target angle in the range of (-180,180).

    I suppose it could use a damping force as well...

  • You have to use the newline expression when setting text with events. It's the same throughout C2.

    ex.

    "first line" & newline & "second line."

  • Haha indeed...

    Anyway I wish you luck. A program with more stock gui manipulation may be helpful for your case. If you don't mind diving into coding I hear c# has nice gui capabilities and good gui designer to boot. C2 could likely do the kinds of programs you had in mind but as you may have noticed you'd have to make most of the gui stuff from scratch. Which isn't too bad since it gives you finer control of what it does.

  • There is no json plugin. One option is making your data match the format os some plugin's .toJSON expression then loading that back into the plugin. You can also use the "execute javascript" action and expressions of the browser object.

    Here's a starting point:

    https://dl.dropboxusercontent.com/u/5426011/examples20/json_parse.capx

    It's then your responsibility to make sure you have inputted everything correctly otherwise you will get errors.

    Refer to this tutorial for more info:

    http://www.w3schools.com/json/json_eval.asp

  • K, I think the answer is yes as I don't get any errors.

    yep.

    o I use Ajax for this, or should I create functions in code to do these?

    Whichever you can use to get it to work. I'm not too familiar with ajax calls but it may be simpler to use the plugin if there are edge cases it handles. But again I have a knowledge gap about that that you can probably find alot of resources about with google.