ErudioLtd's Recent Forum Activity

  • I am developing a game in which the user is able to enter words which will then appear on placards during gameplay.

    I don't want to limit them on how many characters they can use and so would rather the text scale to fit the placard no matter how many characters (within reason).

    I know there is Rex_Text_resize plugin but this doesn't seem to be loading in for me (getting error reading " 'GetPluginSettings' global, but it is not a function).

    All advice appreciated.

    Thanks

  • you can do this alternatively

    like

    if score is greater than 0 then do anything

    I'm not too sure what you mean.

    The basic idea of what i want to do is:

    1) Be able to save a set of words in a text file and also save the sets name defined by the user. (done)

    2) Be able to change the drop down menus names to what the person has named it.

    3) Dont show the save slot on the drop down if no set has been saved in that slot.

    Thanks for the advice

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i think you are having a confusion here , local storage is not your files and folders , local storage is like a dictionary ( a register ) but the values are saved in a browser session so the next time you run the game the values are still there, and it is used for saving high scores, user data, etc . it has nothing to do with files and folders.

    Hi, I now realise this is saving values rather than files. I have attempted to save a value to SaveFile.AsJson and then on start up check that the value exists and then to add something to the drop down menu.

    Is there a way to use Ajax to determine if a file exists or not?

    Thanks for the advice

  • I am attempting to use the local storage action to check if something exists and then "if exists" add something to a drop down menu.

    I am telling the action to check for "NWJs.Appfolder&Save1.txt" but it doesn't seem to be working correctly. Is this the correct format for the path in regards to if exists actions?

    If not i would greatly appreciate any advice; if it is, i must be doing something else wrong but at least i can rule this out.

  • Cheers Buddy.

    Decided in the end just to save directly to NWJS.Appfolder instead as the game being marketed at schools and stuff and they probably not happy to have stuff saved in different folders.

    Thanks a lot though.

  • The project files get compressed into package.nw file (html5 export just has the files uncompressed in the root folder).

    Cheers, realised this shortly after posting and used the URL request instead

  • You can store array items in a json file (just rename with *.json instead of *.txt) in the following format:

    {

    "c2array":true,

    "size":[5,6,1],

    "data":

    [ > [[0],[1],[0],[-1],[-1], [0.5]],

    [[1],[0],[1],[0],[-1], [0.5]],

    [[0],[3],[1],[3],[-1], [0.5]],

    [[1],[3],[0],[3],[-1], [0.5]],

    [[2],[3],[2],[3],[-1], [0.5]],

    ]

    }

    You can make the data items what ever you want, of course.

    You can make the array as big as you like and even turn it into a 3D array by adding extra items within the inner square brackets, just make sure to adjust the size values at the top.

    Import the file into the files folder for your project on the "Project" tab.

    Add an array object to your game (e.g. yourArrayObject)

    Add the AJAX object.

    System|On start of layout: AJAX| Request (your json).json (tag "your tag")

    AJAX | On "your tag" completed: yourArrayObject|Load from JSON string AJAX.LastData

    This will grab your json array and add it to the array object - I don't think you have to stipulate the size of your array object - it should automatically fill up from the json - but it probably doesn't hurt to set the dimensions the same.

    Hope that makes sense!

    Thanks, this is great advice for anyone looking to use Arrays to do things like level editors and RNG based card games. Thanks a lot. (although i didn't need to use this as i realised i didn't need an array to do what i wanted and could just load in the things I wanted and use them as they are using AJAX.)

  • I want to be able to read 22 words out of a text file to set as variables to use in a card game.

    I have a set up that allows me to take a string that I have saved out to a text file (of 22 words) and separate them.

    is there a way to have a similar set up with and array and AJAX but store more than 9 things?

    Thanks,

    All advice appreciated.

  • is there a way to edit project files within the project?

    For context, I want to be able use in .txt files in the project to allow the user to save/load word sets in.

    To do this i want to use the ajax plugin to read project files and use the string contained in those files to fill some variables.

    Is there a way to tell the program to load in a text file to read from or does the .txt have to be a project file to be used with AJAX.

    tl;dr

    How can i allow the user to edit project files (.txt)?

    Thanks

    All advice appreciated

  • I am using a .txt in the projects files folder to set some variables (to act as a method to save sets of words).

    I am wondering if there is a way to edit/write to these files through the program (user creating sets of words).

    All help welcomed

    Thanks

  • How do i determine the sub folder? Just with a "\" ?

    Tried with an "&" but didn't change the path.

    Thanks

  • I want to use AJAX to load in some text from a .txt file.

    To do this i have added the txt to the files folder on construct 2.

    When the game is played (NWJS) how will this work?

    Do i have to create this .txt inside the games folder for it to read?

    Ant help greatly appreciated.

    Thanks.

ErudioLtd's avatar

ErudioLtd

Member since 21 Jun, 2016

None one is following ErudioLtd yet!

Trophy Case

  • 8-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies