Asset Injection supports SPELLS.STD?

Discuss modding questions and implementation details.
Post Reply
User avatar
TacticalTrickery
Posts: 36
Joined: Tue Jan 11, 2022 9:22 pm
Location: Shores of the Iliac
Contact:

Asset Injection supports SPELLS.STD?

Post by TacticalTrickery »

Is there currently support within the asset injector to override the SPELLS.STD file located in the classic game's DF/arena2 folder?

...if so, what is the relative path and case sensitivity within the StreamingAssets directory? (Linux here)

:arrow: I know how to reassign the default old icons to base-game spells, found magic items, trapped objects, enemy spellcasters, and so on; such that 75% of magic is not singularly stacked upon an absurd yellow or orange square. In-fact, I have this ready to go in a fully curated manner, with documentation and infographics. The old "limitations of the engine" are a myth.

To implement this tho, I replace the SPELLS.STD file, which I have manually hex-edited. This works in classic DOSbox Daggerfall (DFC), and of course works the same in DFU because DFU reads that same file from the DFC install. It is seamless. However, it would be optimal to not instruct DFU users to replace a file in their arena2 folder if that same file could simply be asset injected.

I am eager to integrate this into the DFU community. Please advise.
ENEMY SPELLBOOK @Nexus: Yellow-square spam, be gone!!
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: Asset Injection supports SPELLS.STD?

Post by DunnyOfPenwick »

The StandardSpells property or GetClassicSpellRecord() of EntityEffectBroker can give you access to that.

EntitfyEffectBroker loads those spell records in its Start() method.

User avatar
Jay_H
Posts: 4061
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Asset Injection supports SPELLS.STD?

Post by Jay_H »

I'll move this to Modder Discussion due to its topic focus :)

User avatar
Alderwood
Posts: 17
Joined: Mon Aug 22, 2022 3:48 am

Re: Asset Injection supports SPELLS.STD?

Post by Alderwood »

Kab's Unleveled Spells Makes spell icons changeable without messing with the base game. It still uses the ugly yellow and orange squares but it's an improvement :)

User avatar
TacticalTrickery
Posts: 36
Joined: Tue Jan 11, 2022 9:22 pm
Location: Shores of the Iliac
Contact:

Re: Asset Injection supports SPELLS.STD?

Post by TacticalTrickery »

Circular DFU documentation:
Spoiler!
Documentation for asset-injection is unfortunately a circular dead end.
Documentation for asset-injection is unfortunately a circular dead end.
CircularDocs4AssetInjection.png (580.38 KiB) Viewed 1016 times

===================================================

I was hoping for an answer to asset injection by way of a loose file, such that one could make very quick changes to the file in the StreamingAssets folder-structure; mainly for quick testing purposes.
DunnyOfPenwick wrote: Fri Aug 12, 2022 12:11 pm The StandardSpells property or GetClassicSpellRecord() of EntityEffectBroker can give you access to that.

EntitfyEffectBroker loads those spell records in its Start() method.
Thank you for the quick technical reply, Dunny; much appreciated. Unfortunately I do not have any dfmod experience, the dev environment, unity, C# background, or any of the other major tools ready to go. It would be nice to get there eventually, but it currently is (sadly) completely unrealistic for me to try to take on things of that magnitude while I have very limited time and a very large backlog of tasks.

It would, however, be feasible for me to modify the way another person is currently doing it, if I could use the loose file(s) directly at game-runtime, w/o compiling a dfmod file and w/o any dev tools besides a text editor. Is anything like that currently technically possible??

I did see this general json data structure by exporting the code from the way Kab does things...

Code: Select all

Snippet from "SpellRecords.json" (contained in Kab's Unleveled Spells):
    {
        "spellName": "Fenrik's Door Jam",
        "element": 4,
        "rangeType": 0,
        "cost": 0,
        "index": 1,
        "icon": 1,
        "effects": [
            {
                "type": 16,
                "subType": -1,
                "chanceBase": 50,
                "chanceMod": 0,
                "chancePerLevel": 1
            }
        ]
    },
    {
        "spellName": "Buoyancy",
        "element": 4,
        "rangeType": 0,
        "cost": 0,
        "index": 2,
        "icon": 44,
        "effects": [
            {
                "type": 31,
                "subType": -1,
                "durationBase": 5,
                "durationMod": 0,
                "durationPerLevel": 1
            }
        ]
    }
Is it possible to override this data structure in the unmodded game, via loose files and w/o recompiling, but crucially, only override part of the structure?? (the "icon" entry)
  • I'm expecting to be able to connect "index" with "icon" in the struct, leaving everything else untouched at game-default.
I would like to be able to override this structure w/ a loose SpellRecords.json file that is just sitting in my directory tree, not part of a compiled mod. (For my user-speed, and efficiency of testing changes)

Does this json SpellRecords structure exist in a default form somewhere? Is there a way to export the file -- fully intact -- with the unmodded defaults from the unmodded game?

The utility of all this (development speed) is predicated upon not having to rebuild all the default data in the structs by hand, and being able to override the file as a loose item in the OS file-system; no mod creation, no other programming.

...if it isn't possible to override just the "icon" line of each struct, this can still be very useful overriding the whole thing if the defaults are all already available in a file somewhere, or can be exported automatically. Then I would just change the icon line during testing, and overwrite all the other data with itself.
Alderwood wrote: Mon Aug 22, 2022 4:46 pm Kab's Unleveled Spells Makes spell icons changeable without messing with the base game. It still uses the ugly yellow and orange squares but it's an improvement :)
Perhaps Kab has a template he would be willing to let me use to do exactly what I'm aiming for... :?: 8-) Kab?
Kab the Bird Ranger wrote: Tue Aug 10, 2021 1:56 am ...through developing my released magic mod, Skilled Spells...
===================================================

It's worth noting that I'm asking these things here because of the circular-documentation-issue in the Spoiler at-top.
(which I couldn't put down here, because Spoilers are bugged when following Quotes)
ENEMY SPELLBOOK @Nexus: Yellow-square spam, be gone!!
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: Asset Injection supports SPELLS.STD?

Post by DunnyOfPenwick »

It appears you can override values in SPELLS.STD with values from SpellRecords.json, but not as a loose file. The code iterates over the loaded mods and looks for the 'SpellRecords.json' file. However, the mod only needs to contain that one file, not any code, so it should be easy to do.

To change the icons of the standard spells you can use a simple json list format like this

Code: Select all

[
  {
      "index" : 1,
      "icon": 5
  },
  {
     "index":2,
     "icon": 7
  },
  {
      "index": 3,
      "icon": 13
   },
  (etc...)
]
It should replace the 'icon' value for the specified index with the new value, the other values should remain unchanged.

User avatar
TacticalTrickery
Posts: 36
Joined: Tue Jan 11, 2022 9:22 pm
Location: Shores of the Iliac
Contact:

Re: Asset Injection supports SPELLS.STD?

Post by TacticalTrickery »

DunnyOfPenwick wrote: Fri Aug 26, 2022 7:00 pm It appears you can override values in SPELLS.STD with values from SpellRecords.json, but not as a loose file...
Thx, much! 8-) I owe you a round.
ENEMY SPELLBOOK @Nexus: Yellow-square spam, be gone!!
Ancient African proverb: To go fast, go alone. To go far, go together. ~ Humanity's greatest strength is in each other... don't waste it.

Post Reply