CrazyVulcan's Recent Forum Activity

  • DUTOIT Thanks, I believed that Webmatrix had its own built in settings to allow me to use ASP.Net MySQL and various other programs like a server that I just ran from within the application itself. I was wrong about that.

    I now have XAMPP 3.2.1 using Apache to set up my own network archetecher. I guess I knew that was what I should have been doing in the first place but I had believed that I was not at that point where it would have been necessary.

    I do not have a issue exporting my game to HTML5 and running that but using preview would have been nice. A few more days to get everything working like I want it and I should be able to get back to working on something game related.

    Thanks again DUTOIT for your help and that tutorial really helped a lot. This winter when there is a game to actually play I will repay everyone who helped.

  • Hello,

    Is it possible to embed a browser (object type) in a game ?

    I've made a game that I published on a plateform (I didn't used C2 to create it) but I would like to embed it in a C2 game to add arrows and jump to play it on phone and tablet.

    H**p://db.tt/IaT63RDD

    Do you know if it is possible ?

    Thanks

    So you have a game that you made in a previous program and want it to run and add things to in C2? I fear that you have two options

    A > remake the game in C2 and just put that on various platforms useing the export feature

    B > Look for a ifram plugin in the "Complete Addons" below and put that into your layout in C2, the catch is that you can not change anything about the old game within C2 since all you are doing is having a window inside a C2 layout.

    But if you wish to import your game into C2 to continue working on it on this platform, I am afraid that it is not possible. If it is a simple game your probably will be surprised how few hours it would take to remake it.

  • I have a straight forward question that I need explained to me in detail about AJAX

    Not including the file in my project folder how do I compose the "http// " string to get exactly what file I want?

    I have this basic folder structure in my asp.net folder using webmatrix

    localhost:7777
    MyCoolWebsite
         My Exported C2 Game
              imagesfolder
              index.html <this is my game
         App_Data
              config.php
         index.html
         MainCSS.css
    
    <><><><><><>
    MySQL database
    
    PlayerData
    MyData_Table
    [/code:1v2vo90q]
    
    After exporting the whole game to the C2 game folder I can not seem to connect to the config.php file. Inside C2 I have a AJAX request looking for that file only I can never seem to find what I am looking for. And not being able to do this inside C2, I have to export the whole file and clear my cookies from chrome every time I need to test a change. Understandably I am rather frustrated by this. 
    
    What do I put into the URL box?
    
    A>"http//localhost7777:App_Data/config.php"
    B>"../App_Data/config.php" <<i.e. do I have to go up a directory form where index.html of the game is?
    C>"http//localhost:7777../App_Data/config.php
    
    I know it is not any of those above because I have tried them, Please help as I have been trying at this for the better part of 6 months at trying to get player data to work. bouncing form CSV, JSON, MySQL
    
    I just want a answer. 
    
    Thank you for your time in this.
  • Integrating a SQL Database into C2,

    Howdy, After two days of bingewatching tutorials around the net on PHP and SQL I now actually understand how they work, somewhat

    Ok so back to working on my game I now in my project file folder have a .php script and the website itself is within a webmatrix3 project. In that I have a Database that has about 20 officers listed with all there stats and info. My goal atm is to have C2 reference that Data base to populate a info card with all of each characters stats.

    So I have a DB smiler to this

    Master_Officer_List
    
    Officer_ID    | Name | Rank        | Strength | Speed | Cost | Unlocked|
    01               Bob        Captain        3                  2          10          True
    02               Mark      Ensign          2                  1           5           True
    03               Sue         Admiral       2                  1           15         False
    04               Liz           Captain       1                  2           10         True
    [/code:10rohfxk]
    
    Now to make this card I have a tile set where each tile is associated with the ID value in this DB. Under that Is the Name and Rank of that person and off to the side is each stat [Strength, Speed, Cost] And It will only show the officers that are unlocked, marked True. C2 will do a For Each loop and make a new card under the first till we run out of things on the list. 
    
    Going though the SQL DB is easy enough all I need it to say is
    
    SELECT Officer_ID,Name,Rank,Strength,Speed,Cost,Unlocked FROM Master_Officer_List WHERE Unlocked IS True;
    
    But as always getting this integrated into C2 is proving not so easy. I know that I can upload a PHP file into C2 and using AJAX I can pull data from it bout no matter how much I look though this tutorial [url]https://www.scirra.com/tutorials/721/lennaerts-php-mysql-multiplayer-tutorial[/url] I do not understand how my PHP script should look.
    [code:10rohfxk]
    <?php
    $servername = "localhost";
    $username = "username";
    $password = "password";
    
    $conn = Master_Officer_List ($servername, $username, $password);
    
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    } 
    echo "Connected successfully";
    ?>
    [/code:10rohfxk]
    
    From the login portal on my homepage there is a login form for username and password and a table in my database for just that info [username, password, contact_email] and in my C2 game I have a username global variable.
    
    Ideally I would like to have when a player creates a account that my website will make a new table titled username_Officer_List.sql that they can then wright data to as they progress and unlock/perches items.
    
    I am makeing progress but I just am not seeing the big picture, or more how big picture is connected from all the little pictures
  • OK so above where I mentioned that though my computer is x86 but C2 is version 200x64, somehow. After installing my plugins to my Construct 2 x64 folder path it works just fine. Strange Did not know I could even do that.

  • Hello,

    After a complete reset with my Win7x86 OS I am now unable to use my C2Personal with any added plugins or behaviors. Originally I tried to move the entire steam folder to a flash drive and then back to my program files folder after reinstalling the OS. However now even though I can launch C2 and use it just fine all my extensions are now no longer visible to the program.

    For example I use a lot of Rexrainbows plugins in my games and he provided a app that auto installs his extensions to the necessary folders. But when I launch and try to open my capx a error pops up and says that I need to reinstall a number of plugins to get the game to launch. The same is true when I manually install a plugin.

    Also when I create a new project and try to add a object they will not show up in that menu.

    To try to fix this I have; Reinstalled C2 though Steam, Verified Integrity though Steam, Rebooted before reinstalling C2, Logged out and back into Steam, Complete reinstall of Steam.

    I am currently using Windows 7 Basic x86 SP1

    Strangely it is saying that I am running release 200 x64 bit could that be a issue? Certainly having just reinstalled though steam it should be the latest release?

    One last thing if i try to run C2 form withing my steamapps folder it wants to install C2 Free. Now I originally installed the free version to test C2 but that was more than a year ago so I should not come up like that and instead should launch C2 Personal. And yes C2Personal is what is installed.

    I cant really provided a capx as it is C2 its self that is the issue.

    Thank you for your time in reading and replying to this

    CrazyVulcan

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So save the json data into a mysql database entry

    User Id | Userdata string

    The url is a post/get system it can send the id to a php file which retrievs the data string shouldn't that work better having it saved in a database vs tons of json files lying all over the place

    DUTOIT yes that is my eventual goal, and my trouble is not making a form to store the json's. More that once they are in the database how do I "see" them with ajax. What exactly do I need to put in that url to find the specific json I am looking for.

    I need to learn how to have C2 find that string. My thinking is to have a javascript in the head of the index.html file of my game that will pull the table based on the UserID that the player has after they log in. My homepage has, like others a log in form at the top left and after they successfully log in that is replaced with a nice big img they click on the launch the game. The C2 game is then launched in a new window. Having the script inside the head of my game html should pull the needed json...however I am not exactly comfortable poking my html page for fear of breaking it. That and java script is still on that to do list of learning.

    There is always this https://www.scirra.com/store/game-making-tools/c2-data-editor-124 I am writing Mr Gibson a pm to inquire about if this is the right tool for me and if he has any advice that will help me. And for $29.99 it will be worth paying to alive me of this headache.

  • Edit: You need to import you json file into your project.

    From what I understand.

    You want to get data in a json file into your game using ajax?

    In your projects window you want to import files - in your case it would be your json file. It will now save it allong with the c2 icons. If you save project as project you will see it there. And you can edit it directly. {C2 saves as single or project, project allows you to edit files within the folder structure directly}

    Ajax is simple. You request a file dropdown will list files you've imported and tag it with a easy to remember name "MyAwesomeData"

    The trick is ajax on "MyAwesomeData" completed, this means it has all your juicy data.

    Now you can load from json string using AJAX.LastData to either array or dictionary ect.

    Ajax request "your json file you imported into project"

    Ajax on completed, load json string ajax.lastdata.

    I don't know if this will help: load data from json into array

    So, import you json file into the project. and it will save it under Files folder

    Hi DUTOIT

    Unfortunately my project requires that I be able to edit and replace elements of that JSON and then post them back to a file that is unique to each player. While I have been successful in loading it as a project file as you have described above C2 will not allow you to post changes back to the project file. And I can not use web data as this game will involve a in app store and having that data stored local on a players computer leaves too much to be tampered with. I cant have cheaters ruining my game for not only dose it hurt the paying player but that is money lost

    I need to work out how the URL works and how it will find the exact folder I want. I have the cross domain problem solved with a tool for chrome and am able to deploy this site to Azure. But I am stuck on the exact path the AJAX looks up. I can have "http://localhost/PlayerData/"&PlayerID&".json" That PlayerID is a global variable that will allow me to call their own files. Which will be stored in a database table and when you login to my site it will make a MySQL call and get that JSON in question.

    But I appreciate the help.

    Just got back from work and am trying to remember what I was working on before I left. I believe I was researching the 404.3 error and doing something with enabling IIS on my computer or something like that but I really don't want to leave myself open to hacking.

    Any one familiar with Webmatrix3? Im thinking about asking on their forum but am trying to see if I can not solve my issues first. They most likely will know nothing about Construct any way.

  • https://www.dropbox.com/s/vhx888s3cpvtuj8/WebDebugAJAX.capx?dl=0

    https://www.dropbox.com/sh/yfum8cnri1vzmoc/AACwvUPc0vqiFC6HDDak2ju7a?dl=0

    It's whatever the root folder for your server is configured to. It depends what server you are running. Basically it's the folder you're exporting your project to. If that top-level index.html is at http://localhost/index.html then the JSON file would be http://localhost/UserData/MyData.json.

    I really need to quite my day job so I can focus on this game dev shtick full time.

    So have you ever done something that you have tired to do for a good amount of time and then call it a night after feeling good. Only to come back a week later and have no idea what the hell you just did? Well now I do because I have managed to get the AJAX to see my file but then now after coming back to it, it will not work. Above is a Dropbox link for my capax and a folder that I am using for a web site. the package.json is the file I am trying to call but for the life of me I can not get the plug in to find it even though I have it sitting in the same folder as my index.html for the C2 Game.

    Here is my event sheet, ignore the Big A as that is just something I change the color of to see if my update was successful. The capax is a new file that has been striped of all the fluff not related to AJAX.

    https://www.dropbox.com/s/ug4otfz4210tvp4/C2error01.png?dl=0

    https://www.dropbox.com/s/ard8964th040wp7/C2error02.png?dl=0

    Some guidance would be most welcomed. I am mostly sure that my URL for the AJAX is wrong. That and I see that a Error 404.3 involves needing to set a MIME type but I am haveing toubble finding on what that means and what I need to do. Also there really is not a guide in this site that plainly says for a AJAX you must do A>B>C and for me that is really hard because I feel that this is something so simple to under stand that no one has felt the need for such a tutorial.

    ps what happened to being able to post attachments?

  • OK I have a interesting issue as I dont seem to understand how pathing works. After much effort I have finally managed to get WebMatrix and Google Chrome to run locally and now don't need to upload to a external server every time I wish to run my game. Now there are just two things left for me to understand and then I feel I can move on.

    First, I have managed to use AJAX and get it to load a JSON from my project file just fine and now need the next step. I need to be able to pull this JSON from a folder that contains the website, C2 Game, and the database. Currently my folder hierarchies looks something like this

    [My Game]     [Images]
         index.html
    [UserData]
         MyData.json
    index.html
    gamewindow.html
    mainCSS.css
    gamewindow.html
    [/code:3t27umc3]
    
    So naturally my site launches index.html and there is a link that takes you to gamewindow.html that has a iframe embedded to play index.html form within the folder [My Game]. Right now my game plays just fine but I cant seem to figure how AJAX finds the MyData.json in the folder.
    
    I have tried
    "http://localhost:50000/Debug.json" As well as "http://localhost:50000/Desktop/MyGame/UserData/Debug.json"
    "http://localhost:55707/Debug.json" (which is the port number showing up when I look at my website in WebMatrix. My thinking is that since the game index.html is in a sub folder and I need to get at a different folder I have tried "http://localhost:50000/../UserData/Debug.json" So what is it that I am missing? Where dose the file path start. I have looked over the tutorial [url]https://www.scirra.com/tutorials/393/ajax-in-local-preview-on-localhost50000[/url]
    
    His example simply says "http://localhost:8080/scirraTest/myGame/xml/dataIWantToGet.xml" But where would "scirraTest" reside? The Desktop? the C:drive?
  • CrazyVulcan

    That's because C2 expects a string, a string in C2 is some characters (or none) surrounded by double quotes (")

    Problem is, what happens if you want you string to contains double quotes?

    Answer: you need to escape them.

    How to escape them?

    some languages use \" C2 use double double quote ""

    As a small remark, C2 isn't THAT weird in this area, you also do that if you want to escape double quotes in verbatim string literals in C#

    http://stackoverflow.com/questions/1928909/can-i-escape-a-double-quote-in-a-verbatim-string-literal

    Now, one way to avoid this messy escaping is to put your pretty json inside a file you import in the project, and you get retreive it using Ajax.

    Thanks Yann, sure enough using AJAX did the trick. Quick question how big a JSON file can your plugin handle out of curiosity? Im sure I will find out but in my game each player has the ability to unlock various things as well as saving user created items that they can use later. I would love to just put all of it in one JSON using various tables if posable. Dose that seem doable?

  • If you are putting the JSON into the C2 event sheet directly it has to be a string enclosed in quotation marks and so you have to escape any quotation marks inside the string with an extra pair. That's fine. If you load the JSON from a file, you don't need the extra quotation marks.

    Thanks ramones, AJAX is still something I am trying to get a handle on. I have the next two days off so I intend to get this nailed down by Thursday. Is their a particular way C2 wants to JSON formatted when it is brought in through AJAX? I have tried putting in a file in my projects folder and using Yann's plugin just use that to load the JSON. It however gives me errors when I try it. I will try to post a capax of what I am saying. That should help.

    I have tried pulling the file as both a .txt and .json with little success though in my browser preview debug I did see where AJAX managed to load the text. But getting that text to work with that plugin has been a we bit of a headache.

    Do I just have a .txt file with {"ThingOne":{"A":"1","B":"2"},"ThingTwo":{"Y":"1","Z":"1"}} ?

    I promise once this clicks I will wright a nice in depth tutorial about handling JSON as I can find little on it. This either means its not a common thing or its so simple that most assume that everyone knows it.

    !-- Edit

    Yey ok so I managed to get the AJAX to load into the JSON Plugin. Don't know what was not going right. Maybe just needed to look at it with tired eyes after a long shift, usually when I do my best work anyway.

CrazyVulcan's avatar

CrazyVulcan

Member since 22 Dec, 2013

None one is following CrazyVulcan yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies