3 ms·
I wrote a bunch of cog scripts (hence my username) it was one of the first programming languages I learned :) It's been a while since I wrote it, but it looked
by cogman10 2y ago
I wrote a bunch of cog scripts (hence my username) it was one of the first programming languages I learned :)
It's been a while since I wrote it, but it looked pretty close to a simple C programming language.
It was effectively bound events with predefined global methods you could call
So you might see something like
damage:
setHealth(player, 100);
while (getHealth(player) > 100) {
setTint(getHealth(player) * 90, 0, 0);
}
return;
Something like that (I may be forgetting some of the syntax, been a few years).
The file structure was important. You'd have a `force_push.cog` which the game engine knew to link up all force push events into.
A lot of these were ran locally, which as you can imagine, was a big issue when it came to cheating. There was a rudimentary checksum system in JK that would run against the cog files to verify two players hooking up together had the same version. That was easily hacked as the check ran client side.
You could have events that you called and I believe labels you could jump to. That's how people created more advanced interactions. Up to and including new AI systems written purely in cog syntax.