[Code] A Thread On Lambdas And Other Epsilons


simplex

Recommended Posts

Awesome! I may be able to get it running on my mac, but I'm not sure how well that will go. :razz:

And I just now pushed a commit to ktools making krane an installable target. You may have noticed that if you did "sudo make install" only ktech was installed to /usr/local/bin. That's because I had disabled krane's installation due to it being in an early stage. That's no longer the case :razz:.

I've been trying to implement a multiple-ingredient recipe and I'm having trouble with it. Could you enlighten me? I've tried passing the ingredient parameter as a table, but that's not working. :razz: I looked at brewing.lua, but it doesn't seem to reference having multiple ingredients.

You'd just add ingredients as a condition:

wetgoop = Recipe("wetgoop", Ingredient("grass", 2) + Ingredient("twigs", 1), 0)
You can also store the ingredient sum in a variable for later use (possibly further adding more ingredients or other conditions). This is meant to allow easy coding of recipes with a common ingredient base.
Link to comment
Share on other sites

And I just now pushed a commit to ktools making krane an installable target. You may have noticed that if you did "sudo make install" only ktech was installed to /usr/local/bin. That's because I had disabled krane's installation due to it being in an early stage. That's no longer the case :razz:.

You'd just add ingredients as a condition:

wetgoop = Recipe("wetgoop", Ingredient("grass", 2) + Ingredient("twigs", 1), 0)
You can also store the ingredient sum in a variable for later use (possibly further adding more ingredients or other conditions). This is meant to allow easy coding of recipes with a common ingredient base.

 

 

I use alias (for things like quickly checking the log, running scml and png, as well as the ktools, spriter, etcetera), are there any benefits to installing? :razz:

 

Awesome. I don't know why I didn't try that.

 

Oh, and I nerfed the white staff to two uses. Are you opposed to allowing players to package the ancient altar? Or do you think that upsets the balance too much?

Link to comment
Share on other sites

I use alias (for things like quickly checking the log, running scml and png, as well as the ktools, spriter, etcetera), are there any benefits to installing? :razz:

Using an alias means it won't be available by use in scripts (unless you give the actual path to it), but otherwise there's no difference using an alias.

 

Oh, and I nerfed the white staff to two uses. Are you opposed to allowing players to package the ancient altar? Or do you think that upsets the balance too much?

How about three uses? Two seems a bit too low :razz:.

But yes, I don't think players should be able to move the ancient altas.

Link to comment
Share on other sites

Using an alias means it won't be available by use in scripts (unless you give the actual path to it), but otherwise there's no difference using an alias.

 

How about three uses? Two seems a bit too low :razz:.

But yes, I don't think players should be able to move the ancient altas.

 

Alright, up to three uses. Also, noted. :razz:

 

I actually do link to the actual path, so it works fine with scripts. I've used them often.

Link to comment
Share on other sites

I found a bug on krane when handling multiple input files. Just pushed a fix.

And it seems to be running fairly efficiently. It took it 2.4 seconds to go through all the builds and animations in the game, extract just the "wilson" build and the anims in the "wilson" bank and make that a Spriter project. But Spriter doesn't seem to be able to open the resulting wilson.scml project. It gives me an unresponsive blank screen. I think the project is simply too large (the resulting wilson.scml file has ~350k lines).

And @debugman18, what happened to your fancy avatar by Willette? And when did you get such an arbitrary title? :razz:

Link to comment
Share on other sites

I found a bug on krane when handling multiple input files. Just pushed a fix.

And it seems to be running fairly efficiently. It took it 2.4 seconds to go through all the builds and animations in the game, extract just the "wilson" build and the anims in the "wilson" bank and make that a Spriter project. But Spriter doesn't seem to be able to open the resulting wilson.scml project. It gives me an unresponsive blank screen. I think the project is simply too large (the resulting wilson.scml file has ~350k lines).

And @debugman18, what happened to your fancy avatar by Willette? And when did you get such an arbitrary title? :razz:

 

This avatar is still a fancy one by Willette, it's just newer!

 

And... I don't know. I noticed it earlier (around an hour ago), but I have no idea when I got it. I got a kick out of it. :razz:

 

Oh, and where was that forum theme you had posted a long while back?

Link to comment
Share on other sites

Oh, and where was that forum theme you had posted a long while back?

Here. But the Lua syntax highlighting broke a while back (Klei changed the Javascript library used for the highlighting). I may revisit the highlighting, since it was after all my main motivation for the reskin :razz:.

Link to comment
Share on other sites

@debugman18

I tweaked a bit the Makefile system, making all makefiles load make/config.mk. So you can run the makefiles inside the subdirectories, if you'd like. For example, say you want to force rebuilding the beanlet anim. Then, instead of removing anim/beanlet.zip or doing "touch exported/beanlet/beanlet.scml", you could cd to the exported/ subdirectory and do

[debaggu exported]$ make -B ../anim/beanlet.zip
Link to comment
Share on other sites

@debugman18

I tweaked a bit the Makefile system, making all makefiles load make/config.mk. So you can run the makefiles inside the subdirectories, if you'd like. For example, say you want to force rebuilding the beanlet anim. Then, instead of removing anim/beanlet.zip or doing "touch exported/beanlet/beanlet.scml", you could cd to the exported/ subdirectory and do

[debaggu exported]$ make -B ../anim/beanlet.zip

 

Did you change how make dist works? I'm trying to use it on my mac, but it's telling me

Is a directory.  Stop.

Or if you could package it for me that would be useful in the meantime. :razz:

 

Edit: I just used the old makefile for the moment.

Link to comment
Share on other sites

Did you change how make dist works? I'm trying to use it on my mac, but it's telling me

Is a directory.  Stop.
Or if you could package it for me that would be useful in the meantime. :razz:

 

Edit: I just used the old makefile for the moment.

The only thing I changed (unless something happened as a side effect) is make the 'dist' target depend on the 'all' target, so whichever assets need compilation are compiled before packaging. Are you sure it's not raising an error within the 'all' target, and then by extension in the 'dist' target? Does running a simple "make" (which is the same as "make all") work without errors for you?

(on my end "make dist" is working)

And by the way, do you know why vines keep moving after they're dead? I can't seem to figure out why they do, but most mobs don't. Printing their brain debug string after they die shows they remain in the ChaseAndAttack state (so they keep chasing you), but other brains don't have special checks for the entity being dead, and I didn't find anything triggering a brain stop on death.

Link to comment
Share on other sites

The only thing I changed (unless something happened as a side effect) is make the 'dist' target depend on the 'all' target, so whichever assets need compilation are compiled before packaging. Are you sure it's not raising an error within the 'all' target, and then by extension in the 'dist' target? Does running a simple "make" (which is the same as "make all") work without errors for you?

(on my end "make dist" is working)

And by the way, do you know why vines keep moving after they're dead? I can't seem to figure out why they do, but most mobs don't. Printing their brain debug string after they die shows they remain in the ChaseAndAttack state (so they keep chasing you), but other brains don't have special checks for the entity being dead, and I didn't find anything triggering a brain stop on death.

 

It might have to do with their ghost physics, but I don't have that issue with the octocopter. Maybe the issue lies in the chaseandattack behavior? It seems that behaviors are quite problematic lately. :razz:

 

Make by itself gives the same error.

Link to comment
Share on other sites

It might have to do with their ghost physics, but I don't have that issue with the octocopter. Maybe the issue lies in the chaseandattack behavior? It seems that behaviors are quite problematic lately. :razz:

Well, ghosts have ghost physics, and this doesn't happen to them :razz:. And in most mobs all physics colliders are removed in the "death" stategraph state anyway, so it couldn't be it. And the ChaseAndAttack behaviour is super common, so this wouldn't explain why this happens just with the vines. I think listening for the "death" event and then stopping their brain would fix it, but this would be a hack; I'd like to know why that happens :razz:.

 

Make by itself gives the same error.

Could you post the entire output of running "make"?

And by the way, passing the "-i" options causes make to ignore errors and proceed. So "make -i dist" should work in the meantime.

Link to comment
Share on other sites

Well, ghosts have ghost physics, and this doesn't happen to them :razz:. And in most mobs all physics colliders are removed in the "death" stategraph state anyway, so it couldn't be it. And the ChaseAndAttack behaviour is super common, so this wouldn't explain why this happens just with the vines. I think listening for the "death" event and then stopping their brain would fix it, but this would be a hack; I'd like to know why that happens :razz:.

 

Could you post the entire output of running "make"?

And by the way, passing the "-i" options causes make to ignore errors and proceed. So "make -i dist" should work in the meantime.

 

-i doesn't help in this case:

 

make: *** /Users/debug/Library/: Is a directory.  Stop.

 

That's what it gives me. I'm cd'd to the UpAndAway directory, so this shouldn't be happening.

Link to comment
Share on other sites

-i doesn't help in this case:

 

make: *** /Users/debug/Library/: Is a directory.  Stop.

 

That's what it gives me. I'm cd'd to the UpAndAway directory, so this shouldn't be happening.

Oh, so this is on your Mac.

What's the output of "make --trace"? If that doesn't say much, "make -d" will print a lot of info, so you'd better redirect it to a file.

Link to comment
Share on other sites

Oh, so this is on your Mac.

What's the output of "make --trace"? If that doesn't say much, "make -d" will print a lot of info, so you'd better redirect it to a file.

 

Yes, I'm using my mac because I'm not at home; haven't been since Saturday. :p

 

This is the info from make -d. It's a little underwhelming. This is also strange because inserting the old makefile allows me to use it as normal.

 

This program built for i386-apple-darwin11.3.0

Reading makefiles...

Reading makefile `Makefile'...

Reading makefile `make/config_loader.mk' (search path) (no ~ expansion)...

Reading makefile `/Users/debug/Library/' (search path) (no ~ expansion)...

make: *** /Users/debug/Library/: Is a directory.  Stop.

Link to comment
Share on other sites

Yes, I'm using my mac because I'm not at home; haven't been since Saturday. :razz:

 

This is the info from make -d. It's a little underwhelming. This is also strange because inserting the old makefile allows me to use it as normal.

 

This program built for i386-apple-darwin11.3.0

Reading makefiles...

Reading makefile `Makefile'...

Reading makefile `make/config_loader.mk' (search path) (no ~ expansion)...

Reading makefile `/Users/debug/Library/' (search path) (no ~ expansion)...

make: *** /Users/debug/Library/: Is a directory.  Stop.

Wait, does... does the full path to the U&A folder contain any spaces?

(and wow, I get 137106 lines of output by running "make -d")

Link to comment
Share on other sites

Wait, does... does the full path to the U&A folder contain any spaces?

(and wow, I get 137106 lines of output by running "make -d")

 

Crap.

 

The 'Application Support' folder is the culprit. Unfortunately, that's an important folder, where SteamApps is located. I think I could potentially relocate my Don't Starve installation, but it's really not necessary since I'll be able to use my desktop again quite soon.

Link to comment
Share on other sites

Crap.

 

The 'Application Support' folder is the culprit. Unfortunately, that's an important folder, where SteamApps is located. I think I could potentially relocate my Don't Starve installation, but it's really not necessary since I'll be able to use my desktop again quite soon.

Don't worry, I'll fix it. The part that uses the absolute path to the current directory is just there for convenience, to avoid copy-pasting code all around.

EDIT: it should be good now.

Link to comment
Share on other sites

@debugman18

I just pushed a tweak to the mod tools (to the scml compiler, specifically) that should prevent the unnecessary recompilation of Spriter projects in exported/ that happened when both the compiled zip in anim/ and the contents of the exported/ subdirectory were pulled in the same commit (in this case, they both have the same modification timestamp, which used to trigger recompilation; I just changed a "less than or equal" to "strictly less than" when comparing timestamps).

Link to comment
Share on other sites

@debugman18

I fixed the egg laying changes you made in Moose.lua. Firstly, it crashed the game because and 'end' was missing for your "if math.random(1, 4) == 1 then" if block, but that's no big deal :razz:. Secondly, the place the random test was being made was wrong. The NewEggDropper function returns a new function which performs the callback. By placing the random test at the top level of the function, you were randomizing the chance of the Moose ever laying eggs, not the chance per attempt (i.e., you were randomizing the chance of it having a callback).

The changes you made to gummybear.lua, owl.lua and vine.lua to disallow targets are also wrong (and in fact were causing these prefabs to never attack anything). The issue is something I also did before: "not a == b" is not the same as "a ~= b", but as "(not a) == b". So in tests like

not guy.prefab == "goose"
you were checking if "not guy.prefab" is equal to "Moose", but "not guy.prefab" equals false (or true, if the prefab name is nil), so the test always fails. Furthermore, I don't think we should ever reference prefab names in other prefabs. It's best to add generic tags and then check for that. I'll do this in a moment.
Link to comment
Share on other sites

I took care of the the targeting bugs and redid this using tags. I added three new tags: cloudneutral, cloudmonster and beanprotector. cloudneutral means it is neutral to the cloud realm, not the player (so the skytrap has it).

I also put it the hack I mentioned before to keep vines from moving after death: I'm stopping their brain when they die. If this issue pops up elsewhere, then we should look further into why it happens.

Link to comment
Share on other sites

I took care of the the targeting bugs and redid this using tags. I added three new tags: cloudneutral, cloudmonster and beanprotector. cloudneutral means it is neutral to the cloud realm, not the player (so the skytrap has it).

I also put it the hack I mentioned before to keep vines from moving after death: I'm stopping their brain when they die. If this issue pops up elsewhere, then we should look further into why it happens.

 

Noted this and the previous post.

 

I didn't realize using guy.prefab == "prefab" would cause issues like that. I guess in the context you described it makes sense though.

Link to comment
Share on other sites

Noted this and the previous post.

 

I didn't realize using guy.prefab == "prefab" would cause issues like that. I guess in the context you described it makes sense though.

The issue is with the "not" behind it. As I said, writing "not a == b" means "(not a) == b", and not "not (a == b)".

Link to comment
Share on other sites

That seems a little unintuitive, but I guess I'll have to get used to it. :razz:

I agree that you'd probably never mean "(not a) == b", since the "not" forces "a" into a boolean, and thus you could simply check "if a then" or "if not a then" directly. But in most programming languages the "not" operator does bind more tightly than equality. Though that didn't keep me from doing this same mistake in U&A before :razz:. But, well, that's what the inequality operator "~=" is for.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.