Grimmy's Recent Forum Activity

  • [quote:1eqqr8ms]You can do it with the browser plugin's execjs action and expression. The only learning curve is dealing with quotation marks ("). You'll want to use single quotes instead ('), or use "" when you want to use a " in Construct expressions.

    This is all great. Thank rou. In your example I don't quite understand where you declare your 'myVar' variable though. Is this declared in an external .js file or something?

    Thanks for taking the trouble!

  • After just buying my C3 license and trying to load in an existing product, I just discovered this MAJOR issue.

    I have a JSON plugin that is core to my project and; as the JSON plugin is no longer supported, I'll never have it in C3 flavour. This of course means my project cannot be imported into C3.

    Not only that, but there doesn't seem to be any JSON plugins for C3 available. In fact, the C3 plugins page is extremely sparse even a year after it's initial release. Personally, there are some 3rd party plugin functionalities that are essential (such as the JSON one) and I'm gutted that C3 cant load them.

    Does anyone know any work arounds apart from just going back to C2?

    Cheers

  • okay thanks!

  • 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

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

  • Try Construct 3

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

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