kiko2015's Recent Forum Activity

  • No problem! Regular expressions may seem daunting at first, but when you understand its usefulness, you can't do without them!

    That's for sure! They are pretty daunting. Especially for me. I haven't had that much experience. But in the end I was able to use a lot of what you sent me and did some more research too. Ended up calling the lines from the document like this:

    trim(tokenat(AJAX.LastData,random(0,300),";"))

    I had no idea that all I had to do was to add a separator - (;) hope I used the right term - in my text document.

    I didn't know that the lines were counted by default, this line of code above for example, 0 is the first line of my document and 300 is the last, and I even randomized it. It works perfectly.

    I thought your example was neat. I will use in one of my projects for sure. But since I wanted to call the lines of text from a file because it had too much content, I came across another way. But definitely what you sent me opened up my mind to get where I got.

    So happy!

    Thanks!

  • I don't know if I can post this link here, if not I am sorry, but I came across this on Google and thought it was really helpful, too.

    https://github.com/jamesqquick/Construct-2/commit/aec86c1e3c127dd604638d4f487517bad09b8619

    Magistross thanks again, man. I learned a lot from your .capx file. Outstanding!!!!!!

  • With a tag system, regular expressions will be your friend.

    Here's one way you could to it :

    https://dl.dropboxusercontent.com/u/700 ... ystem.capx

    Magistross, sorry it took me so long to reply. Had a busy day.

    Man, I have no words to thank you. Thanks for taking the time. I am still tweaking with it but I think I am going to be able to achieve this soon thanks to you.

    Thanks a bunch! Really!

  • You will need some tags or another mechanism to identify portion of the document.

    In your example, you could use the "tokenat" expression with "newline" as the delimiter. This way you could retrieve any desired line provided you know its rank in the sequence.

    Thank you! I am fairly new to Construct 2 and game development. Can you tell me how I can do this?

    For example, if in a line of my text document the line starts like this: It is a nice day today, Should I add a tag before it?

    Like this: (TAG) It's a nice day today... Any special characters here?

    And in the Events Sheet, do I need a For loop? Could you just show me what Tokenat would look like on the Event Sheet?

    Thanks a lot!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can parse the text in a multitude of ways. The right method to chose depending on your document structure.

    What does your document look like ?

    This is what I have:

    Ajax > Request TEXT.doc ("ReadData" >)

    OnTouch > SetText > Ajax.LastData

    So far so good. And the document looks like this:

    ----------------------------------------------------------------------------

    The quick brown fox jumps over the lazy dog.

    Pack my box with five dozen liquor jugs.

    Sphinx of black quartz, judge my vow.

    etc

    etc

    ---------------------------------------------------------------------------

    Imagine if I have to create 3 separate text documents in the example above, nonsense. Is there a way that I can just grab portions of text from one single document?

    Hope I was clear on this. thanks for taking the time.

  • Import your text file as a project file. https://www.scirra.com/manual/141/files

    You can access it via the AJAX object (https://www.scirra.com/manual/107/ajax) and use the tokenat() expression to parse out your text. newline often serves well as a token separator.

    Thank you!

  • What I mean is: After importing the text file into Construct 2 and calling it via Ajax, is there a way that I can select a specific part from within this document? Right now I only know how to call the document but I have to create a lot of different documents in order to achieve what I want. It would be nice if I had one long text document and only print on the screens the sections I choose.

    Help, please! Thanks!

  • Thank you, oosyrag!!!!! I was able to achieve what I needed. I really appreciate it!!!!

  • Hi, I am building an application that will contain a lot of text. Is there a way on Construct 2 to call the text from a text document like Notepad instead of adding the Text Object each time I need to add some text?

    Thank you!

  • Problem Description

    I am really frustrated trying to understand why my sprites appear in diferent positions and even sizes in the window on my Construct 2. Even when the numbers show, for example, that Sprite1 pos. = 300, 221 and Sprite2 pos. = 344, 221, even after I aligned them EDGE>BOTTOM, the sprites don't appear to be aligned at all. Even the sizes are not making sense, even though the numbers make sense. This is happening on browser preview as well on layout.

  • Hi, everybody. I am a newby. Actually this is my very first post. I was wondering if anyone could tell me how I can make an enemy follow Player. I tried JImJIm1983's code and it worked somewhat.

    I am building a simple game, actually I am still a beginner programmer and am trying to learn the basics, but here's what I have built: A simple platform game, a bird's eye view of city blocks with streets that go around it and through the blocks in the layout. I got the car (Player) Touch controls working fine with 4 arrows LEFT, RIGHT, UP AND DOWN. Now I want to build another car (Enemy) to chase it around the city. Player will be able to shoot down Enemy, but I can't get Enemy to chase Player. It only needs for directions LEFT, RIGHT, UP and DOWN.

    Help, anyone?

    Thanx!

  • Welcome, Maria from Romania. Bem vinda!

kiko2015's avatar

kiko2015

Member since 13 Dec, 2015

None one is following kiko2015 yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies