AllanR's Forum Posts

  • to check the runtime version, go to Layout 1, click on the layout. Look at the properties bar on the left. expand that,and in the middle you will see Advanced. Click the triangle and the runtime setting will be at the top of that section.

  • since the player has time to think about their moves, and the enemy does as well, you will probably have to set a limit to how far the bullets can move on each turn. Otherwise the player could just shoot, and then wait before completing their turn - not giving the other player/enemy a chance to move out of the way.

    I took a quick crack at it to see how I might approach it...

    a turn give each side a chance to do 3 "moves" - which could be moving the player or shooting.

    (use arrow keys to move, space bar to shoot). The enemy doesn't choose its own moves, so you have to play as both players.

    http://www.rieperts.com/games/forum/TurnShoot.c3p

  • I just checked and it is available for me... the orbit behaviour is only available with the C3 runtime, so if your project is using the C2 runtime then that would explain why you can't find it.

  • for arrays, x is the row (or width) and y is the column (or height of each row).

    so the answer to the second question is yes, increase the array width from 26 to 31.

    then you need to decide exactly what data you want to store for each level. If it will never be more than 3 items, then you could just use three columns and then it is up to you to decide what item is in each column for each level. Or create 8 columns where each column is always the same item. It wont make a difference, so which ever way is easier for you will work fine. And you could add additional columns for any other data - best time, date, how many times the player has played that level, etc...

    row 0 in the array is reserved for the other global variables that you wanted stored in local storage

    To read data out of the array, it will always be Array.At(currentLevel,itemColumn)

    so if Gold Stars is always in column 0, apples in column 1, oranges in column 2, you would set or read data from the array like this:

    Gold Stars collected in level 2 = Array.At(2,0)

    oranges collected in level 3 = Array.At(3,2)

  • You need to save the "gotStuff" for each level. The easiest way to do that is with an Array.

    I changed it so that all the local storage data is saved in one array. That means you only have to check for that one item.

    since arrays start with row 0, and your levels are numbered 1 to 25, I stuff the other global variables in the first row (row 0). Then each row after that stores data for each level - which right now is just the gotStuff indicator. You could add more data in the future - fastest time, other stuff collected, how many stars (1, 2 or 3), etc...

    If you add more levels you will need to increase the size of the array. It needs to be one more than the number of levels since the first row is used for the global variables.

    https://www.rieperts.com/games/forum/TooHard2.c3p

  • haha... I haven't looked at your example dop, but I just finished mine...

    https://www.rieperts.com/games/forum/Stacky.c3p

    I used Platform and solid for both the bird and the body. Seems to work pretty well.

  • I have been using a very old javascript Pop-up Calendar with TextInput for years. It worked fine in C2, and I thought it was working in C3, but I have a strange problem...

    when I click on the TextInput, the Calendar pops up fine, I can select a date by clicking on it, and it looks like it updates the TextInput's Text value. But C3 doesn't realise that the value has changed.

    I made a quick test file to illustrate the problem:

    - the TextInput field has a default value, click on the Button and the TextInput value is added to the Text object on the right.

    - click on the TextInput field, select a different date

    - Click on the Button again, and the TextInput value hasn't changed, even though it is displaying the new date.

    if you manually start to edit the TextInput value, it then uses the new value.

    Is this a bug in C3? or is this a problem with the old javascript?

    The TextInput value gets set in the tcal.js f_tcalUpdate function. the browser's DevTools shows the value changing, but C3 still has the old value

    https://www.rieperts.com/games/forum/PopCal.c3p

  • did you try to URLEncode the text before you send it? there is probably a character in the text that is causing trouble.

    check the end of the string that PHP gets, and then compare that to the text in C3 and see what is immediately after that point... if it is an '&' then it is telling php that the rest is a new parameter.

  • ok, after a lot of testing, there is definitely a bug. I was about to make a bug report when I saw one from yesterday that helped me further pin point what is happening...

    When the Text object has BBcode enabled, the text in the object gets shifted down. It does report the correct text height, but since the text is shifted down, it gets cut off in your case.

    So, until Ashley fixes the bug, you can turn off BBcode for your Text object and it will align the way you expect.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • well, I played around quite a bit...

    here is my file:

    https://www.rieperts.com/games/forum/ocr.c3p

    the bad news is that the ocr.space web site does not detect any text (numbers) in your sample image. I made a test image and it worked great on mine. So, the font on the multi-meter seems to be a problem. I tried setting the language in the request to both Eng or Korean (because they said that might work better for numbers only) and neither worked.

    also, I could only get the ocr.space site to work with the GET method, which requires uploading the image first to a web site and passing the url. Converting the image to base64 and POSTing that to the site ("api.ocr.space/parse/image") only returned errors. I tried from C3 and downloading the Postman app (which gave better error messages). It seems to be a problem with their site - not C3 or me doing something wrong. Posting the base64 gave a 404 "not found error", posting a url to the file gave a filetype not detected, even if I overrode the filetype using the filetype key. The same images passed to "api.ocr.space/parse/imageurl" (which is the GET method) worked fine.

    that is all I can do...

  • I did a test and it worked fine for me... I would have to see your project to look for a problem.

  • very interesting... I am working on a project that did start in C2, but I moved it to C3 and it is using the C3 runtime. I was sure it was still requiring a tick before I could get textwidth or textheight, but I just tested it and it does work as Ashley said.

  • any canvas you create will be floating above the Construct canvas (the way dom elements do - TextInput, Buttons, etc.). So you can't have sprites above, as far as I know.

    but you can have javascript load images, process them and load that into a sprite.

    I was working on adding a javascript program that can resample/resize images a couple weeks ago - see this thread:

    https://www.construct.net/en/forum/construct-3/scripting-51/resize-image-load-sprite-154801?kws=

    and this thread helped me get image data passed between javascript and Construct too:

    https://www.construct.net/en/forum/construct-3/how-do-i-8/exportimport-image-clipboard-154984#forumPost1021592

  • to do it in C3, you may be able to add the tesseract.js scripts from the GitHub reference link given in the Rex plugin page. But that may be a lot of work.

    The ocr.space link looks like it would be fairly easy to use with AJAX calls. If you have a URL to the image, then a GET call would be easiest. Otherwise you would have to convert the image to base64 and do a POST call. The results would be in a json format in the AJAX.LastData

    where are the numbers coming from? there could be easier ways as well...

  • textheight does give you the full height - from top to the bottom of those letters you mentioned.

    the problem you are having is that you can not calculate textheight with a text object in the same tick that you create it. (well, that is what my testing turned up - but I don't remember if I tried calculating textheight in the next top level event, which might work)

    what I ended up doing was placing a global, invisible text object off screen on the first layout so that there is an instance available that already exists, and use that to calculate textwidth and textheight for the buttons I make.