How do I use "If Exists.." ?

Get help using Construct 2

Post » Mon Apr 24, 2017 9:12 am

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.
B
5
S
1
Posts: 65
Reputation: 507

Post » Mon Apr 24, 2017 5:30 pm

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.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Mon Apr 24, 2017 6:55 pm

you can do this alternatively
like
if score is greater than 0 then do anything
Image
B
72
S
41
G
48
Posts: 686
Reputation: 34,288

Post » Tue Apr 25, 2017 8:38 am

warville wrote: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
B
5
S
1
Posts: 65
Reputation: 507

Post » Tue Apr 25, 2017 8:43 am

luckyrawatlucky wrote: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
B
5
S
1
Posts: 65
Reputation: 507


Return to How do I....?

Who is online

Users browsing this forum: humanescape and 9 guests