Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I can understand the comments causing issues, but 4000 characters is more than enough to make an operating system. Most BIOSes are less. You can define all your variables and aliases at the start of the file so they aren't much of an issue.
Global limits are a bad idea to begin with, and you'd have roundabout ways around them at any rate.
I believe the devs have already answered this here if you scroll to the bottom.
http://mcro.org/issues/view_issue/10756
"Sorry, but 4096 will stay. Enough to code most of the things. You can use multiple Lua components anyway."
The number of characters in a script has no correlation to efficiency or optimization but you could relate it to size in memory(which we have a lot of nowadays). There might be 100 characters of slow code or 4000 characters of fast code. There could be 4000 characters of unreadable code and there could also be 4000 characters of readable code where the 4000 characters of unreadable code is most likely more code.
I don't think it's fair to compare this to BIOSes or OS. For one thing they didn't have any character limit so whoever made the BIOS or OS has no excuse to have undescriptive code. It's also not the same use case. We're making high level gameplay code in a script language.
My point is the character limit doesn't make any sense to the end user who writes the script. There are also several ways to avoid the limit by minimizing code or just having several nodes so what's the point of it? The limit has no real effect and the only thing it does now is enforce bad practices. For example creating aliases is a solution to a problem that was created by the developers themselves. Why not just remove this problem that doesn't need to exist?
I would just remove the limit completely. That way we get what we already have today but without workarounds(several nodes, minimizing code, etc).
Newer programmers don't really understand optimization or efficiency, because they don't have to. At most C++ programmers have to do very lightweight memory management, and that's that, but in reality there's very few cases where shorter code with no method calls would be less efficient than code that's longer. The only exceptions are really extremely heavy maths, data tables and data sorting, none of which you'll do here. Draw calls are the heaviest thing there is.
Why wouldn't it be a fair comparison? It's an operating system we're talking about vs. a bit of code that affects some numbers in most cases.
The limit is there to guide you in the right direction. Sure, there are awfully written scripts already that alone managed to slow down the tick rate without the intention to do so, but they're fairly rare. Besides, you alias things in normal coding all the time as well. What do you think the "include"/"import" instruction does?
I'm more than happy to support comments not affecting character limit, as they're a very important part, but i believe the limit should be there.
This is not the case.
It's not a fair to compare this to writing a BIOS or OS because people don't play Stormworks to write an OS or BIOS. I wouldn't write a BIOS or OS in Lua either. It's not the same demographic.
The limit encourages users to write code as in the second snippet and it gives us nothing but code that is hard to read.
Also about the aliasing. If you do it for the reason to lower the amount of chars in your scripts i believe it's the wrong reason since again it will make it harder to read.
Perfectly said. Exactly what I meant.
Just do a search on Lua and 4096. Did you think the interpreter was coded from scratch? It's probably based on the integration of a developer toolkit.
yeah it's really annoying. But at least it stops the game from being unplayable.
Also if you're consistently ending up with similar settings you can treat them as presettable optional entries by making a method with them already in place.
Why dont you use alias?
So I can write more than one draw/input etc. thing on one line of text?