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

#26 2009-09-12 03:37:44

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

So it's 2.6. Actually, I made a console logo for this:

Code:

print "_/_/_/_/  _/_/      _/_/  _/_/_/_/  _/_/_/_/        _/      _/      _/_/_/_/"
print "_/        _/_/      _/_/  _/        _/      _/      _/      _/      _/      _/"
print "_/_/_/    _/  _/  _/  _/  _/_/_/    _/      _/    _/  _/    _/      _/      _/"
print "_/        _/  _/  _/  _/  _/        _/_/_/_/      _/_/_/    _/      _/ 0.1  _/"
print "_/        _/    _/    _/  _/        _/      _/  _/      _/  _/      _/      _/"
print "_/_/_/_/  _/    _/    _/  _/_/_/_/  _/      _/  _/      _/  _/_/_/  _/_/_/_/"
print ""
print "Easy Programming --------------------------------------------- by Emerald Team"

It's ready to paste in program.


Converting my Scratch projects to Python!

Offline

 

#27 2009-09-12 03:44:52

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

Also, we can make a GUI for Emerald using PyGTK...


Converting my Scratch projects to Python!

Offline

 

#28 2009-09-12 09:26:25

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

1. Idk
2. I think we should just keep it as it is, I can make those too but I didn't bother to put it in.  wink  I could just take the logo and make it show up at the beginning.  tongue
3. And where would I find that?  tongue

I'm using Python 2.5 so most people should be able to use it.  wink

Offline

 

#29 2009-09-12 10:14:14

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Emerald

There was a module named py2exe that could convert a .PY file into a .EXE file, so anyone could read it, and they wouldn't need python.


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#30 2009-09-12 10:33:32

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Emerald

The thing you're doing wrong is you don't define an object to the file.
Oh, here it is. It's like this to read a file:

Code:

my_file = open('my_notes.txt', 'r')

'r' stands for read. You should just leave the file in the same directory as the program.

Code:

my_file = open(my_notes.txt', 'a')

'a' means Append, or to add on to a file.
You'll get an error if you try to append to a file that's blank.
However:

Code:

my_file = open('my_notes.txt', 'w')

If the file doesn't exist this will work, but be careful,  because when you write a file it replaces all the contents with what you wrote.

Code:

my_file = open('my_notes.txt, 'a')
my_file.write('\nSpend allowance')
my_file.close()

This appends to a file. You need to close a file after you're done using it.

Code:

my_file = open('notes.txt', 'r')
my_line = my_file.readlines()

This reads the whole file and makes a list(my_line) with each line an item in a list. THAT'S what you're looking for!

Last edited by Greatdane (2009-09-12 10:35:54)


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#31 2009-09-12 11:17:21

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

I've been reading a book I know. Hmm...Would this work?

Code:

program = open("program","r")

How about you do that coding?  smile

Offline

 

#32 2009-09-13 02:55:16

filo5testing
Scratcher
Registered: 2009-08-17
Posts: 63

Re: Emerald

Well, this would be file without any extension, plus, I thought we're gonna save things to XML-like files (you know, the file that links sprites with their scripts), and if so, we're gonna need XML for Python (I think it's already there). Plus, I have Python 2.6 (2.5 is sorta outdated), and I recommend you to upgrade yours to 2.6.

That XML based file should be simple, like this one:
<emerald-program name="standards test" author="emerald team">
<author-trackback>
<author version-created="1">Magine</author>
<author version-created="2">filo5</author>
</author-trackback>
<stage>
<sounds>
<sound name="emerald-ping">/files/stage/sounds/emerald-ping.ogg</sound>
</sounds>
<costumes>
<background-costume name="(default)">/files/stage/backgrounds/white.gif</background-costume>
</costumes>
<script-file src="/scripts/stage.ems">
</stage>
</emerald-program>

---> file extension: .EMERALD or .EML


It is proven that practising random acts of kindness helps you live your life easy.

Offline

 

#33 2009-09-13 03:10:31

filo5testing
Scratcher
Registered: 2009-08-17
Posts: 63

Re: Emerald

The EMERALD file tree: <this is folder>
program_name.eml
<files>
  author_traceback.eml
  <stage>
    <sounds>
      emerald-ping.ogg
    <backgrounds>
      white.gif
  <scripts>
    stage.ems

EML stands for Emerald Markup Language. All of it will be stored in a ZIP archive which will have .emerald extension (though it's still a ZIP archive).

Also, some ideas for syntax (and default syntax coloring):

`variable`
^parameter that script is called with^
Object_with_script_to_be_called::script_to_be_called [parameters: ^parameter1^="LOL"]; //notice the semicolon - required to end the command (inherited from C-family) (it's a comment - formatting inherited from C-family)
script "script_to_be_called" [parameters: ^parameter1^] {
   //that script's body
} //end - those braces were taken from C-family.

Last edited by filo5testing (2009-09-13 03:12:14)


It is proven that practising random acts of kindness helps you live your life easy.

Offline

 

#34 2009-09-14 07:21:02

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

I have no idea of what you're talking about, but how about .erd for extension?

Offline

 

#35 2009-09-14 09:21:10

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

For what? The project file? Because I think it's the best thing to do like in my 2 previous posts, but it may be .erd instead of .emerald extension, but you should keep the .eml for project descriptors (but then the .eml extension for saved emails will be invalidated...)


Converting my Scratch projects to Python!

Offline

 

#36 2009-09-14 13:34:40

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Okay, but I'll still need help to understand what you're talking about.

Offline

 

#37 2009-09-15 09:34:56

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

Imagine as emerald project as a compressed folder (eg. ZIP file) - and it has a structure like this one I mentioned before. And there must be a file that tells Emerald script runner where to look for files, and the best language for this is XML-based thing (XML stands for eXtensible Markup Language) because it's implemented widely in many programming languages. An example XML tag looks like this:
<tag thing="value">inner value</tag>
Or like this:
<tag thing="value" />
That /> means the tag has no inner value.

So, extension for project file would be .erd... Wait, if it's hidden from user, why would we need a specific extension for project "descriptor"? We'll just leave the .xml thing...


Converting my Scratch projects to Python!

Offline

 

#38 2009-09-15 20:15:27

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Okay, but I think Ima stick to Python.  smile  Maybe once I get a new computer and get all the things I want on it instaled I'll try C/C++/C# or any other programing languages.

Offline

 

#39 2009-09-16 10:07:07

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

But I think Python can import DLL libraries as objects, so I can write DLLs in C#...

I weren't talking about any pythons there, I was just trying to propose a project descriptor file standards. We'll gonna need it when we start to make it graphics & stuff. I personally think that it's the best way to make it from existing standarts, and thus, .erd file will be the same like .zip file but with other extension; and for project description (needed to tell program where costumes, sprites and scripts are), I think we'll need a good data storage files. XMLs are light, powerful and implemented in almost any programming language possible. Take a look at this:
http://img269.imageshack.us/img269/7862/emeraldfilestructure.th.png


Converting my Scratch projects to Python!

Offline

 

#40 2009-09-16 12:05:15

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Emerald

i wouldn't mind doing the guior that stuff, but how do i do it? Iv never really been told how... or seen it done


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#41 2009-09-16 15:29:20

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Just make images, Make a GUI like Scratch. But take out the blocks and that type of stuff, not the costume area and sounds.

Offline

 

#42 2009-09-17 15:25:48

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Emerald

At first, we need a cool icon for Emerald. Let's say we could borrow Ruby's for a while (of course I'll do a trick to make it green), or something like that. Or, markyparky, if you could, you can draw a rough copy or concept of the icon and post it here. I don't have experience in icons, but I'm sure we could figure out how to make that icon an icon.

Magine, do you understand what I was talking about in my previous post? Let's say, that a DLL file is like a set of classes exported to another file, waiting to be used. And now, Python has ability to import DLLs and treat them just like sets of classes. And of course, those classes are not just simple classes; with those all things available for .NET apps, including DirectX, GDI+ (you don't have to understand what GDI+ is, and I'm sure you've met DirectX somewhere) and of course Windows Forms (I mean windows, they call it forms). And if you somehow manage to get .NET DLLs working with Python, I think I'll start to make them. The first one could be simple class(es) for easier Emerald-XML handling.

As for blocks, I'm sure they won't look like Scratch block. Just give'em some shine up!


Converting my Scratch projects to Python!

Offline

 

#43 2009-09-17 16:22:13

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Actually there won't be blocks, just text.  smile  and yes I think I understood what you meant in your old post.

Offline

 

#44 2009-09-18 08:07:58

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Emerald

My school has a program in their programming folder, called GreenFish Icon Editor Pro. You should get that, or i could do it at school?

Magnie: Ok, ill start working on it as soon as i can. Would editing the scratch one be ok, or a completely new GUI? i would suggest editing the original, it would help people be able to know their way around it.

edit: Do i have to save it as a certin file type? Like an image file?

Last edited by markyparky56 (2009-09-18 08:39:31)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#45 2009-09-18 08:49:05

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Marky: Yes, like that one.


Off: I'm learning how to get images in! But, now the text, this is so hard.

Offline

 

#46 2009-09-18 09:17:35

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Emerald

kk... ill start. Thanks!

Edit: Should there be an erea to show how to do certin commands?

Last edited by markyparky56 (2009-09-18 09:28:30)


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#47 2009-09-18 09:30:08

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

Idk, lets just make a script area, where everything is happening, and buttons.  smile

Offline

 

#48 2009-09-18 10:21:12

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Emerald

ok, another question, is there any writing, or is that all added in with the programing part?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#49 2009-09-18 12:21:35

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Emerald

There might be writing.  hmm  I just found out how to add items to add GUI, but it's EXTREMELY complicated, or at least the changing stuff, I have a new idea just now, but now we all need PyGame now.  sad  I'll keep looking into this.

Idea: Program in non GUI and animation and stuff in GUI. Just make a box, how about that?  smile

Offline

 

#50 2009-09-18 12:23:18

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Emerald

i dont understand the idea part, but ok...
ill try out the pyGame


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

Board footer