Okay.
12:16 < Jon`C> gbk
12:19 < space_ghost> what
12:19 < Jon`C> all of the jk documentation states that jkendlevel takes one parameter, a boolean, to indicate failure or success
12:19 < Jon`C> but 00_endlevel.cog calls it with no parameters. explain yourself.
12:20 < space_ghost> IIRC you can use that to indicate which direction to go in in the episode header. I guess it has a default value.
12:20 < Jon`C> no that's different
12:20 < Jon`C> that's triggered by a CHOICE (CHOOSE?) entry in the episode.jk
12:20 < Jon`C> no
12:20 < Jon`C> DECIDE
12:20 < space_ghost> oh yeah
12:21 < Jon`C> is 00_endlevel.cog used anywhere? maybe it's an old broken asset
12:21 < space_ghost> there's certainly a fair amount of those
12:21 < space_ghost> the 00_ prefix would indicate that it's a "generic" cog, but I don't remember if it was actually used anywhere
12:22 < Jon`C> aaaaaaaaand ****
12:22 < Jon`C> cog supports overloaded verb
12:23 < Jon`C> but it's the only one I know of.
12:23 < space_ghost> what
12:23 < space_ghost> seriously
12:23 < Jon`C> god. ****ing. damn it.
12:23 < space_ghost> where are you seeing this?
12:23 < Jon`C> I just tested it
12:23 < Jon`C> jkendlevel(true) works, jkendlevel() works
12:23 < space_ghost> what about jkendlevel(blahblahdoesntexistblah)
12:24 < Jon`C> jk doesn't require you to define verbs.
12:24 < Jon`C> er
12:24 < Jon`C> symbols
12:24 < space_ghost> oh yeah
12:24 < Jon`C> but!
12:24 < Jon`C> I discovered something terrible
12:24 < space_ghost> christ it's been too long
12:24 < Jon`C> printint();
12:24 < Jon`C> prints -1
12:24 < Jon`C> **** COG **** COG **** COG **** COG **** COG
12:24 < Jon`C> **** **** ****. **** COG. WHY DOES IT DO THAT?
12:25 < space_ghost> uhh, PrintInt takes one argument and has a default value?
12:25 < GoY> Hahaha
12:25 < Jon`C> oh, no no
12:25 < GoY> alive = alive * printint();
12:25 < Jon`C> when it links to the verb
12:25 < Jon`C> tried the comma operator
12:25 < Jon`C> 5, printint(); <- prints 5
12:25 < Jon`C> -1 is a guard they added to the top (bottom?) of their stack.
12:26 < space_ghost> O_o
12:26 < Jon`C> I think they don't check parameter counts when they link to verbs. they just **** all over themselves.
...
12:41 < space_ghost> so "0,0,1 adddynamictint(jkgetlocalplayer())" would be the same as "adddynamictint(jkgetlocalplayer(),1,0,0)"?
12:42 < space_ghost> err "0,0,1,..."
12:42 < Jon`C> right, default value for floats is 0... so printvector(vectorset()) would print 0,0,0
12:42 < Jon`C> yeah
12:43 < Jon`C> yes, you can push parameters onto the stack manually. this is literally worse than php.
12:43 < Jon`C> as impossible as it is to consider
12:43 < space_ghost> impossible, nothing is worse than php
12:43 < Jon`C> what I assume
12:43 < Jon`C> ...wait
12:43 < space_ghost> except maybe MUMPS
12:43 < Jon`C> wait wait wait
12:44 < Jon`C> omg
12:44 < GoY> You are enjoying this Jon`C; in the same way it is fun to roll around in a mud bath
12:44 < Jon`C> 5; printint(); prints 5
12:44 < space_ghost> haha
12:44 < GoY> so without argument printint() prints the last thing on the stack?
12:44 < Jon`C> it's not just the comma operator
12:44 < Jon`C> yes, it just blithely fetches its parameters off the stack
12:44 < Jon`C> if you don't pass enough it takes whatever is on top.
12:45 < Jon`C> and from ^
12:45 < space_ghost> that's kinda disturbing.
12:45 < Jon`C> if you call a verb that returns a value, for instance
12:45 < Jon`C> and you don't consume it
12:45 < Jon`C> it will be passed as the extra parameter
...
12:54 < Jon`C> alright, this is ****ed up
12:55 < Jon`C> test5 = test8 = test = 10; (test is set to 3146514, test8 to 651 and test5 to 5)
12:55 < Jon`C> printint(test); // 10
12:55 < Jon`C> printint(test8); // 651
12:55 < Jon`C> printint(test5); // 651
12:55 < space_ghost> so the statement becomes "test5 = test8; test = 10"?
12:55 < Jon`C> apparently.
12:56 < space_ghost> fantastic.
12:56 < Jon`C> yeah, the pattern holds
12:56 < Jon`C> so the jk devs wrote a c-like language without actually knowing c
12:57 < Jon`C> :golf clap:
12:57 < space_ghost> the cog sucks pattern?
12:58 < Jon`C> the yes that is exactly what's happening pattern
12:59 < Jon`C> though honestly I think the big takeaway for today is that...
12:59 < Jon`C> 1, 2, 3; vectorset(); printvector();
12:59 < Jon`C> prints <1, 2, 3>
13:00 < Jon`C> and that lec cogs are written with the expectation that this will work
....
13:31 < Jon`C> sigh
13:31 < Jon`C> actor_fn.cog, line 116. calls settimer with 4 parameters.
13:32 < Jon`C> I assume the extra parameters are discarded silently...
13:32 < space_ghost> what were the other two?
13:32 < Jon`C> settimer accepts one parameter, a delay
13:32 < Jon`C> settimerex accepts 4
13:32 < space_ghost> oh yeah
13:33 < Jon`C> I wonder how much qa money lec could have saved if they had done actual semantic analysis for cog.
13:33 < space_ghost> or, maybe, ick, settimer relays the call to settimerex when there is more than one parameter
13:33 < Jon`C> I dunno. I doubt it.
13:33 < Jon`C> could test I guess
13:36 < Jon`C> ah yes, in another fit of randomness, you have to define the timer message in the symbols section or else it won't work
13:38 < Jon`C> nope it just dumps the extra parameters onto the stack.
13:38 < Jon`C> takes the LAST parameter though
13:38 < space_ghost> fantasti-- WTF
13:39 < Jon`C> well of course]
13:39 < Jon`C> because params are pushed left to right
13:39 < Jon`C> just worth noting - the time it uses is whatever the dev intended for param1
13:41 < Jon`C> so yeah. the good news is that jk doesn't support overloads for verbs. the bad news is everything else.
13:42 < space_ghost> these things do go to explain the bizarre issues I had with cog bac
k in the day