R0J0hound's Forum Posts

  • Show a screenshot or a capx. Is the event that increments the variable running? Could you have another similarly named variable that you're accidentally incrementing instead?

  • It's a bug, and here's a new report for it:

    What you can do in the meantime is set the value of the variable at the start of the layout instead of using the initial value for spaces. So for example:

    global text spaces=""

    Start of layout --- set spaces to " "

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    If a text variable has only spaces and you save the project and open it later the spaces will be gone.

    Attach a Capx

    https://dl.dropboxusercontent.com/u/542 ... s_bug.capx

    Description of Capx

    The capx displays a variable containing four spaces and a string literal with four spaces. Both with quotes around them to see.

    Steps to Reproduce Bug

    • Add a text variable and add some spaces to the initial value.
    • Save and close the project.
    • Re-open the project and the initial value will now be nothing.

    Observed Result

    The spaces in the initial value are gone upon reloading the project.

    Expected Result

    That the spaces would still be there

    Affected Browsers

    • Chrome: YES
    • FireFox: n/a
    • Internet Explorer: n/a

    Operating System and Service Pack

    windows 10

    Construct 2 Version ID

    r242

  • Mayfly

    You probably shouldn't set the position or angle of objects connected by joints. Disable the action that sets the angle and the objects pivot correctly. Try a gear joint with a ratio of 2 between crankRear and fw.

  • It's the project file format that's changing from xml (capx) to json (c3p). The plugins aren't affected by that. Any changes needed to port a plugin over are likely just busywork.

    Since c3 is primarily a editor rewrite, the runtime portion of plugins and c3's runtime such would be likely the same. Although any changes to c3's runtime would probably be a good thing.

    The edittime portion of the plugins is likely the part that would need to be re-worked, and that's actually the simpler part of the plugin. Probably most of that portion of the plugin could be converted over automatically, and only edge cases would need to be tweaked. That said people like rex probably wouldn't have any issue converting his plugins over quickly.

    At any rate, just let the beta come out and it can be figured out quickly. Scirra ported all the official plugins so I don't see an issue.

  • Zebbi

    You should be able to use a different image per tiledbackground instance.

  • you can do this to put the number back into the 0 to 360 range.

    (ang+360)%360

  • Here are the posts I was thinking of:

    Those ways give more control than tokenat, but the way to get indavidual words seperated by spaces is the same as the one to get lines except " " is used instead of newline.

    I also know regex could possibly be used somehow.

  • Taking a step back you can convert between compass angles and c2 angles with:

    Compass angle = (c2 angle +90)

    C2 angle = (compass angle -90)

    So if you just want to use compass angles with your events every time you just convert it.

    Ex:

    Instead of

    Set angle to 0

    Use

    Set angle to (0-90)

  • Would setting the layout or later rotation to -90 at the start of the layout work? You may need to make the layout scrolling unbounded.

  • That puzzlescript syntax looks interesting. Creating anything that makes things easier to do such as a custom scripting language are always fun. Way better than just using JavaScript, because as you see from my examples it gives access to everything which isn't wanted for scripts the player can add. Plus you can make the error checking much tighter.

    Anyways I'm glad my capx' were useful and good luck with your project.

  • To get a certain line from some text you can use the tokenat() expression:

    tokenat(TextBox.text, 0, newline)

    The 0 means get the first line, 1 the second, and so on.

    Beyond that you could use tokenat again to get individual words if you seperate everything with spaces or something. What that's called is a parser and there are also lots of other ways to do it. You could do a forum search for parser to see various examples to maybe get some ideas.

  • newt

    I think that would get in the way of editing.

    mrtumbles

    I managed to get that codemirro library working:

    https://dl.dropboxusercontent.com/u/542 ... basic.capx

    It has too many features for it to be reasonable to make a plugin for, so instead I just got it to display and resize on top of a textbox, and provide it's javascript object so anything can be done with it. I tried hiding most of it in a group so it doesn't have to be dealt with.

    cheers.

  • I tried using that jquery plugin but it doesn't work with the way C2 positions the textbox.

    In the end I did it with two textboxes. CSS was used to hide the scrollbar in the lines box, and javascript was used to sync the scrolling.

    https://dl.dropboxusercontent.com/u/542 ... Lines.capx

    You can probably style it with more css.

    I'd be interested to know more details about your homebrew scripting languages or see a sample script. It sounds pretty cool.

  • Other than just using the image as is you could build it out of parts. Like multiple road parts connecting the shapes, reusing the shapes and put text on them, tiledbackgroud for the repeating textures on the sides, semi transparent sprites for the scratches and creases, and for the gradient background you could just stretch a small sprite and it would look the same.