Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline joegallagher95  
#1 Posted : Friday, February 10, 2012 12:14:54 AM(UTC)
joegallagher95

Joined: 2/10/2012(UTC)
Posts: 1

Would i be able to script for the engine using other .net languages such as IronPython?

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Friday, February 10, 2012 12:59:42 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Depends on the platform. WP7 (and Xbox 360) does currently only allow C# .NET code and while you can get away compiling some things in other languages (lets say a VB library), it stops at dynamic languages like IronPython, which is not supported at all. There is a similar situation at iOS, where C# is pretty much the only language supported by Xamarin, dynamic languages are also forbidden by Apple. And the same goes for Android, C# is the only supported language, but in Theory much more works here, it is just not fully supported yet.

For all other platforms you can use dynamic languages, any other .NET languages or native code as much as you want, there are no limitations except that you cannot use the Build System for that code. If you just provide extra assemblies or files (like native dlls) it works fine on all PC platforms (Windows, Mac, Linux), but none of this works on any mobile platform automatically (you can however provide your own Objective-C or C or Java libraries and P-Invoke them).
Offline maxthekokusaiwarrior  
#3 Posted : Wednesday, April 16, 2014 2:51:34 PM(UTC)
maxthekokusaiwarrior

Joined: 11/4/2013(UTC)
Posts: 18

Hi Benjamin,

I have some questions about the chance to use a scripting language with Delta Engine. Some time ago, in order to find a portable solution, I designed a simple scripting language. Scripts are written as text files, then loaded, parsed and finally executed. There is no external library, just pure C# code. This language is able to execute custom commands defined in external dlls, but these are not loaded at runtime by the game, there are simply linked as references to the project. I think this is enought to ensure the portability of the code. Am I right? Moreover, I'm reading about TypeScript. I would like to understand if it can be used to create scripts for a game developed by Delta. Can you help me? Thank you ThumpUp

Max
Offline Benjamin  
#4 Posted : Wednesday, April 16, 2014 8:26:21 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Hi, we thought long and hard about using scripting (via Roslyn, .NET 4.5, etc.) for the new content and entity system and decided against it. Instead we just save everything as xml data and can reconstruct any content or entity object via properties. This way code can change dramatically and the data still works. Plus we get tons of dynamic features and live content updating pretty much for free.

That does not mean we cannot do scripting, we just did not invest any time into it. With v1.1 you can even use the AssemblyStarter, which allows to load any C# code or assembly (e.g. a script or even something more complex like a whole app) and execute it in an extra AppDomain. This might help you already. If you build your code with the AppBuilder for other platforms it will not work out of the box, but as long as you just have some c# code that needs to be added to the project and executed together with it, there is probably an easy way to support it (we did the same many times before in the past, including lua scripting on all consoles, but that is a different story and was actually a ton of work to get it right).

So I guess try it out and if you have trouble, ask and we will help Cool
Offline maxthekokusaiwarrior  
#5 Posted : Thursday, April 17, 2014 2:53:57 PM(UTC)
maxthekokusaiwarrior

Joined: 11/4/2013(UTC)
Posts: 18

Thank you very much Benjamin ThumpUp
Offline maxthekokusaiwarrior  
#6 Posted : Saturday, April 19, 2014 3:30:04 PM(UTC)
maxthekokusaiwarrior

Joined: 11/4/2013(UTC)
Posts: 18

Sorry Benjamin,

I forgot to ask you. How can I read a text file line by line with Delta? Thank you ThumpUp

Max
Offline Benjamin  
#7 Posted : Sunday, April 20, 2014 6:38:51 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
I guess File.ReadAllLines is your best option, we use it often too.