• 0

    posted a message on Grape - SC2 programming language
    Quote from peeeq: Go

    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

    unit z = null // compile error
    unit? z = null // ok
    unit?[10] units //question mark = this type is nullable
    //...
    unit u = units[3] //compile error, wrong type
    unit u = units[3].Value // use "Value" to get the actual value, exception when value is null
    if units[3].HasValue :
    	unit u = units[3].Value //now it is safe to get the value
    	unit? v = u // automatic cast to nullable type
    
    
    list a = new list()
    list? b = new list()
    // ....
    a.add(1) // cannot throw nullpointer exception because a cannot be null
    b.add(2) // can throw nullpointer exception
    b?.add(3) // safe invoke, no exception is thrown if b is null, it just has no effect
    

    See nullable types as in fantom: nullable types safe invoke or nullable types in c#: http://msdn.microsoft.com/en-us/library/1t3y8s4s%28v=vs.80%29.aspx

    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.

    Thanks for your interest and questions.

    Posted in: Third Party Tools
  • 0

    posted a message on Grape - SC2 programming language

    @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:

    class my_sample_class[500]:
        ctor my_sample_class():
            pass
    

    Thanks for your interest.

    Posted in: Third Party Tools
  • 0

    posted a message on Grape - SC2 programming language

    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 stdlib - system package - contains base classes for interop with SC2
     * Copyright (c) 2011 Grape Team. All rights reserved.
     * 
     * The Grape programming language and stdlib are released under the BSD license.
     */
    
    package system.collections
    
    class list inherits abstract_enumerable:
    	static int maximum_items = 2000
    
    	private static int default_capacity = 4
    	private static object[maximum_items] empty_array
    	private object[maximum_items] items
    	private int size
    	private int version
    
    	void add(object item):
    		if size >= maximum_items:
    			throw new memory_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 + 1
    		items[size] = item
    		version = version + 1
    	
    	void add_range(abstract_enumerable collection):
    		insert_range(size, collection)
    	
    	void clear():
    		if size > 0:
    			int index = 0
    			while index < size:
    				items[index] = null
    				index = index + 1
    			
    			size = 0
    		
    		version = version + 1
    
    	bool contains(object item):
    		int index = 0
    		while index < size:
    			if items[index].equals(item):
    				return true
    			
    			index = index + 1
    		
    		return false
    
    	int index_of(object item):
    		return index_of(item, 0)
    	
    	int index_of(object item, int start_index):
    		if start_index > size:
    			throw new argument_out_of_range_exception("start_index")
    		
    		return index_of(item, start_index, size - start_index)
    	
    	int index_of(object item, int start_index, int count):
    		if start_index > size:
    			throw new argument_out_of_range_exception("start_index")
    		
    		if count < 0 || start_index > size - count:
    			throw new argument_out_of_range_exception("count")
    		
    		int max = start_index + count
    		int index = start_index
    		while index < max:
    			if items[index].equals(item):
    				return index
    			
    			index = index + 1
    		
    		return -1
    	
    	void insert(int index, object item):
    		if index > size:
    			throw new argument_out_of_range_exception("index")
    		
    		items[index] = item
    		size = size + 1
    		version = version + 1
    	
    	void insert_range(int index, abstract_enumerable collection):
    		if index > size:
    			throw new argument_out_of_range_exception("index")
    		
    		if collection == null:
    			throw new argument_null_exception("collection")
    		
    		abstract_enumerator enum = collection.get_enumerator()
    		while enum.move_next():
    			insert(index, enum.get_current())
    			index = index + 1
    		
    		version = version + 1
    	
    	int last_index_of(object item):
    		return last_index_of(item, size - 1, size)
    	
    	int last_index_of(object item, int start_index):
    		if start_index >= size:
    			throw new argument_out_of_range_exception("start_index")
    		
    		return last_index_of(item, start_index, start_index + 1)
    	
    	int last_index_of(object item, int start_index, int count):
    		if size == 0:
    			return -1
    		
    		if start_index < 0 || start_index >= size:
    			throw new argument_out_of_range_exception("start_index")
    		
    		if count < 0 || count > start_index + 1:
    			throw new argument_out_of_range_exception("count")
    		
    		int min = (start_index - count) + 1
    		int index = start_index
    		while index >= min:
    			if items[index].equals(item):
    				index = index - 1
    		
    		return -1
    	
    	bool remove(object item):
    		int index = index_of(item)
    		if index >= 0:
    			remove_at(index)
    			return true
    		
    		return false
    	
    	void remove_all():
    		int index = 0
    		while index < size:
    			items[index] = null
    			index = index + 1
    			size = size - 1
    		
    		version = version + 1
    	
    	void remove_at(int index):
    		if index >= size:
    			throw new argument_out_of_range_exception("index")
    		
    		size = size - 1
    		items[index] = null
    		version = version + 1
    	
    	void remove_range(int start_index, int count):
    		if start_index < 0:
    			throw new argument_out_of_range_exception("start_index")
    		
    		if count < 0:
    			throw new argument_out_of_range_exception("count")
    		
    		if size - start_index < count:
    			throw new invalid_operation_exception("")
    		
    		if count > 0:
    			size = size - count
    			int index = start_index
    			while index < count:
    				items[index] = null
    				index = index + 1
    			
    			version = version + 1
    	
    	override abstract_enumerator get_enumerator():
    		return new list.enumerator(this)
    	
    	object get_item_at_index(int index):
    		if index >= size:
    			throw new argument_out_of_range_exception("index")
    		
    		return items[index]
    	
    	void set_item_at_index(int index, object value):
    		if index >= size:
    			throw new argument_out_of_range_exception("index")
    		
    		items[index] = value
    		version = version + 1
    	
    	int get_count():
    		return size
    	
    	ctor list():
    		pass
    
    	ctor list(abstract_enumerable collection):
    		if collection == null:
    			throw new argument_null_exception("collection")
    		
    		items = empty_array
    		add_range(collection)
    	
    	public class enumerator inherits abstract_enumerator:
    		private list l
    		private int index
    		private int version
    		private object current
    
    		void dispose():
    			pass
    
    		override bool move_next():
    			if version == l.version && index < l.size:
    				current = l.items[index]
    				index = index + 1
    				return true
    			
    			return move_next_rare()
    		
    		private bool move_next_rare():
    			if version != l.version:
    				throw new invalid_operation_exception("list.enumerator.version and list.enumerator.l.version do not match.")
    			
    			index = l.size + 1
    			current = null
    			return false
    		
    		override object get_current():
    			return current
    		
    		override void reset():
    			if version != l.version:
    				throw new invalid_operation_exception("list.enumerator.version and list.enumerator.l.version do not match.")
    			
    			index = 0
    			current = null
    		
    		internal ctor enumerator(list l):
    			this.l = l
    			this.index = 0
    			this.version = l.version
    			this.current = null
    
    /*
     * Grape stdlib - system package - contains base classes for interop with SC2
     * Copyright (c) 2011 Grape Team. All rights reserved.
     * 
     * The Grape programming language and stdlib are released under the BSD license.
     */
    
     package system
    
     class transmissionsource_base:
    	static int invalid_transmission_id = c_invalidTransmissionId
    	static fixed transition_duration = c_transmissionTransitionDuration
    
    	class transmission_durations:
    		static int duration_default = c_transmissionDurationDefault
    		static int duration_add = c_transmissionDurationAdd
    		static int duration_subtract = c_transmissionDurationSub
    		static int duration_set = c_transmissionDurationSet
    	
    	static transmissionsource create():
    		return TransmissionSource()
    	
    	static transmissionsource create_from_unit(unit u, bool flash, bool override_portrait, string animation):
    		return TransmissionSourceFromUnit(u, flash, override_portrait, animation)
    	
    	static transmissionsource create_from_unit_type(string unit_type, bool override_portrait):
    		return TransmissionSourceFromUnitType(unit_type, override_portrait)
    	
    	static transmissionsource create_from_model(string model_link):
    		return TransmissionSourceFromModel(model_link)
    
    	static transmissionsource create_from_movie(string asset_link, bool subtitles):
    		TransmissionSourceFromMovie(asset_link, subtitles)
    	
    	int send(playergroup players, int target_portrait, string animation, soundlink sound_link, text speaker, text subtitle, fixed duration, int duration_type, bool wait_until_done):
    		return TransmissionSend(players, this, target_portrait, animation, sound_link, speaker, subtitle, duration, duration_type, wait_until_done)
    	
    	void clear(int type):
    		TransmissionClear(type)
    	
    	void clear_all():
    		TransmissionClearAll()
    	
    	void set_option(int option_index, bool value):
    		TransmissionSetOption(option_index, value)
    	
    	void wait(int type, fixed offset):
    		TransmissionWait(type, offset)
    	
    	private ctor transmissionsource_base():
    		pass
    

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Blizzard's loophole in map editing that allows hacking

    @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.

    Posted in: General Chat
  • 0

    posted a message on Moonlite Map Studio open beta release

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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!

    Enjoy.

    Posted in: Third Party Tools
  • 0

    posted a message on Looking for people interested in creating a SC2 Debugger

    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.)


    • 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.

    Thanks,
    Vestras

    Posted in: Team Recruitment
  • 0

    posted a message on Program Suggestions
    Quote from Sixen: Go

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    I forgot to include a dll in the last installer. If you've already downloaded and installed, please redownload and reinstall.

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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;
    • Fixed an "Attempted to divide by zero" crash.
    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    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?

    Posted in: Third Party Tools
  • 0

    posted a message on Moonlite Map Studio open beta release

    @Kalekin: Go

    What do you mean? Misread? What did you misread?

    Posted in: Third Party Tools
  • To post a comment, please or register a new account.