$12256 / $11500
Hello, im making a mod for Flare, sadly Flare doesnt include a random loot generator and all of them must be defined by hand one by one. The definitions are pretty simple; ex:
[item]
id=31
name=Reinforced Pants
INCLUDE items/base/armor/cloth/legs.txt
gfx=Reinforced_pants
level=2
price=250
abs=1,2
I want to make a small program that will take some values and output something like that, its been 10 years since i last programmed, is there something with little to no dependencies and dirty easy to use?
This would be separate from the FLARE game itself? Hmm... What languages do you know already (if any)?
--Medicine Storm
Yes, i would like to make a small program that outputs what i want, then i can just paste the results on the neccesary txt. I have a C base, so at least the basic are there. The ligther the thing, the better; i just need a few text input boxes, check boxes and a couple of button that will randomize/generate.
I think that using HTML for the interface and JavaScript for the logic would be the lighter (you literally just need a text editor and your browser) and the easier way to achieve this. If you have no text editor, I advise you Visual Studio Code, it is free, easy to use, and it will help you with HTML and JavaScript.
You will find a lot of documentation on the web, but I can advise you to have a look at Mozilla Documentation, I think you will be interested by the HTML, JavaScript and Forms sections.
You can also surely achieve this by asking StackOverflow and copy-pasting snippets. ;)
As much as I generally dislike JavaScript, I have to agree with pvigier. That seems like the most straightforward option for you.
Vs code is a pretty great suggestion as well, for the you-have-to-download-and-set-something-up option.
--Medicine Storm
Thanks guys, i guess there is nothing easy on this life. I will get back to you when i start this creature.
I have a half-baked attempt at the same. It's on its 4th iteration now, and still doesn't reach its raison d'être. Let me share what little I can.
I started on MiniScript because there is a minuscule yet non-zero chance that it might be considered for Flare. Don't bother. I only found disadvantages, obstacles and frustration. I turned to JS in a browser. I'm not fond of JS either, but it is the most widely deployed environment around. Since you are reading this, you already have all you need.
At first I started parsing Flare's item files, but then I realized that only the Empyrean Campaign has an items.txt. Which meant that there was no need to. As a human defining items it's so much easier to work in a spreadsheet, and it so happens that parsing that was also easier. Just c&p the spreadsheets' contents into textareas and work on the data from there. Then you can output a whole items.txt, which is also easier to generate than to parse.
I realized a lot of things along the way, some of which escape me as I write this. For instance, if one wants modifiers that override a base stat, modifiers that multiply it, and modifiers that add/stack, one has to come up with pretty complicated rules to keep the output consistent and repeatable (I stuck to additive modifiers only). If you want your modifiers to get a value from an interval, you'll have to come up with a notation. Multi-valued attributes are still an unsolved problem for me. I mean, for ex., a modifier that raises all of damage and accuracy (a fairly common modifier). For many reasons it is best to define and store and treat them as separate entries, but then I have yet to come up with a way to apply them as a whole.
Then comes the combining. The basic operation is a cross product between modifiers and items. I have them match on item_type and equip_flags. As a cross product, you'll end up with powerful modifiers attached to lesser items. That's undesirable, and the deprecated item level attribute may serve to manage that. I haven't dealt with that yet. Things get more complicated when/if you want combining rules to define qualities. As in, basal quality items have none, quality A gets 1 or 2 modifiers, quality B gets 3 or 4, etc.; and which are available for which. That was what I was tackling lately.
And I say "was", because with the value-from-intervals thing, and the unmanaged cross product, there are much more powerful items, with more modifiers and more variation, than regular items. I hadn't worried. I remembered vaguely, from my initial exploration of the engine, a loot system for that. Then I went to have a look. And saw that it comes close to having to declare every single drop chance for every single item for every single time and place that it may get dropped. That took out all of my momentum.
I don't know if I just need a break, or if I'm going to retake the work. But some of the ideas may be of interest to you, perhaps even a bit useful.
Thanks, it helped to define what i want a bit. I fully know everything in flare is complex, not for the faint hearted.