Here's the semi-long-awaited thread containing my various feature requests for things actually usable in modules. (Called wishlist because let's be honest none of these are gonna be terribly high-priority.)
Let's start with a simpler one:
More combat hooks
This one's pretty simple, at least from the description perspective. I would like an additional hook for when a combat participant tries to attack something that fires after damage has been rolled, but before the number is shown or applied. My use case is that I'd like to be able to modify the incoming damage before it's applied as a way of simulating elemental weapons (sort of like if Pokémon was an RPGMaker game).
In other words, I want this:
Code: Select all
combat:BeforeDamage(function(source, target, damage)
-- Modify and return new damage value.
-- Returning 0 here could also allow making it a miss.
return damage * 1.5
end)
Scripted dice rolls
Alright so here's a more interesting one: I want to be able to display dice rolls outside of combat. The use I have for these is stat checks in say, traps (or I guess if someone wanted to use it for a gambling NPC). Now I can already recreate the roll in Lua, but I also want the cool graphical part (which is also arguably the best part).
Anyway, so here's what I'd like to have (wow that's a lot of parameters):
Code: Select all
ShowDiceRoll(
leftDiceCount,
leftNumber,
leftName,
rightDiceCount,
rightNumber,
rightName,
leftStatus,
rightStatus,
leftStyle,
rightStyle)
Parameters: leftDiceCount (number) - the number of dice to display on the left side
leftNumber (number) - the total value of the dice on the left side
leftName (string) - the name to show on the left side
rightDiceCount (number) - the number of dice to display on the right side
rightNumber (number) - the total value of the dice on the right side
rightName (string) - the name to show on the right side
leftStatus (optional string) - the text to show under the name on the left side, defaults to the one associated with the style (except generic means empty string)
rightStatus (optional string) - the text to show under the name on the right side, defaults to the one associated with the style (except generic means empty string)
leftStyle (optional EDiceStyle) - the style of the dice on the left side, defaults to AllyGeneric
rightStyle (optional EDiceStyle) - the style of the dice on the right side, defaults to EnemyGeneric
Where "EDiceStyle" is:
Code: Select all
enum EDiceStyle
.AllyAttack the "blue sword" die icon
.AllyDefense the "blue shield" die icon
.AllyGeneric the "white-and-black" die icon
.EnemyAttack the "red sword" die icon
.EnemyDefense the "red shield" die icon
.EnemyGeneric the "red-and-white" die icon
Okay, so there's a bit more than a few parameters here. If this were added it may very well be the most parameter-dense Lua-exposed function yet. I've tried to provide some sensible defaults so there's less need to provide all ten parameters, but four of them are still essential and two can't easily have reasonable defaults.
Regardless, the idea is that you invoke the function (probably during a scene, or maybe as part of a combat round) and it'll block execution long enough for it to display the dice and hide itself again. The die icons for each style can be distributed randomly amongst the available dice.
Tables in save data
And we're right back to boring feature requests with this one: tables in save data. I think I talked about this in the DeepForest thread, although I'm pretty sure that got derailed with other feature requests (of varying use). Basically, I want a Storage.SetTable function I can just toss a table into and obtain later using Storage.GetTable. Metatables really need not be preserved — we don't need Lua bytecode in the save files.
Behind the scenes there's probably two options. Option 1 is this table could get serialized to JSON (I'm pretty sure the editor has a JSON library that the game could borrow) and stored as if it were a string.
Alternatively — and I only became aware of this possible option when I messed with save files 1-2 weeks ago — option 2 is more PropertyBag abuse. I know the save format is already structured (and indeed, does support nested 'objects') so this could just be a way of reading/writing full PropertyBags. I think this approach would necessitate additions to the data types a PropertyBag can contain however, since AFAIK they cannot store lists (among other things).
Anyway, I don't imagine many people would use this feature, but I would. Deep Forest would certainly make use of it, and I have at least one other module I'd like to make eventually that would absolutely need it (unless I pack in a second JSON parser).
Obfuscating the day-night cycle
This one's pretty niche, but I'd like the ability to change the texture used for the time spinner so that the player can't easily tell the current time (while still being able to tell that time is passing). The reason I want this is so I can create dungeons that the player can't tell time in, since they wouldn't be able to see the sky (or well, not the same sky).
Logging the log
This isn't exactly a module thing, but I'd like the option to mirror the story output to a file for e.g. debug output that looks really bad without a monospace font. (You won't believe how crunchy the Deep Forest debug output was when I was trying to get the maze generator to behave. Let's just say it was less of a maze and more of a soup.)
Alright I think that's all of the feature requests I have right now. Honorable mentions go to scene patches (which are in progress I think) and bit32, which is actually done now. Neat. Oh yeah and also the asset querying API, which is also done. (Format 21 is no longer just the "whoops your furballs shrunk in the wash" update, it's now also the "self-aware modules" update and the "bits can shift as a treat" update.)