Check for folder/files

For questions about using Classic.

Post » Thu Sep 01, 2011 4:56 am

I know it's possible to check within the application for files and folders using the "File" object, however, what I am trying to do is check a player's desktop for files with certain traits. Sort've like a Psycho-Mantis-Metal-Gear-Solid scenario

For Example:

player overlaps a sprite, if the player's desktop contains a file named "let-me-in.txt", send player to "Layout2", if not, write text "Hint: bla bla bla"


Or something like:

player overlaps a sprite, if player's desktop contains a file named "square", and file height=file width, send player to "Layout 3"

stuff like thatWould I need to use Python scripting for this, or is there a "simpler" way?
Any ideas?
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Sep 01, 2011 7:28 pm

You can do that with the path and file objects.

ex:
+ File: File Path.Desktop & "let-me-in.txt" exists

I don't know about the "square" one, files don't have dimensions.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Fri Sep 02, 2011 1:04 am

hmm, much simpler than I thought! I was trying all kinds of insane stuff with the registry key object...

I mentioned the file size because on mac (i have bootcamp partition just for construct) file dimensions are listed for image types.

Thanks R0J0, i;ll see what I can do.
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Fri Sep 02, 2011 1:16 am

any ideas here??

the_chosen_byte2011-09-02 01:18:01
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Fri Sep 02, 2011 6:25 am

ROJO didn't mean to just type. He said to use the file object and the path object.
Add the path object to your app, then either type
path.Desktop
or click on the path object in the wizard and select "Get Desktop"
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests