R0J0hound's Recent Forum Activity

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

  • Using the last position to get the angle of motion isn't suitable in this case since from a stop the angle of motion will always just be 0. It needs to be moving for one frame to get a direction. However, notice that the angle of motion is connected to the object's angle and the input. So for example you could do this:

    up arrow

    --- angleOfMotion = sprite.angle

    down arrow

    --- angleOfMotion = sprite.angle+180

    strave left

    --- angleOfMotion = sprite.angle-90

    strave left

    --- angleOfMotion = sprite.angle+90

  • The 3 was arbitrary because without it the object wouldn't spin enough. The math is just vector algebra an I probably butchered it a bit.

  • Here's a math idea that simplifies it a bit.

    Basically it's a torque calulation using a cross product.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can do it like this if array1 is size 5x5x2 and array2 is size 25x2x1, but I don't follow how it helps your op.

    array1: for each xyz

    --- array2: set value at (array1.curx+array1.cury*5, array1.curz) to array1.curValue