[Archived] Original Mod Collaboration Thread


Recommended Posts

@debugman18Good news, I plugged wicker into Up and Away and it just worked. No changes required on either end, except for slimming down a bit more the mandatory variables in the environment to fit into worldgen (it divides imports into "mandatory" and "optional", so I just put a few things from mandatory into optional).

Edited by simplex
Link to comment
Share on other sites

@debugman18Good news, I plugged wicker into Up and Away and it just worked. No changes required on either end, except for slimming down a bit more the mandatory variables in the environment to fit into worldgen (it divides imports into "mandatory" and "optional", so I just put a few things from mandatory into optional).

That's great! Glad it didn't fight with it. I'm definitely curious to dig into it.

 

I'll probably be doing more work on fleshing out what's already in the mod, and then work on more the more wip content.

 

And that 'manual' was a wonderful idea, @lifemare. It makes for a wonderful reference, without cluttering up the OP.

Edited by debugman18
  • Like 4
Link to comment
Share on other sites

That's great! Glad it didn't fight with it. I'm definitely curious to dig into it.

Take your time, since it's quite big (adding it made my count of character insertions in Up and Away jump to 7,389 :razz:), and it's strongly functionally flavored (the file paradigms/functional.lua is the center of it all, having no dependencies on other files). Just keep away from init.lua and the files in api/, since they mostly deal with low level stuff to build the necessary infrastructure.Anyway, now modmain.lua just defines assets, prefabs and bootstraps wicker. modworldgenmain.lua just bootstraps wicker and defines an alias for the configuration key (so that configuration values can still be accessed through TUNING.UPANDAWAY, avoiding code refactoring). The actual code from modmain.lua is (unchanged) in scripts/upandaway/main.lua, and the code from modworldgenmain.lua is in scripts/upandaway/worldgen_main.lua.The "official" way to access configuration values (in files with the header bootstrapping the wicker environment) is through TheMod:GetConfig(). Calling just TheMod:GetConfig() will return the configuration table, with the contents of rc.lua. Alternatively, you can give the sequence of fields as parameters to GetConfig. So, for example:
-- The three versions are almost the same thing.local numbeans1 = TheMod:GetConfig("SHOPKEEPER", "NUM_BEANS")local numbeans2 = TheMod:GetConfig("SHOPKEEPER").NUM_BEANSlocal numbeans3 = TheMod:GetConfig().SHOPKEEPER.NUM_BEANS
The only difference between the 3 is that when you're directly indexing things as tables, if that table is not defined in the configuration file you'll get a crash for trying to index nil. On the other hand, when passing the intermediate fields as strings to GetConfig(), if the indexing turns nil along the way it'll just return nil.TheMod also has many fields and methods. All the postinits and related functions (such as AddLevel) are methods of TheMod, that you'd call as TheMod:AddPrefabPostInit("wilson", some_function). Alternatively, stating "BindTheMod()" in a file makes it run "inside" TheMod, so you'd call these functions directly like in modmain. The postinits* inside TheMod have a few conveniences when compared to the usual ones. The most notable one is that passing a table makes it branch out. For example:
TheMod:AddPrefabPostInit({"beefalo", "babybeefalo"}, {some_func, another_func})
will add both postinit functions to beefalo and babybeefalo (this is not a positional match, this is the same as writing 4 lines of code to add each postinit to each prefab).Also, modinfo is a field of TheMod (TheMod.modinfo), so you can access its entries anywhere in the code, to get things like the full mod name, its version, its authors, etc. MODROOT acts like a "global" variable anywhere (that has the wicker header). Finally, the mod environment is at TheMod.env, so if you'd like you can directly access everything that was in the mod environment by TheMod.env.MODROOT or similar (I never found a use for that, though, I just put it there for the peace of mind that it'd be impossible for code running under wicker to be more limited to code running otherwise).* Just the post and pre inits. Things like AddLevel, AddAction, etc. work exactly like their standard versions, since they don't have a uniform structure (and may receive tables as arguments). Edited by simplex
Link to comment
Share on other sites

Just an update on what I'm currently doing: I'm studying the worldgen code (since that's a part of the game I barely know anything about), because I feel work on worldgen precedes adding the static mechanic (which would be tightly integrated to it). Also, this also speaks directly to the snail king mod and its set piece, so I feel that's the most important thing right now.

  • Like 1
Link to comment
Share on other sites

Just an update on what I'm currently doing: I'm studying the worldgen code (since that's a part of the game I barely know anything about), because I feel work on worldgen precedes adding the static mechanic (which would be tightly integrated to it). Also, this also speaks directly to the snail king mod and its set piece, so I feel that's the most important thing right now.

 

Just found the Snail King thread now. There's nothing like the SuperMod for ages, and then two come along at once, convieniently while I'm on holiday, giving me a few thousand posts to read. [Grr] It's looking great so far though.

Link to comment
Share on other sites

I converted the NEWS file to Markdown (which is basically intuitive plain text, debugman's version was pretty much Markdown already), so it'll present itself more nicely than a plain text file.GitHub's code browser processes Markdown natively. See the NEWS file at:https://github.com/debugman18/UpAndAway/blob/master/NEWS.mdFor comparison, this is the "source" for it:https://raw.github.com/debugman18/UpAndAway/master/NEWS.md

Edited by simplex
Link to comment
Share on other sites

Question to all: how should we name the "up and away" world? This name (which is "forest" for regular worlds and "cave" for caves) will not really show to mod users, being just a code identifier, but since it's an important one I'd like to hear your thoughts.

Link to comment
Share on other sites

Question to all: how should we name the "up and away" world? This name (which is "forest" for regular worlds and "cave" for caves) will not really show to mod users, being just a code identifier, but since it's an important one I'd like to hear your thoughts.

 

Erm?

 

Cloud Realm? I don't know, but I like the word 'realm'.

  • Like 1
Link to comment
Share on other sites

First conclusion by studying the worldgen: there really is no way to set up the cloud realm as a survival map. This is because if a current level type (i.e., "survival", "adventure" or "cave") already exists for a given saveslot, that level will be loaded instead of triggering worldgen.EDIT: The grammar nazis in the forums will love this (map/forest_map.lua):

local defalt_impassible_tile = GROUND.IMPASSABLE
Edited by simplex
Link to comment
Share on other sites

First conclusion by studying the worldgen: there really is no way to set up the cloud realm as a survival map. This is because if a current level type (i.e., "survival", "adventure" or "cave") already exists for a given saveslot, that level will be loaded instead of triggering worldgen.EDIT: The grammar nazis in the forums will love this (map/forest_map.lua):

local defalt_impassible_tile = GROUND.IMPASSABLE

 

Do you mean that trying to climb the beanstalk after entering the Caves will result in the player entering the Caves?

 

Or have I completely misunderstood the issue?

Link to comment
Share on other sites

Yeah, I was gonna get rid of that. Trying to improve the Beak now.

 

EDIT:

Posted Image

Hooray! The Front is done. Side still missing some pieces, and the Back has nothing there except eyes. Anyway, a completed basic model could conceivably be done later tonight.

maybe i'm late but, did you try the Damaged Bishop model? It has some sprung out metal pieces that could look like ings, and the beak would be smaller.

Link to comment
Share on other sites

maybe i'm late but, did you try the Damaged Bishop model? It has some sprung out metal pieces that could look like ings, and the beak would be smaller.

 

I like the Knight model. It gives some interesting movement to the Duck Longbill, and makes it stand out a bit more.

 

I would try the Bishop, but I think the Knight works better.

Link to comment
Share on other sites

Do you mean that trying to climb the beanstalk after entering the Caves will result in the player entering the Caves?Or have I completely misunderstood the issue?

What thay means is if (in our code) the 'realm' should be set up as adventure (technically, since the adventure play should never load it) instead of as a survival world. Basically, what would happen if it was survival, is that the beabstalk wouldn't take you anywherr new, since it loads the savedata from the survival slot.
Link to comment
Share on other sites

What thay means is if (in our code) the 'realm' should be set up as adventure (technically, since the adventure play should never load it) instead of as a survival world. Basically, what would happen if it was survival, is that the beabstalk wouldn't take you anywherr new, since it loads the savedata from the survival slot.

 

Will that end up making too much of a difference? Does an Adventure world have to have an end-goal or something, or is it just we have to use a different strand of code to normal mods?

Link to comment
Share on other sites

Will that end up making too much of a difference? Does an Adventure world have to have an end-goal or something, or is it just we have to use a different strand of code to normal mods?

Adventure worlds don't save when you exit them. I think. Like. If you go down the beanstalk, and come ba k up, a new world generates. If I'm remembering correctly.
Link to comment
Share on other sites

Will that end up making too much of a difference? Does an Adventure world have to have an end-goal or something, or is it just we have to use a different strand of code to normal mods?

It means that we're limited to using adventure save slots or cave save slots, which means that we're going to have to rig something up to save properly, since adventure save slots don't, well, save, except upon completing a level. It doesn't mean much to those who aren't working on the code.

Link to comment
Share on other sites

It means that we're limited to using adventure save slots or cave save slots, which means that we're going to have to rig something up to save properly, since adventure save slots don't, well, save, except upon completing a level. It doesn't mean much to those who aren't working on the code.

 

Ah yes, I forgot about the exiting issue. Duh.

Edited by ArcticFox789
Link to comment
Share on other sites

How should player death be handled? Permadeath? Respawning at the beanstalk's bottom?

 

p.s.: And debugman, your choice of CAMPAIGN_LENGTH + 1 for the cloud world was not ideal (blame the game for being misleading): the epilogue has id CAMPAIGN_LENGTH + 1, being possible for the cloud level to appear in adventure mode (check SaveIndex:BuildAdventurePlaylist()). It should be CAMPAIGN_LENGTH + 2, at least. Alternatively, we can just degenerate its interval: if the maximum position is lower than the minimum one, it'll never be chosen regardless of the actual values.

 

But I'm still not sure if it's best to use adventure mode or caves as a base. Both have so much hardcoded behaviour. :/

Edited by simplex
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share