Some more questions/suggestions:
Will it be possible to have functions as types so that you can pass functions as parameter?
If 1. will be possible: Will it also be possible to define anonymous functions (lambda expressions in python) or nested functions?
What happens if you take an item out of the list and cast it to a wrong type? Will there be a dynamic type check or is it just the responsibility of the scripter to get the types right? Will it be possible to cast objects to ints so they can be stored in a units custom value?
In your example are some argument_null_exceptions. Maybe it would be better to not have null in the language. This would make all these checks needless. For cases where null is needed there could be a special type. For example it could look like this
unitz=null// compile errorunit?z=null// okunit?[10]units//question mark = this type is nullable//...unitu=units[3]//compile error, wrong typeunitu=units[3].Value// use "Value" to get the actual value, exception when value is nullifunits[3].HasValue:unitu=units[3].Value//now it is safe to get the valueunit?v=u// automatic cast to nullable typelista=newlist()list?b=newlist()// ....a.add(1)// cannot throw nullpointer exception because a cannot be nullb.add(2)// can throw nullpointer exceptionb?.add(3)// safe invoke, no exception is thrown if b is null, it just has no effect
This would make the language more complicated but a lot of functions would look nicer without null checks. For the first versions of the language you could just include the syntax as a kind of annotation for the programmer and later add the type checks. At least for non primitive types this should be no problem.
Currently functions as parameters and anonymous functions will not be implemented. Maybe later, if I get the time. If you want, you can implement it; after all, the project is open source.
It is the responsibility of the scripter to cast correctly; if casted uncorrectly, the value will be null. Casting a class to int will be possible.
Nullable types will not be implemented and null will remain in the language.
The project is coming along, too - I just recovered my computer from a harddisk fail, and I am working on Grape once again. Working on getting the code generation to compile with the new AST, then I will implement the Grape package for Moonlite and then implement the code generation.
Yeah, exceptions will be hard to implement, but I think it'll be possible. Since I can check whether a method contains throw statements and catch statements at compile time, I should be able to generate code based on that. I can then produce debug messages if an exception isn't caught in a parent method.
And yes, I had thought about the maximum number of iinstances for each class user specification (or rather, s3rius had) - it does indeed exist in Grape. This is how you specify a custom class size:
I would like to introduce to you a programming language that I am working on named "Grape". It is a minimalistic programming language for StarCraft 2, and is not an extension to the Galaxy language. This means that there is no backwards compatibility to Galaxy; no need to make sure the language compiles in the Galaxy compiler as well.
It is indentation based, like Python and many other languages, and it encourages a simple, readable scripting-style of writing the code.
The parser, AST and code generation interfaces, along with the standard library, are finished. The only thing still needed is the Galaxy code generation.
Here are some examples of Grape code:
/**Grapestdlib-systempackage-containsbaseclassesforinteropwithSC2*Copyright(c)2011GrapeTeam.Allrightsreserved.**TheGrapeprogramminglanguageandstdlibarereleasedundertheBSDlicense.*/packagesystem.collectionsclasslistinheritsabstract_enumerable:staticintmaximum_items=2000privatestaticintdefault_capacity=4privatestaticobject[maximum_items]empty_arrayprivateobject[maximum_items]itemsprivateintsizeprivateintversionvoidadd(objectitem):ifsize>=maximum_items:thrownewmemory_limit_exceeded_exception("The amount of items in the list has exceeded the maximum amount of items a list can contain. If you need more memory available, raise the system.collections.list.maximum_items member.")size=size+1items[size]=itemversion=version+1voidadd_range(abstract_enumerablecollection):insert_range(size,collection)voidclear():ifsize>0:intindex=0whileindex<size:items[index]=nullindex=index+1size=0version=version+1boolcontains(objectitem):intindex=0whileindex<size:ifitems[index].equals(item):returntrueindex=index+1returnfalseintindex_of(objectitem):returnindex_of(item,0)intindex_of(objectitem,intstart_index):ifstart_index>size:thrownewargument_out_of_range_exception("start_index")returnindex_of(item,start_index,size-start_index)intindex_of(objectitem,intstart_index,intcount):ifstart_index>size:thrownewargument_out_of_range_exception("start_index")ifcount<0||start_index>size-count:thrownewargument_out_of_range_exception("count")intmax=start_index+countintindex=start_indexwhileindex<max:ifitems[index].equals(item):returnindexindex=index+1return-1voidinsert(intindex,objectitem):ifindex>size:thrownewargument_out_of_range_exception("index")items[index]=itemsize=size+1version=version+1voidinsert_range(intindex,abstract_enumerablecollection):ifindex>size:thrownewargument_out_of_range_exception("index")ifcollection==null:thrownewargument_null_exception("collection")abstract_enumeratorenum=collection.get_enumerator()whileenum.move_next():insert(index,enum.get_current())index=index+1version=version+1intlast_index_of(objectitem):returnlast_index_of(item,size-1,size)intlast_index_of(objectitem,intstart_index):ifstart_index>=size:thrownewargument_out_of_range_exception("start_index")returnlast_index_of(item,start_index,start_index+1)intlast_index_of(objectitem,intstart_index,intcount):ifsize==0:return-1ifstart_index<0||start_index>=size:thrownewargument_out_of_range_exception("start_index")ifcount<0||count>start_index+1:thrownewargument_out_of_range_exception("count")intmin=(start_index-count)+1intindex=start_indexwhileindex>=min:ifitems[index].equals(item):index=index-1return-1boolremove(objectitem):intindex=index_of(item)ifindex>=0:remove_at(index)returntruereturnfalsevoidremove_all():intindex=0whileindex<size:items[index]=nullindex=index+1size=size-1version=version+1voidremove_at(intindex):ifindex>=size:thrownewargument_out_of_range_exception("index")size=size-1items[index]=nullversion=version+1voidremove_range(intstart_index,intcount):ifstart_index<0:thrownewargument_out_of_range_exception("start_index")ifcount<0:thrownewargument_out_of_range_exception("count")ifsize-start_index<count:thrownewinvalid_operation_exception("")ifcount>0:size=size-countintindex=start_indexwhileindex<count:items[index]=nullindex=index+1version=version+1overrideabstract_enumeratorget_enumerator():returnnewlist.enumerator(this)objectget_item_at_index(intindex):ifindex>=size:thrownewargument_out_of_range_exception("index")returnitems[index]voidset_item_at_index(intindex,objectvalue):ifindex>=size:thrownewargument_out_of_range_exception("index")items[index]=valueversion=version+1intget_count():returnsizectorlist():passctorlist(abstract_enumerablecollection):ifcollection==null:thrownewargument_null_exception("collection")items=empty_arrayadd_range(collection)publicclassenumeratorinheritsabstract_enumerator:privatelistlprivateintindexprivateintversionprivateobjectcurrentvoiddispose():passoverrideboolmove_next():ifversion==l.version&&index<l.size:current=l.items[index]index=index+1returntruereturnmove_next_rare()privateboolmove_next_rare():ifversion!=l.version:thrownewinvalid_operation_exception("list.enumerator.version and list.enumerator.l.version do not match.")index=l.size+1current=nullreturnfalseoverrideobjectget_current():returncurrentoverridevoidreset():ifversion!=l.version:thrownewinvalid_operation_exception("list.enumerator.version and list.enumerator.l.version do not match.")index=0current=nullinternalctorenumerator(listl):this.l=lthis.index=0this.version=l.versionthis.current=null
Grape has full support in my modding IDE, Moonlite, including dynamic error checking, code completion, code insight, quick links, code navigation, refactoring, smart indentation and more.
I am currently looking for someone with good Galaxy knowledge who can write the code generation part (Just the implementation), because I have not done much modding.
It's really not that hard. Just use a packet sniffer, find the packets sent from SC2.exe, find the packets that get sent when you use an ability, find the part of the packet that is the ability command code, and create a small program using that does the same thing.
Yes, so far. It won't support Data like MWE does, with Xml editing and all that. However, it some point it will support data scripting, like the examples I showed you.
What do you mean with "scripting aspect of the editor"?
Yes, Ximl is only a language in Moonlite. While it has some scripting features, it's only Xml with a few additions, and its sole purpose is extending the interface of Moonlite.
No, Moonlite supports Andromeda.
Ximl is my extension interface markup language, meaning that people who develop extensions can use it to add menus, toolbars, statusbars, menus, buttons, etc. to the native interface.
A new version of Moonlite has been released: 1.0.0.1. Changelog:
Features:
Implemented a new Team Foundation - Subversion in Moonlite.
Implemented two new navigation features. Navigate To (Ctrl+, in the text editor to open, searches for anything - classes, structs, files, etc.) and the quick links - the two dropdowns at the top of the text editor.
Changed the Ribbon UI to a toolbar-based layout.
Implemented Ximl. (Not fully)
Implemented full keyboard support for all commands.
Bug Fixes:
Ctrl+V now pastes properly.
Fixed flickering in the Project Manager.
Fixed random renaming in the Project Manager.
A lot of minor bug fixes...
Known issues:
Ximl currently does not support images.
Ximl cannot place BarItems correctly. (Therefore the Team menu is the first on the main menu)
For some errors, Andromeda does not create line and offset values. This means that although there might be errors in your code, Moonlite will not add them to the Error List, and then the parser will not parse, resulting in stuff such as Navigate To not working.
There might be some Subversion unhandled exceptions. Please report them here.
As a little side note, I am going on vacation for three weeks from tomorrow, so I won't be doing updates in that time. When I get back I will most likely finish the OOP code completion once and for all, and hopefully fix a lot of issues that you guys have reported!
So I'm making this StarCraft 2 IDE called Moonlite (http://www.vestras.net/moonlite/), in which I would like to include a debugger. Although I do have knowledge in injection and hooks and stuff, I would like to have a "team" behind me also writing on the debugger. Here's how it would work:
1) The user sets a breakpoint on a line of code and runs SC2.
2) When the SC2 VM hits the line of code that has the breakpoint, the debugger collects information on the variables in the current context's values, pauses the SC2 thread and focuses Moonlite, which then shows the information.
3) The user can hit continue any time he/she wants to continue the SC2 thread.
Now, I am 100% percent sure that this is possible, seeing as Grimoire could do it in WC3 and SC2 is built the same way. (VM, etc.)
The debugger wouldn't be specific for Moonlite; everyone should be able to use the .dll.
The debugger will be written in Visual C for interaction with .NET applications.
We will use Git or Subversion for source control.
Basically I am looking for people who know what they're doing in the whole memory management thingy, as I am less experienced in that. I will of course contribute with code once we have the basic injection and hook APIs setup. (I have already set up some code, although I am not sure if it is working.
So, anyone who is interested, please apply, telling me what you can do, what you've done before, etc.
1) We've implemented Terrain Masking in MilkyWayEdit, so once the release build comes out, you'll be able to do that. In addition, you should be able to replace Minimap.tga with any kind of image you want inside the map.
Sixen, you really need to stop advertising MWE that much. He didn't ask if any other programs already did it - he was asking for your opinion. This guy just wanna practise.
It's the new version, just forgot to change version. And no, it's not supposed to have an install option if it's already installed.
I fixed the issue, thanks.
New version released. Should fix a lot of bugs, and should finally be somewhat usable.
Changelog:
Implemented code completion (only the OOP part of it is enabled right now, so basically it's just a "member viewer". Very early WIP, the full version will be featured in the next version)
Fixed an issue in the project manager causing it to crash on renaming files;
Fixed an issue in the project manager causing it to rename multiple files;
Fixed an issue in the project manager causing it to name files wrongly;
Increased the performance of the function list drastically - searching for "c_" the speed went from 1 minute to 1 second;
Made the text editor auto parse on paste - should fix a lot of bugs;
Made the application and the installer require administrator permissions in order to prevent crashes;
templar4522:
Hmm... try going to this location: C:\Users\(USER NAME)\AppData\Local\Vestras Productions\Moonlite Map Studio\1.0.0.0
And then tell me what's in there.
0
Currently functions as parameters and anonymous functions will not be implemented. Maybe later, if I get the time. If you want, you can implement it; after all, the project is open source. It is the responsibility of the scripter to cast correctly; if casted uncorrectly, the value will be null. Casting a class to int will be possible. Nullable types will not be implemented and null will remain in the language.
The project is coming along, too - I just recovered my computer from a harddisk fail, and I am working on Grape once again. Working on getting the code generation to compile with the new AST, then I will implement the Grape package for Moonlite and then implement the code generation.
Thanks for your interest and questions.
0
@peeeq: Go
Yeah, exceptions will be hard to implement, but I think it'll be possible. Since I can check whether a method contains throw statements and catch statements at compile time, I should be able to generate code based on that. I can then produce debug messages if an exception isn't caught in a parent method.
And yes, I had thought about the maximum number of iinstances for each class user specification (or rather, s3rius had) - it does indeed exist in Grape. This is how you specify a custom class size:
Thanks for your interest.
0
Hello,
I would like to introduce to you a programming language that I am working on named "Grape". It is a minimalistic programming language for StarCraft 2, and is not an extension to the Galaxy language. This means that there is no backwards compatibility to Galaxy; no need to make sure the language compiles in the Galaxy compiler as well. It is indentation based, like Python and many other languages, and it encourages a simple, readable scripting-style of writing the code. The parser, AST and code generation interfaces, along with the standard library, are finished. The only thing still needed is the Galaxy code generation. Here are some examples of Grape code:
Grape has full support in my modding IDE, Moonlite, including dynamic error checking, code completion, code insight, quick links, code navigation, refactoring, smart indentation and more. I am currently looking for someone with good Galaxy knowledge who can write the code generation part (Just the implementation), because I have not done much modding.
Thank you for your attention.
0
@Molsterr: Go
It's really not that hard. Just use a packet sniffer, find the packets sent from SC2.exe, find the packets that get sent when you use an ability, find the part of the packet that is the ability command code, and create a small program using that does the same thing.
0
Yes, so far. It won't support Data like MWE does, with Xml editing and all that. However, it some point it will support data scripting, like the examples I showed you.
0
What do you mean with "scripting aspect of the editor"? Yes, Ximl is only a language in Moonlite. While it has some scripting features, it's only Xml with a few additions, and its sole purpose is extending the interface of Moonlite.
0
No, Moonlite supports Andromeda.
Ximl is my extension interface markup language, meaning that people who develop extensions can use it to add menus, toolbars, statusbars, menus, buttons, etc. to the native interface.
0
A new version of Moonlite has been released: 1.0.0.1. Changelog:
Known issues:
As a little side note, I am going on vacation for three weeks from tomorrow, so I won't be doing updates in that time. When I get back I will most likely finish the OOP code completion once and for all, and hopefully fix a lot of issues that you guys have reported!
Enjoy.
0
Hey guys,
So I'm making this StarCraft 2 IDE called Moonlite (http://www.vestras.net/moonlite/), in which I would like to include a debugger. Although I do have knowledge in injection and hooks and stuff, I would like to have a "team" behind me also writing on the debugger. Here's how it would work:
1) The user sets a breakpoint on a line of code and runs SC2.
2) When the SC2 VM hits the line of code that has the breakpoint, the debugger collects information on the variables in the current context's values, pauses the SC2 thread and focuses Moonlite, which then shows the information.
3) The user can hit continue any time he/she wants to continue the SC2 thread.
Now, I am 100% percent sure that this is possible, seeing as Grimoire could do it in WC3 and SC2 is built the same way. (VM, etc.)
Basically I am looking for people who know what they're doing in the whole memory management thingy, as I am less experienced in that. I will of course contribute with code once we have the basic injection and hook APIs setup. (I have already set up some code, although I am not sure if it is working.
So, anyone who is interested, please apply, telling me what you can do, what you've done before, etc.
Thanks,
Vestras
0
Sixen, you really need to stop advertising MWE that much. He didn't ask if any other programs already did it - he was asking for your opinion. This guy just wanna practise.
0
It's the new version, just forgot to change version. And no, it's not supposed to have an install option if it's already installed.
I fixed the issue, thanks.
0
I forgot to include a dll in the last installer. If you've already downloaded and installed, please redownload and reinstall.
0
New version released. Should fix a lot of bugs, and should finally be somewhat usable. Changelog:
0
templar4522:
Hmm... try going to this location: C:\Users\(USER NAME)\AppData\Local\Vestras Productions\Moonlite Map Studio\1.0.0.0
And then tell me what's in there.
Kalekin:
And why does that make it less awesome?
0
@Kalekin: Go
What do you mean? Misread? What did you misread?