This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-11-28 15:01:30

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

|||| Panther file help NEEDED!!! ||||

Ok, with panther, how can I make it so that it writes data to the file in the same folder without the user having to manually input the root. Also, how do I make it so that if the file doesn't exist, it creates it again?

Thanks!


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

#2 2011-11-28 15:16:43

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: |||| Panther file help NEEDED!!! ||||

no idea...
try search in system-files, there should be something  hmm

Offline

 

#3 2011-11-28 16:09:58

flashgocrazy
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: |||| Panther file help NEEDED!!! ||||

Servine wrote:

Ok, with panther, how can I make it so that it writes data to the file in the same folder without the user having to manually input the root. Also, how do I make it so that if the file doesn't exist, it creates it again?

Thanks!

use a user path block http://scratch.mit.edu/forums/img/smilies/tongue.png
(you need to hit create a block button)
ripped off a random panther project (scratchchat 1.2 or somthing o_O)

Code:

name: user path
type of block: reporter (just put r in the box that has the - in it)
code:
^ ScratchPlugin primGetFolderPath: 1

have fun  tongue

Last edited by flashgocrazy (2011-11-28 16:10:33)


◕‿◕

Offline

 

#4 2011-11-28 16:10:05

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: |||| Panther file help NEEDED!!! ||||

If you don't put a path, just a file name e.g. file.txt it will automatically assume the file is in the same folder as the panther1.0.image file. That means it will then place the file there no matter where the image file actually is and this solves a lot of problems.

If you really want to know the root of the image file, opening up the containing folders to you, you can create a custom block that reports the root. It's in the library here.

Then you can do this: [write [] to file [(join(path to image) [file.txt])]

take a look through the library, there are a lot of useful Panther blocks there that you may find useful! The Scratch blocks can be converted most of the time in a few seconds to work with Panther too!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#5 2011-11-29 10:47:18

Servine
Scratcher
Registered: 2011-03-19
Posts: 1000+

Re: |||| Panther file help NEEDED!!! ||||

thanks! I figured it out, FINALLY.


http://bluetetrarpg.x10.mx/usercard/?name=Servine

Offline

 

Board footer