Fengist's Forum Posts

  • I'm curious. Why not get your CORS header in the PHP file correct, get the referrer in the PHP script and just do this?

    + System: On start of layout

    -> AJAX: Request "http://www.zuzu.games/upload/our/get-content_NEW.php" (tag "partner")

    + AJAX: On "partner" completed

    -> Text: Set text to AJAX.LastData

    Seems like a lot of effort you're going through just to get a 1 or a 0 from a php file.

    Oh, and to solve your JQuery issue, I cheat. I just use this plugin:

    construct.net/en/make-games/addons/162/jquery-plugin

    That way, I don't have to mess with converting $'s.

    And here's an example I use for my CORS headers.

    //This attempts to grab the URL of the requesting domain (origin) using different methods.
    $http_origin = NULL;
    if (array_key_exists('HTTP_ORIGIN', $_SERVER)) {
     $http_origin = $_SERVER['HTTP_ORIGIN'];
    }
    else if (array_key_exists('HTTP_REFERER', $_SERVER)) {
     $http_origin = $_SERVER['HTTP_REFERER'];
    } else {
     $http_origin = $_SERVER['REMOTE_ADDR'];
    }
    
    //This is for testing. If no origin is found it displays a dump of the $_SERVER var to help
    //you figure out why. Once working correctly you can change the die() to provide a response showing
    //that the origin is invalid.
    if (!isset($http_origin)){
     var_dump($_SERVER);
     die("No Origin Server Error");
    }
    
    //This is also for testing purposes. It creates a small text file to list all of the incoming origins.
    //Once you verify the origins are correct, you can delete these lines.
    $myfile = fopen("origin.txt", "w") or die("Unable to open file!");
    $txt = $http_origin;
    fwrite($myfile, $txt);
    fclose($myfile);
    
    //And here's where I validate the origin against known good origins. In this case, the C3 preview
    //domain and my personal domain. You could validate this like you do in your script by comparing
    //the origin with a list from another URL. If the origin is correct, it sends the header saying
    //the origin has permission to use this script and that it can POST.
    if ($http_origin == "https://preview.construct.net" || $http_origin == "https://www.twistedvoid.com") {
     header("Access-Control-Allow-Origin: $http_origin");
     header('Access-Control-Allow-Methods: "POST"');
    }

    And thinking about it, you could just use this as your test of valid partners. If they are a partner, the Ajax request would send back no errors and the On "partner" completed request would succeed. If they aren't a partner, then you could test for the Ajax.OnError("partner") and it would be true.

  • And if I can make the games mechanics understandable just through gameplay, it’s always more preferable to a wall of text or diagram. Obviously it’s difficult and relies on

    allot

    of feedback but at the end of the day, I believe it makes a better game.

    lol, you did it again.

  • Found a potential cause of the issue. Some of your block sprites don't seem to have the collider in the right place. Here, I'm able to put a scrap behind a block.

  • Correct. However you are not using it in that context. You are using it to indicate value.

    vocabulary.com/dictionary/a%20lot

    And I'm easily able to duplicate the bug by slamming into a wall. The collect scrap vanishes.

    *edit*

    Not sure if they're going behind the wall or vanishing as intended. One suggestion is that if the vanishing is intentional that you add in an animation and sound to confirm to the user that they were destroyed. As it is now, they just disappear without explanation.

  • unless these are intentional, the grammar police will be visiting you.

    allot is not a word : a lot is correct.

    propper : proper

  • Don't think you can.

    I know with Chrome they prevent that and require the user to actually click on something before going full screen.

  • Just thinking about it, there may be another option you want to explore. I'm currently working with an old php script called fusion news.

    sourceforge.net/projects/fnews

    Three things attract me to this old program.

    1. A WYSIWYG editor.

    2. The ability to display formatted news by calling a single php file.

    3. I've integrated it into a C3 project whereby with an Ajax call, it displays the news inside C3.

    It may take some work with php and html to get it the way you want, but in theory, it can display the same news on both a website and inside a Construct project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's also a way to turn on the classic editor from within Wordpress. That new Gutenberg editor is a piece of non-intuitive junk. It works, but only if you don't know what a real editor is supposed to do.

  • Originally it was designed for blogging. Since, it's evolved into something much, much larger. If it's a bit overwhelming, take a look at other content management systems (cms) like Joomla or Drupal. For what you're wanting to do, a CMS is probably the right direction.

  • Why not just use Wordpress?

  • Yes, you can do this. However, both of the questions you've posed recently revolve around external websites (Google, Twitter, etc.). The best way to do this IMHO would be to create the page yourself using HTML and CSS and use an Ajax call to load it into this plugin:

    construct.net/en/make-games/addons/190/html-element

    Then, send the contents of the form back to your website.

  • The main issue I see here is the lack of a simple way of layouting various elements. A better way of controlling their placement. (As Fengist also pointed out)

    You proved your point even better than you imagined...

    I had to disable the 'worker' which crashes any project on my laptop.

    Failed to load texture: ReferenceError: document is not defined
     at C3.Gfx.WebGLRendererTexture._CreateStatic (texture.js:1)
     at C3.Gfx.WebGLRenderer.CreateStaticTexture (webglRenderer.js:1)
     at Object.func (webglRenderer.js:1)
     at c (asyncify.js:1)
     at b (asyncify.js:1)
    (anonymous) @ imageAsset.js:1
    Promise.catch (async)
    LoadStaticTexture @ imageAsset.js:1
    LoadStaticTexture @ imageInfo.js:1
    LoadTextures @ type.js:1
    LoadTextures @ objectClass.js:1
    _Load @ layout.js:1
    Start @ runtime.js:1
    Init @ runtime.js:1
    async function (async)
    Init @ runtime.js:1
    self.C3_InitRuntime @ runtime.js:1
    a @ 0e643a61-99d1-4bba-81d4-a8b8db3efbaa:1
    (anonymous) @ 0e643a61-99d1-4bba-81d4-a8b8db3efbaa:1
    
  • My experience with RPG maker is that everyone spends all their time writing their own GUI because they don't like the GUI the engine comes with. Most of the addins (like Yanfly) start by undoing the GUI. If you look at what is requested on their boards it is about the same here--they want a user interface--just not the one they get with the game engine.

    UI's should be unique across games and apps. The UI is the first thing the user sees and therefore makes the first impression. No plugin or hard-coded UI element is going to satisfy everyone. However, there are basic elements to any UI that are severely lacking in Construct. These elements, like panels and scroll boxes form the basis of UI's. As it stands, we only have the simplest of controls, buttons, text boxes, etc., controls that are related mostly to user input. Nothing exists to help manage the placement of these controls and, in my case, I have to run through every single control each time a layout is shown or the browser gets resized and manually move and resize them to what I want.

  • Fengist - I think you missed the bit where I wrote this:

    > ...I'm just trying to find a way of doing it that doesn't oblige us to do a lot of wrapping around low-level JavaScript APIs. Construct is generally much more high-level than that, for example giving you Sprite objects, not just an OpenGL vertex buffer to fill out.

    No... I was writing the reply, got distracted with a customer, came back, finished and posted it and then saw your reply. I decided to leave it so you'd know at least what's in my head.

    It's good to know though that you haven't strayed from your original concept.

  • If you think moving to unity because you have to write a bit code in construct is going to speed up your development time you gonna be in for a surprise...

    I spent years working with Unity and yea, it's a huge pain in the ass. Especially when the latest version comes out and breaks half the crap you created in the previous version. The reason I chose Construct for my latest project over Unity (and this was weeks of internal debate) is because of the plethora of code and finite details I'd have to wade through in Unity to accomplish the same task. That and the fact that the Scirra team actually communicates with it's customers, something Unity has yet to embrace without charging for it.

    However, if I'm going to have to wade through code anyway finding workarounds to a limited set of UI elements...