I think Sponge needs a scripting language

That is the difference between stating an opinion and fact. The fact is that the difference is subjective, his opinion is obviously that Skript is not a very good language. Either way sponge is purely for the purpose of enabling developers to interact with the server itself, this server is coded in java. Lets face it, putting in a good scripting system into sponge will most definitely bloat it to some extent, it will also put the responsibility of updating this function upon the Sponge dev team, taking time away from other things. I really donā€™t care if one of the developers has ā€œsuggestedā€ that this feature might eventually be implemented I will stand by my opinion that a scripting language is non-essential for sponge and thus should not be included.

Also, what scripting languages will be implemented? There will only be one language implemented into the final implementation. There will be countless arguments and debates over whether a brand new system be developed for sponge (reference http://xkcd.com/927/) or whether an existing system will be implemented which will undoubtedly piss off one side of the scripting community just stirring up dissent. An open source ideal is many specialized parts working together to do one big thing. All in all I think it is our best bet to keep scripting outsourced to 3rd party developers, this will keep everyone happy.

3 Likes

@MostFunGuy My opinion vs. cold fact. I originally stated my opinion, which is a negative view of Skript. I later stated the hard facts as a way to end the pointless argument. The facts are itā€™s not as bad as my opinion shows it to be. I realize this is self-inconsistent but itā€™s just how facts and opinions work.
EDIT: Didnā€™t see that Robodude explained it.

Lua would be a perfect choice. Itā€™s clear and easy.

2 Likes

I do also think that a scripting language would be fun within Sponge.

Obviously, we wouldnā€™t embed it into Sponge as that would be a whole different element to it.

I took a look at Skript and Denizenā€¦ and in all honestly they donā€™t look like viable or easy to use scripting languages like Python, PHP, etc.

Iā€™ve written scripting languages before, have done for about two years, as well as starting one at my workplace and generally I have a nice idea for a scripting language inside of Sponge.

It would be a plugin, there is no choice about it - IMO.

Off the top of my head, it would work and look a little something like this:

playerJoinEvent(Player) {
    Player.sendMessage("Welcome to the server.");
}
playerLeaveEvent(Player) {
   Server.broadcastMessage(Player.getName() + " has left the server").
}

I know of ways we could incorporate actual Player class (or Spongeā€™s equivalent) methods/functions into the language without much troubleā€¦ so other methods like setHealth, getHealth, etc would work within the language as well.

I might start working on this as a plugin for Sponge myself eventually, so it will be open source,

^ That looks more like Java than a scripting languageā€¦

Are you being serious or?..

Source can look like anything and be a scripting language.

The idea of a scripting language is for it to be interpreted, and not compiledā€¦ not matter what the source code looks like.

Are you being serious? Nobody ever implied that it should be compiled. And it does look a lot like Java. (Also, if youā€™re gonna do that, you might aswell just use the JavaScript engine and save yourself some time ;))

It was implied as the title says ā€˜scripting languageā€™ā€¦

And I didnā€™t say that wasnā€™t the case.

Was your answer to this:

And what I wass saying is that the above didnā€™t state that it should be compiled, but merely made a comment about a similarity in source.

And what you just said, is in no way an answer to my statement from before. It just states some fact, that has barely anything to do with what I said.

Personally, I think they should include scripting support. Not only for coding simple/complex plugins, but to run simple task like what Cron does. There are some pretty low level scripting languages out there that are not too complicated to learn. My personal recommendation would be Perl. Hereā€™s why:

  1. Itā€™s based on a module system, and thereā€™s endless modules you can use to achieve whatever youā€™re trying to do.
  2. If done correctly, itā€™s pretty lightweight like C & C++.
  3. The syntax is very close to Java, C, & C++.
  4. Perl is not hard to learn if you have a general understanding of programming/scripting. The learning curve is pretty steep at first, but thatā€™s due to there being so many ways to accomplish one thing and there might not really be a ā€œrightā€ answer for which one to use.

Hope this helps! (:

Iā€™m not gonna lie, I tuned out after Perl.

Iā€™m most interested in using something that I already understand as a web developer, namely JavaScript, Python, or PHP.

That said, I did successfully write a script in straight Bash this last weekend, using screen to stuff commands.
The major caveat to this approach is that it depends on the presence of viable commands for every action you want to take on the server, and some way to listen to events in game.
If youā€™ve got access to enough functionality through the MC server terminal, as was my case, this is a very usable workaround.

My only contention about any of what you just said, is against any limiting verbiage regarding Sponge.

Yes, Iā€™m running Spigot right now, because I was able to copy over all of my Bukkit setup, with relatively little conflict.
Thatā€™s a stopgap. Iā€™ve already had to cut out plugins that I previously used, due to them being incompatible with 1.8, and not being updated by their developers.

Bukkit sank. I expect that any ā€œmassiveā€ benefit to having native access to its plugin repository will be moot and null within the year. Sponge may still be the future, for the simple fact that most of my favorite developers are onboard already, and are more likely to go forward with a future proof option, than to keep mucking around in a broken project.

All that being said, Iā€™m still very +1 for scripting.
Iā€™m looking to learn C#/Java this year anyway, but Iā€™ve spent 15 years as a functional programmer, writing procedural if-then flows. OOP is a totally new field for me, and until Iā€™m able to dedicate some time to understanding its generic architectural conventions, Iā€™d rather not have it be an obstacle to creating fun features for my friends and family.

Creating spells for example, really should be as simple as

if (player.sentCommand.name =  'fireball') {
   target = player.sentCommand.target;
   player.inventory.take('blaze_powder');
   fireball = new Particle( 'fireball', player.pos, target );
   fireball.animate();
   if ( typeof target == "player" ) {
     target.life = target.life - 5;
   }
}

Obviously thatā€™s really rough js flavored pseudocode, but the point is being able to write functional statements that are able to interface with the Sponge API through some form of abstraction.

In all honesty though, I would really settle for the ability to have command blocks read from a file, or trigger a bash script that can perform logical operations, and further in-game commands through screen stuffing.

This could probably be hacked server-side by setting a cron to listen for MC console output, and stuff commands based on grep triggers, but thatā€™s a lot of extra setup for what should be a baked-in feature, and isnā€™t at all user friendly if youā€™re not already familiar with unix administration (or, equally likely in the MC crowd, running on windows).

I run a modded server. I look forward to Sponge since it will coexist with Forge. Itā€™s not pointless.

1 Like

TL;DR

Scripting can be a complementary solution to regular Java. Weā€™re not (really) talking about being lazy here, anyway us developers are lazy by nature. Just that in some cases, scripting provides so much more flexibility. Let me exaplain.

Java is strong, integrated in Minecraft environment and can reach high performance. Itā€™s good for core development or for creating new features. What about little changes? Temporary use of dynamic features for an event for example? What if I donā€™t want to reboot my server to perform specific tasks? Sometimes we just donā€™t need the industrial side of Java. However, remaking WorldEdit in a scripting language could be discussed. I think you got my point.

Now how to do that? Scripting could mean:

  • Script is compiled to actual Java as a regular mod (conversion to Java). That would imply that the server would have to reboot to consider the changes, and that we would lose some time at compilation.

  • Script is interpretated. That would imply less performances but hey; as explained, scripting isnā€™t for performances, just quick specific tasks using existing components. We would use here existing Java code for example. Thatā€™s absolutely possible.

Which scripting technology to use? Thereā€™s no obvious choice. I really like python as well, but pros and cons have to be listed. As we work with Java, we could think about Groovy which compiles to Java, but as I said before I wouldnā€™t encourage compilation to Java.

I think we should pick a popular existing scripting language, and an API as a Java mod to work with it.

Firstly, why would you necro. You make me cry.
Secondly, donā€™t make me post ā€œthe Sponge is and APIā€ and ā€œSponge needs ā€¦ā€ threads in here. Zhere is no need for native scripting support. It can very well be separated into a plugin.

Then why waste your time arguing about having a scripting language integrated into Sponge here? Go over to your all fancy Spigot and enjoy itā€™s ā€œuntouchableā€ performance. ^^

3 Likes

Making plugins is relatively easy nowadays, we have two or three layers of abstractionā€¦ with a good documentation and good basic tutorials, those without a profound knowledge of Java will be able to make plugins.

If thatā€™s what you want to do, there are plugins for that :wink: and a plugin could be made to handle a certain scripting language too. I donā€™t think it should be part of this API.

Edit: Somehow posted mid-typing? I dunno anymore.

@TBotV63 You said most everything I wanted to, better than I would have. Great stuff.

Scripting as a native component of Sponge does something that I think would negatively affect the plugin community - it installs a uniform component for scripting, whereas otherwise, many other devs could all make their own scripting plugins, that all supported different languages. Sure you could argue this with every other little thing in Sponge then, but scripting isnā€™t a vital component. Sponge should only handle vital components.

And a footnote - @TheMysterious If Sponge is pointless because of Spigotā€™s ā€œuntouchableā€ performance, why are you even here? Thereā€™s a reason we all are here, but it certainly isnā€™t the incomplete Spongeā€™s apparently implicit inferiority to Spigot. A tad long of a footnote but I think you all can understand why.

1 Like

Really? Spigot is compatible with Forge mods?

2 Likes

That has nothing to do with being mean. Even if there is an official implementation, Itā€™ll come as a plugin. Also, this thread was long dead.

Just because you canā€™t / donā€™t want to see our reasoning, that doesnā€™t mean that there isnā€™t any reason. Also, we arenā€™t being negative. I personally like the idea, but it shouldnā€™t be integrated into Sponge.

So do we. We specifically care about the furutre of Sponge, and we gave valid reasons as to why we think that itā€™s a bad idea to include this into the core or even make this something different than a plugin.

Also, this is not a Spigot advertising platform. And writing a whole paragraph about how amazing it is and how superior to Sponge is more than just saying things how they are. You canā€™t even compare the two yet, as Sponge isnā€™t released.

You canā€™t have a discussion, if you just keep reposting the same old stuff without actually looking into our arguments.

2 Likes