Grimmy's Recent Forum Activity

  • Okay thanks, but maybe this sounds stupid but how and where do I input that into Construct 2. What kind of event/condition/action? Thanks

  • ..not contain a decimal point?

    Basically I have a number. This could be 1 or 1.00 (or any number like this)

    If the number is 1 I want to append '.00' to it so ultimately they all look like the '1.00' format.

    I know I need to use append and the find(src, text) expression but I have no understanding of how to actually put them into contstruct in a logically formatted statement.

    Please help. Coming from traditional programming background a lot of Construct 2 seems a bit backwards to me

    for example....

    if(!myVar.Contains(".")){//do stuff}

    In Construct 2 however I cant figure out how to make the same statement.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay thanks. I'll probably do my checks at the server end then.

    Out of interest, where exactly is it stored on a windows PC? (Using Chrome in my case..if that matters)

  • So in the end I just needed a php file on my server with the 'allow control header' AND the actual request in the same php file.

    Steps...

    -I put a php file which included the header('Access-Control-Allow-Origin: *'); AND a REST request to the api in question. (So the main difference being that PHP makes the api request NOT C2)

    -This php also spits out the result of the call with echo.

    -I used c2 to call the php file using an axaj POST request

    -C2 then receives the request data using LastData

    All works a charm when uploaded to the server. Hoorah!

    EDIT: I actually REMOVED Access-Control-Allow-Origin: from my PHP file and it all still worked, so presumably the apis that I'm trying to access already have this set at their end.

  • Grimmy

    Rather than necro-posting in a thread over 4 years old (which essentially was fixed), maybe it would be better to create a new post in the C2 Bugs section, ensuring you follow all the requirements.

    If the bug has returned, it would be better if Ashley is made aware.

    Thanks

    Okay will do. Thanks. Apologies for walking on the grave of a dead forum post.

  • I'm saving some data that I dont want the user to be able to modify or copy in any way. I'm currently using the basic system.save command to do this but I have no idea where the file is saved on the end users PC and/or if its accessible and/or easy to modify or duplicate by the user.

    In an ideal world the user wont be able to touch it because I want to save stuff like in app purchases etc and I dont want to have to go with an online save ideally.

    So, is it secure/how hackable? ..and where is is it stored?

    EDIT: I'm actually using Construct 2 and posted in the wrong forum. Apologies, but hopefully its still just as relevant here.

    Thanks

  • I have 3 monitors and this happens to me ALL the time. Everytime I move the construct 2 window the dialogues wander off somewhere else. I cant keep hitting reset dialogues and restarting all the time, that's just nonsense. WHy isnt this fixed? (5 years after the original post) Is there another way? I tried using a third party package (display fusion) but that couldnt fix the issue either.

  • [quote:3rz3jtce]CORS needs to be set up on the server you are requesting data from, not from the construct app or the domain hosting the construct app. It is set in the hosting server's configuration files.

    Are you sure? Because when I disable cors locally on my browser, the data gets retrieved from the source successfully. This would indicate that the data provider is sending the message anyway and its my construct hosted server that is not able to receive it (or send the request) correctly.

    [quote:3rz3jtce]Is the name of your site "https://mysite.com"?

    no. but I put that there as an example

  • Nope, I tried putting it on a secure https server but I get the same error..

    Fetch API cannot load https://api.myapi.com/v2/licenses/verify/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mysite.com' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.[/code:33wwskm1]
    
    Also Ive tried setting the request header itself in Construct before the request gets made...but that still gives me the error.
    
    What exactly am I doing wrong here?
  • I have tried adding the following to the index.html file before all other code..

    <?php
    header('Access-Control-Allow-Origin: *'); 
    ?>[/code:kwcmccz0]
    
    ..but this didn't work.
    Any ideas? Really stuck!
    Thanks
  • Okay, so I read the manual and various posts but I still don't understand where this needs to go:

    Does it go at the start of my index.htl file on the server?

    If so do i need to rename that to index.php?

    Do i make a new php file on my server?

    ...or something else?

    All the forum answers say I need to use this but none seem to say where it needs to go. Where does it go ?!?

    Please help.

    Thanks

  • I am using construct 2 to export html5 to coherent UI but when I do the transparent layers appear as black. Is this a known bug?

    I have used transparent layers in Coherent UI from other html5 software without issue.

Grimmy's avatar

Grimmy

Member since 20 Nov, 2012

Twitter
Grimmy has 2 followers

Trophy Case

  • 12-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

17/44
How to earn trophies