Will there be a full documents instead of scarcely spread information on the Wiki?

Six

Endokid
Joined
Sep 23, 2019
Messages
1
#2
^^^ Yes plz for the players looking to take this game seriously this would be a huge help!
 

totoro

Learned-to-sprint endo
Joined
Oct 24, 2019
Messages
22
#3
The place you want to look isn't really yolol, it hardly has any functions - it's a lot like BASIC with line by line execution and GOTO. What you probably want to do is dig into the devices and machines page on the wiki. Click the name of anything in that list and scroll down to the bottom to find a short list of device fields.

Device fields are mostly straightforward. Some are updated by the device to display an internal state like how much charge is left in a battery, the rest are used to set a setting like an on/off field or a number for how much a thruster is thrusting.

Here's where it gets magical: you access the contents of device fields as variables by using ":fieldname", which is what a lot of yolol does.

BUT you don't need any yolol to get a ship working! Whenever a device updates its field, it is broadcast to the network- any fields on the network with matching names will be set to the same value. So you can rename a button's buttonstate to match the name of a door or light and then the button will activate the door or light.

If you actually do need yolol for something complex, it's a matter of using device fields to check the status of things and changing device fields to get certain things to happen. If...else statements will fill up a 70 char line pretty fast, so speed can become an issue if you're doing something really complex, and you might want to spread the load across multiple chips. If you need to share data between chips there are memory chips which contain multiple empty device fields.

To give a vague idea of a larger complex system, the slaved turrets featured in a video each have a handful of chips per turret just for quickly applying math to the turret angles, and there is a lever in the aiming chair for manually setting the distance for the aim convergence. The entire pile of code uses dozens of chips, with lots of sin and cos for calculating the offsets for each turret across the length of the ship.

For something more simple - the vasama comes with a turtle button that sets max forward thrust speed to 10 percent, and it really only uses one line of code. (it actually has two extra lines but they don't do much.) Here's the code as was shared at the end of October:
Code:
goto 1+:turtle
:lbms=10 if :turtle==0 then goto 3 else goto 2 end
:lbms=80
 
Last edited:

totoro

Learned-to-sprint endo
Joined
Oct 24, 2019
Messages
22
#5
So I went and double checked the wiki page and every function is there. No more API left to share. Like I mentioned there are hardly any functions.

edit: Here's a list of all device fields in one place for now
 
Last edited:

totoro

Learned-to-sprint endo
Joined
Oct 24, 2019
Messages
22
#7
I know what an api reference looks like... yolol just doesn't have much of an api. Everything you can do in yolol is already on the wiki page with examples. (in bright yellow) That's really all there is. You can't make real functions. You can set some device fields, then activate a chip that reads them and does something with that, (you activate it by setting its device fields,) and that would be sort of like a function, I guess...

Maybe take a look at the rest of the vasama code they let us see the other day:
Code:
chip1   10        20        30        40        50        60        70
:t6=:roll*(:roll>0) :t7=-(:roll)*(:roll<0) goto 1

roll yolol
roll= roll lever
t6 and t7 are thrusters ( top middle)


chip2   10        20        30        40        50        60        70
:t2=:pitch*(:pitch>0) :t3=-(:pitch)*(:pitch<0) goto 1

pitch yolol
pitch = pitch lever
t2and t3 are thrusters ( bottom)


chip3   10        20        30        40        50        60        70
:t4=:yaw*(:yaw>0) :t5=-(:yaw)*(:yaw<0) goto 1

yaw yolol
yaw=yaw lever
t4 and t5 are thrusters (front side thrusters)


chip4   10        20        30        40        50        60        70
goto 1+:turtle
:lbms=10 if :turtle==0 then goto 3 else goto 2 end
:lbms=80
They even included all the info you need to see what it's doing. In each case, just taking a levers current value and setting a thruster to that value. The biggest trick being using a logic statement ":field<0" to get a zero or a one so that the two-way lever control only sets the correct of two thrusters.

No functions, only like one if-statement to check the turtle button and adjust the fwd thrust max by changing the lever's maximum device field.

(And in a normal ship you don't need to do any of that, it's all covered by a flight computer)
 
Last edited:
Joined
Mar 12, 2020
Messages
4
#9
I'm curious if there is a yolol beginners type guide... if so, would you mind posting it? all the "
:t6=:roll*:)roll>0) :t7=-:)roll)*:)roll<0) goto 1" stuff means nothing to me.
 

totoro

Learned-to-sprint endo
Joined
Oct 24, 2019
Messages
22
#10
Check out devices and device fields on the wiki. (and/or watch the yolol video on youtube)

:t6 is the name of the thruster device field that turns on a particular thruster. (it can be set anywhere from 0 to 100, as a percent of maximum thrust) :roll is the name of the current setting of the control lever for barrel rolls on the Vasama. (it's something like -20 to 20, since it's easy to roll a ship that tiny)

Because the lever goes both ways, it needs to activate one of two different thrusters, so you can't just rename it to match, which is why the Vasama uses some yolol chips.

So the (:roll>0) is a quick logic check - when it's true, it's the same thing as the number 1, when it's false, it's zero. So in the code, they multiply the yaw lever position :yaw by the logic, so that the when the lever is greater than 0, (when it's pushed to the right,) then the thruster will be set to that position value. (multiplied by 1) When the lever is at 0, (or pushed the other direction,) the position value is multiplied by zero, so that the thruster won't be firing.

The other half of the line is the same thing, but for the thruster on the other side - when the lever is in a negative position, (:yaw<0) it sets the thruster to the negative of that negative position. (to give it positive thrust)

In most ships, you just use a Flight Control Unit and a Main Flight Computer so that you don't need any control code. If you wanted, you could even skip that and still make a chip-free Vasama- just replace all the two way levers with two separate controls, one for each direction, and then you can rename each one to match its thruster and not code a thing.
 
Last edited:
Top