kiko2015's Forum Posts

  • I don't think I have to upload the project to XDK and install APK on device in order to test TOUCH, or do I?

    I am hoping it can be tested with the mouse click.

    I have read a lot from the Manual and Forums but I certainly didn't take the time to find out about that. Hoping for a quick answer here.

    Excuse my ignorance. Thanks.

  • Try using: On Tap Object

    Doesn't work. Not for what I want. Thank you, though.

  • I can't seem to replicate the issue. Uploading a CAPX would be good so we can see exactly what you're doing.

    I am using the mouse to click (test) on the touch event and it's creating several instances.

    I didn't want several instances created regardless of the number of clicks. In this example, if you keep on clicking it will reproduce it until you stop.

    Thanks for the help.

    http://www.geocities.ws/kikoriogames/TouchTextExample.capx

  • On touched is a trigger and naturally triggers once only. There must be a problem with logic elsewhere, are you able to post capx?

    I am using the mouse to click (test) on the touch event and it's creating several instances.

    I didn't want several instances created regardless of the number of clicks. In this example, if you keep on clicking it will reproduce it until you stop.

    Thanks for the help.

    http://www.geocities.ws/kikoriogames/TouchTextExample.capx

  • I am new at this, so excuse my ignorance and my humble questions.

    I have this event --> onTouch Object --> System Create another Object.

    The problem is System still creates several instances while Touch persists.

    I can't add a second condition (Trigger Only Once) to this one.

    I tried the Is touching Object with Trigger Only Once. I would like for it to create just one instance of the new object regardless of however I touch the screen.

    I know a variable would be a solution but I am having a hard time dealing with that.

    Anyone can help, please?

    Thank you.

  • AJAX.capx

    And I did read a lot about the Dictionary Action I just couldn't get it done! I am fairly new at this. Thanks to people like you I am getting around it.

    Alrightttttttttttt!!!!!!!!!!!!!!! Thank you a lot!!! Neat!!!!!!!!!!!!! Have a great day!!!!!!

  • Loading with the action'Request project file' can take a while. It is mostly not ready in the next action. And it can take several tick. That is why you have the condition 'On completed'. The tag is there to know which request pairs with which completion.

    So in general you ..

    Some condition that makes the action done only once (like on startup of layout)

    The action 'Request project file' ("tag")

    A new top level condition 'On completed' ("tag")

    The actions that assign the LastData

    Be aware that, because the loading of files can take several ticks, the rest of your events are not valid. Because the needed data are still missing (not loaded yet).

    I see most people in here use Groups and dissable/enable them. To exclude events from runnning as long as the data are not in place.

    Thank you. It seems to me that there's something that I am doing thta's wrong.

    See example of what I am trying: http://www.geocities.ws/kikoriogames/AJAX.capx

    In the example there are 2 requests and different text boxes TEXT1 and TEXT2 are to SET TEXT, but only TEXT2 works.

    I am sure there's something I am doing wrong.

    Thanks. Have a happy Sunday!

  • Hi, I am working on this game and I need to use Ajax to make file requests. Right now I have 2 text files (.txt) that I have imported. But I can only make one of them work. Is it possible to have 2 Ajax Objects like AJAX1 and AJAX2? Because I can't seem to find a way to do that.

    I have checked the code, the tags are different. I posted a link to a screenshot. This image shows the request that is not working. the one that works is identical except for the fact that I create the text and make the request via a SIGNAL.

    Now this trim(tokenat(AJAX.LastData,random(20,21),";")) is identical in both requests except for the random numbers in the brackets. Could this be it? Sorry I am a noobie.

    The one below (see pic), doesn't work. I tried everything and even ended up creating a button to click on it and see if it would work. I hope I was clear enough.

    Appreciate any help. Thanks.

  • I know this is an old post but this happened to me today.

    My solution was:

    1- Make a new folder.

    2- Copy only the files and/or folders that you created in the original folder where the problem is happening.

    3- Paste these files into the new folder you created.

    4- Now open the .caproj and SAVE AS in the new folder.

    Should save normally now.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!!!

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