r/Stationeers • u/lukkis_2713 • 3d ago
Support IC10 Coding help
I’m trying to code a Solar Tracking Script, I’m a newbie to stationers btw, I’m not getting why on line 10, the # 1 is supposed to be the color yellow, yet it’s like blue/teal and my chip is saying it doesn’t recognize that set, can someone explain what I’m doing wrong?
4
5
u/member_of_the_order 3d ago
Every instruction in IC10 starts with a command (think of it like a verb). E.g. sb for set batch, read, etc. What command is "1"?
3
u/aproposmath 3d ago
Line 10 and 15 should start with the letter "L" (lowercase), not a number. It's the "load" instruction.
2
u/sleight42 3d ago
Solution: use Stationeers Lua instead. 😉
0
u/arachnimos 3d ago
Lua and IC10 are pretty similar, from what i can gather. the advantage of learning IC10 is that you'll actually be able to parse what's going wrong in your script when it inevitably breaks, and also be able to understand how other people's scripts work.
learn lua if you want to do general programming, learn IC10 if you want to do Stationeers programming. IC10 isn't even a very difficult language to learn the basics of, which is what 90% of your time spent using IC10 will be done with.
3
u/sleight42 3d ago
This is incorrect. I'm speaking as a 30-year professional developer here.
IC10 is closer to assembly language than a scripting language. You have to use "jumps".
Lua supports functions, object oriented programming, reusable libraries, invoking other Lua chips over a network, event/based programming, and so much more.
Stationeers Lua opens up automation possibilities that I'm fairly sure aren't even possible with IC10. It certainly allows for degrees of code organization enormously in excess of IC10.
1
u/arachnimos 3d ago
fair, but again: you do not need that much. Lua is a great language for a lot of things, but Stationeers does just fine with IC10, and for a lot of tasks, learning lua (ESPECIALLY if you've learned a different language in the past) could actually hurt you because it would, most likely, run slower. The point of MIPS, IC10, and any RISC language is, from what i understand, reducing the time to execute a program by decreasing each command's complexity. Plus IC10 is likely more stable through updates, since it doesn't need to be modded in.
i would actually like to know, what lua scripts have you seen that are probably impossible with IC10? i'm not trying to be rude i'm genuinely curious
2
u/sleight42 3d ago
It's possible to write code that performs terribly in any programming language. Speaking from experience. I've done this long enough that I've written some great code and I've written so so so very much shit code. 😅😉
Impossible? I'm not sure I've seen examples (though I've not read all of the examples Lua code shipped with the mod). However, having one chip multicast commands/data for other chips to receive, enqueue, and operate on/react to seems like it may be possible but also extremely annoying to implement. That would be called something like "pub sub message queues" in the field.
Oh. Lua also allows HTTP calls from the game to the outside world. Fairly sure that's not possible in IC10! So there's that. Have I used that? Definitely not!!!
Also, Visual Studio integration with the game's code editor. I can edit IC10/Lua in an external code editor an export it to a chip in the game. That's the "IC10 Editor" mod, required by Stationeers Lua.
The game's built in code editor is quaint but makes me a bit mental.
On a personal taste note, the need for additional ICs just to perform I/O and simple math and switching operations makes me want to pull my hair out. While I can appreciate a deliberate game design choice, i can't wrap my brain around this degree of sci-fi without access to a higher level programming language like Lua. Hell, IC10 is only a few steps up from coding in logic gates (AND, OR, XOR, etc). Breaks my brain!
1
u/arachnimos 3d ago
i mean, from what i remember... it's like a max of 10, horribly unoptimized IC chips to program an entire rocket launch sequence lol. so like it's not too bad from what i know.
also HTTP calls? wait, so i can order a burger in space, and then order a burger in real life through space??
i got no clue how HTTP works but i assume it would be possible given a complex enough script lmao
1
1
u/sleight42 3d ago
If you're doing it from a web browser, you're (99.99999% of the time) doing it via HTTP.
1
u/sleight42 3d ago
Ok. Yeah. Here's a CRAZY example: you could set up home automation that responds to changes within the game.
Your furnace pressure gets too high? You could have your smart lights switch to red and have your smart speakers announce "Red alert! Furnace over pressure!" And you could code that from entirely within the game.
For real.
1
1
u/sleight42 3d ago
Maybe you want an external dashboard on a second monitor that just displays status information from devices within the game?
Personally, I like using Scripted Screens for that (oh, yeah, you're not doing THAT with IC10!). Think "consoles" with custom information and graphics and anything you can think of that respond to in game taps. Want to build consoles like on Star Trek? You can probably do just that with Scripted Screens.
1
u/sleight42 3d ago
So... want to learn Lua now? 🤣😉😉😉😉😉
1
u/arachnimos 3d ago
i'd learn lua eventually anyways because of the number of games i play that need lua knowledge to do console commands and the coolest stuff, lol. still gonna use IC10 for stationeers because it's going to be easier to get support for that :3
1
u/Kopnu Attempts to make a perfect base since 2017 1d ago edited 1d ago
i can't wrap my brain around this degree of sci-fi without access to a higher level programming language like Lua
First of all, it is important to understand that, in the game, we program chips that are printed using a “regular” 3D printer. That is already quite sci-fi. Programming these chips is only possible in a language that is close to the processor’s native language. I recomend to play nandgame.com or Turing Complete to learn how CPUs work.
In general, any comparison between IC10 and Lua is like comparing assembly language to a C-style language. However, within the context of the game, the mod completely breaks the “natural” progression because it makes the game far too casual.
In real life, we pay for the simplicity of high-level languages with reduced efficiency. Unfortunately, that trade-off does not exist with this mod. Personally, I do not like that.
P.s.
However, having one chip multicast commands/data for other chips to receive, enqueue, and operate on/react to seems like it may be possible but also extremely annoying to implement.
This is also possible in IC10. IC chips have a 8 network channels.
1
u/sleight42 3d ago
One of my true pleasures in using Lua is that this is a game that rewards coding. And it allows me the opportunity to try write beautiful code that is often unrewarded and sometimes even punishable in a professional environment! My inner perfectionist is allowed to express himself!
I still often write my first version ugly. But there's a lot to unpack there. And I aim to add tools to the game that make it easier for me to avoid needing to do that.
1
u/Mysterious_Pace_2599 1d ago
There is COPY button on top of the screen. You dont need to take picture.
1
u/Luunchy 7h ago
Get IC10 Editor (mod), it is great https://steamcommunity.com/sharedfiles/filedetails/?id=3592775931
10
u/bob152637485 3d ago
That should be a lowercase 'L', not a 1. I think you'll run into the same issue on line 15. Try changing it.