Spellbook Injector V2
spellbook_injector_V2.jpeg - width=225 height=225
learn_from_custom_tomes.jpg - width=1920 height=1035
learn_from_duels.jpg - width=1920 height=1035
Here's most of the original description of this mod from r3m's posting, since I can't improve on it, updated for V2.
Mod Overview
The Spellbook Injector is a utility mod that loads custom spells into the game. These spells won't override any EAxian tuning, which ensures that creations from different modders will be compatible!
If you're a modder interested in making new spells for Spellcasters, then this is for you! The Spellbook Injector will take care of all the scripting required to inject a new spell, so you don't have to worry about maintaining a Python script. Instead you can focus on the tuning of you spell. For more details and documentation about developing your own spells, see r3m's original posting.
Features
Below is a list of what the Spellbook Injector (V2) actually does:
- injects spells developed by modders to the spellbook
- allows injected spells to be learned randomly through one of the following interactions:
- -- "Ask to Teach Spell"
- -- "Duel for Knowledge"
- -- "Practice Magic"
-
-makes custom magic tomes purchaseable in Caster's Alley's market stall-(This feature is currently disabled) - makes custom magic tomes findable through the "Search for Tomes" interaction
- unlocks custom spells for newly generated Sages
- allows injection of potential outcomes that result from the Curse of Scrambled Spells
- allows injection of interactions that are exclusive to spellcasters
Installation & Testing
If you had previously installed the original version of the Spellbook Injector, remove it before installing this version.
Spellbook_Injector_V2.zip is the main download meant for users. It contains 2 files, which must go (no deeper than one 1 folder) inside your "Mods" folder.
File | Description |
---|---|
r3m_spellbook_injector_V2.package | Required tuning for the Spellbook Injector |
r3m_spellbook_injector_V2.ts4script | Required script for the Spellbook Injector |
Readme.txt | Instructions for use |
Version 2 Notes
This fix is compatible with all spells that were written for V1 of the Spellbook Injector, as the changes I made to fix it were fairly minor. There is one bit of functionality that has been disabled for the time being: making custom magic tomes purchasable from Caster's Alley in the Magic Realm. Many users reported issues with being able to buy anything a the RoM market stalls while V1 of this mod was installed, so I disabled that for now.
TO ENSURE CONTINUE SUPPORT OF THIS MOD I have included the current Python source code within the .ts4script archive. If I vanish too, hopefully other modder can pick it back up and continue supporting it. This mod lets us do some cool things, and we should try to keep it around.
What exactly was 'fixed' in V2?
The error that V1 had been throwing originated in the spell loading code.
The main cause was the code that attempted to write directly to log files in the user's Mods folder. It ended up generating an invalid path on a Mac, so the code threw an error when it tried to log the spells that had been injected. I considered fixing the code that generated the log file paths to work correctly on a Mac, but in the end decided that it was better to use the Sims 4 built-in logging functionality. These logs aren't normally generated and viewable on a user's machine, but if you install Scumbumbo's Log Enabler, you can see all of them, including the Spellbook injector log.
So _tuning_loaded_callback in __init__.py changed from this:
@classmethod def _tuning_loaded_callback(cls) -> None: try: if Tuning.IS_WITCH_BUFF is None: msg = f'{cls}: no tuning for the witch interactions. Check both the package and ts4script were installed properly.' logger.error(msg) raise ValueError(msg) if cls.witch_interactions is not None: cls.inject_witch_interactions() else: logger.info(f'{cls}: no witch interactions.') except BaseException: msg = f'{cls}: exception ocurred while processing' logger.error(msg) with open(get_log_file(), get_log_mode()) as infile: infile.write(msg) infile.write(traceback.format_exc()) infile.write('\n\n')
To this:
@classmethod def _tuning_loaded_callback(cls) -> None: try: if Tuning.IS_WITCH_BUFF is None: msg = f'{cls}: no tuning for the witch interactions. Check both the package and ts4script were installed properly.' logger.error(msg) raise ValueError(msg) if cls.witch_interactions is not None: cls.inject_witch_interactions() else: logger.info(f'{cls}: no witch interactions.') except BaseException: msg = f'{cls}: exception occurred while processing' logger.error(msg)
The same change was made to spells.py in _tuning_loaded_callback:
@classmethod def _tuning_loaded_callback(cls) -> None: try: if cls.spells: for (spell, injection_data) in cls.spells.items(): cls.inject_spell(spell, injection_data) cls.sort_entries() logger.info(f'{cls}: loaded {len(cls.spells)} spells.') else: logger.info(f'{cls}: no spells loaded.') super()._tuning_loaded_callback() except BaseException: msg = f'{cls}: exception ocurred while processing' logger.error(msg) with open(get_log_file(), get_log_mode()) as infile: infile.write(msg) infile.write(traceback.format_exc()) infile.write('\n\n') return with open(get_log_file(), get_log_mode()) as infile: infile.write(f'{cls}: processed correctly.
New code:
@classmethod def _tuning_loaded_callback(cls) -> None: try: if cls.spells: for (spell, injection_data) in cls.spells.items(): cls.inject_spell(spell, injection_data) cls.sort_entries() logger.info(f'{cls}: loaded {len(cls.spells)} spells.') else: logger.info(f'{cls}: no spells loaded.') super()._tuning_loaded_callback() except BaseException: msg = f'{cls}: exception occurred while processing' logger.error(msg) return logger.info(f'{cls}: processed correctly.')
Finally, in the inject_spell function in spells.py, I commented out the call to inject the custom tomes into the market stalls in Caster's Alley until I get time to look into why it causes problems.
# if injection_data.learning.magic_tome.can_be_bought: # SpellbookInjector.inject_to_purchase_tomes(injection_data.learning.magic_tome.definition)
Spellbook_Injector_V2.zip
Download
Uploaded: 3rd Sep 2021, 23.5 KB.
89,756 downloads.
|
||||||||
For a detailed look at individual files, see the Information tab. |
Install Instructions
1. Download: Click the File tab to see the download link. Click the link to save the .rar or .zip file(s) to your computer.
Read the upload description for installation instructions. If nothing else is specified, do the following:
2. Extract: Use WinRAR (Windows) to extract the .package file(s) (if included, ts4script as well) from the .rar or .zip file(s).
3. Cut and paste the .package file(s) (if included, ts4script as well) into your Mods folder
- Windows XP: Documents and Settings\(Current User Account)\My Documents\Electronic Arts\The Sims 4\Mods\
- Windows Vista/7/8/8.1: Users\(Current User Account)\Documents\Electronic Arts\The Sims 4\Mods\
Need more information?
- Anyone can use both .rar and .zip files easily! On Windows, use WinRAR.
- If you don't have a Mods folder, just make one.
- Mod still not working? Make sure you have script mods enabled
Loading comments, please wait...
Updated: 31st Oct 2021 at 9:28 PM
-
by scumbumbo updated 26th Mar 2019 at 10:38pm
192 419.4k 430
-
by siriussimmer updated 30th Aug 2021 at 12:10am
+1 packs
Cottage Living
-
by Simsonian Library updated 12th Dec 2021 at 6:24pm
+7 packs
Outdoor Retreat
Cats and Dogs
Seasons
Cottage Living
Horse Ranch
Jungle Adventure
Realm of Magic
-
by Meep62 updated 22nd Aug 2022 at 3:10am
47 123.5k 152
-
Werewolrify (Werewolf creation spell)
by Rolwen updated 9th Aug 2022 at 10:13pm
+2 packs
Realm of Magic
Werewolves
-
by Tralfaz482 updated 29th Oct 2024 at 9:59pm
+1 packs
Get to Work
-
by Tralfaz482 updated 11th Aug 2024 at 1:35am
+1 packs
Get to Work
-
by SimmingWithP&J updated 30th Jun 2023 at 2:27am
12 14.5k 20
-
by TURBODRIVER updated 23rd Nov 2024 at 10:43am
7 9.9k 17
-
by Simsonian Library 5th Sep 2021 at 11:35pm
The last thing you want to worry about when you’re scaling Mt Komorebi or charting the unknown depths of the more...
+1 packs
Eco Lifestyle
-
by Simsonian Library 4th May 2022 at 12:56pm
Perfumery adds the Perfumery Skill that enables your sims to make functional perfume from flowers. There are 14 different scents that more...
-
by Simsonian Library updated 27th Jul 2022 at 10:22pm
The Magazine Kit adds functional magazines to the Sims 4. more...
-
Food & Beverage Supplier License
by Simsonian Library updated 27th Jul 2022 at 10:26pm
The Food & Beverage Supplier License is available in the Aspiration Rewards Store for 500 satisfaction points. more...
25 23.3k 60
-
by Simsonian Library updated 12th Dec 2021 at 7:24pm
The Classic RPG Spells collection contains a selection of Sims 4 spells inspired by old school role playing games, with more...
+7 packs
Outdoor Retreat
Cats and Dogs
Seasons
Cottage Living
Horse Ranch
Jungle Adventure
Realm of Magic
-
by Simsonian Library updated 2nd Nov 2021 at 2:13am
Are you a wizard with too many chores around the house to have enough time for wizarding? Try the new more...
+2 packs
Discover University
Realm of Magic
-
by Simsonian Library 18th Apr 2022 at 5:49am
This download includes versions of 14 kitchen cabinets found in the base game and various packs modified to each have more...
+1 packs
Vampires
-
by Simsonian Library updated 1st Sep 2022 at 3:34am
The Archaeology Kit mod expands the Sims 4 archaeology features from Jungle Adventure to work in every region (even Batuu). more...
+17 packs
Get to Work
Get Together
City Living
Cats and Dogs
Seasons
Get Famous
Island Living
Discover University
Dine Out
Eco Lifestyle
Snowy Escape
Vampires
Bowling Night Stuff
Jungle Adventure
Realm of Magic
Nifty Knitting Stuff
Paranormal Stuff
-
by Simsonian Library updated 3rd Jan 2023 at 3:30pm
The Simsco Canning Factory can be loaded with produce and dairy ingredients, then used to convert them into boxes of more...
+2 packs
City Living
Cottage Living
-
by Simsonian Library 29th Dec 2021 at 4:24pm
Pirate Treasure is my take on treasure maps and buried treasure chests. more...
+1 packs
Island Living
Packs Needed
Base Game | |
---|---|
![]() | Sims 4 |
Game Pack | |
---|---|
![]() | Realm of Magic |