Sitra Achara
Arcane
- Joined
- Sep 1, 2003
- Messages
- 1,859
Owing to interest in making new spells for ToEE, I'm opening this new thread
I'll be concentrating spell-making knowledge here, and also requests so I don't forget them. Please use the discussion thread for discussion.
Relevant files
Note about irrelevant files:
Starting Out
To start you off, take a look at existing files for spells that are similar to those you want to create. They are for the most part self explanatory, though there are some gotchas.
If there's nothing even remotely similar, odds are it's complicated to do and/or requires a high level of know-how and effort. As in months of learning and work, depending on how faithful you want to be to the spell. I believe all the low-hanging fruit have been picked by previous generations of modders, but who knows.
Spell Enums
Spell enums (or spell numbers) are unique identifiers for spell entries. They must match across the python script and rules\spells entry. They are also used to obtain the sound IDs from snd_spells.mes, and various other things.
Vanilla ToEE allows spell enums up to 801. In Temple+ this has been expanded up to 3999.
Reserved ranges
Cleric Domain Spells
There are 22 domains in ToEE (23 including "Domain Special" which is used by monsters).
There's a decent summary of available domain spells in Co8 8.1.0 here. You can also use the ingame wiki.
Additional Spells
Co8 has released a tragically obscure addon for 8.1.0 with expanded domain spells and several other new spells here. Noting this here to prevent duplicate work and also to maintain compatibility with that addon.
Python Scripts
Besides looking at other spell scripts, you can refer to the Scripting API page for information on available python methods (commands). It's also possible to request new ones for Temple+
Other than that you can refer to general ToEE modding tutorials:
Ted's ToEE Modding Tutorials (available as PDF)
Co8 technical reference
It's also recommended to use a good IDE for editing scripts - you'll catch silly errors early this way and save yourself a bit of hair pulling. I personally recommend PyCharm (get the free Community edition).
Advanced - Making New Spell Effects
You will have probably noticed by now that a lot of spell effects are generated by a command of the form:
The 'sp-XXX' effects are all hardcoded. You can find a list of them here:
https://github.com/GrognardsFromHell/DllDocumentation/wiki/Conditions-(List)
https://github.com/GrognardsFromHell/DllDocumentation/wiki/Conditions-List-Pt2-(spell-effects)
You can sometimes mix and match different effects to create new spells, and some things can be emulated with clever workarounds. But sometimes you won't find anything suitable, and workarounds can be be bug-prone or clunky.
It is fortunately possible to create completely new spell effects using Temple+'s Python Modifiers.
This is quite a bit more complex than normal ToEE scripting, but it's the only way you can have new AoE effects for example, or otherwise create spell effects that don't have 'baggage' from other spells.
Making Particle Systems
Tutorials for particle system making are available at the Co8:
http://www.co8.org/community/index.php?threads/particle-system-tutorial-2016-edition.11973/
http://www.co8.org/community/index.php?threads/particle-system-tutorial.7317/
There's also a particle system editor that Pugmeister made. It's a bit clunky and not quite full featured, but it has one huge advantage over the V2brute - you can see the result of modifications instantly.
Link: TemplePlusTools build 1186
To get it going you need to do the following:
Item Spells & Crafting
To define a scroll, wand or potion bearing the new spell, you need to add an entry to protos.tab. It's recommended to use the Co8 World Builder tool.
Take a look at a similar item and make a duplicate. You then change the relevant properties (click Cnfg and select Potion/Scroll to filter it down to relevant fields).
In particular, you need to change the content of the first Spell field.
The format is as shown above:
Where
<SPELL NAME> is the spell name. It needs a matching entry in in rules\spell_enums.mes (in the 5000 range).
<SPELL LEVEL> is the spell level. The caster level is automatically set by the game to be spell level * 2 - 1
class_<X> is the class enum - currently it only supports the vanilla classes.
Publishing Your Files
So you've got your new spell in place, probably by editing the files from the Co8 folder. How do you ensure they don't clash with other people's contributions?
With Temple+, you can now create "extender files" for several things, including partsys.tab files, spell.mes and snd_spells.mes.
Packing files to .DAT
You can pack files to .dat files. See this for more information:
https://github.com/GrognardsFromHell/TemplePlus/wiki/Modding#files
Other Relevant links
http://www.co8.org/community/index.php?threads/learning-how-to-get-a-new-spell-in-game.7294/
I'll be concentrating spell-making knowledge here, and also requests so I don't forget them. Please use the discussion thread for discussion.
Relevant files
- The python script file
located in data\scr\
Of the form spellxxx - abcd.py
- Spell rules entry file
Located in data\rules\spells\
Of the form xxx - abcd.txt
- Spell strings
data\mes\spell.mes
- Particle effects
data\rules\partsys0.tab
data\rules\partsys1.tab
- Spell event sound effects
data\sound\snd_spells.mes
Note about irrelevant files:
You may notice there's also a file data\rules\SpellList.mes. It does nothing and is not used by the game. Might be an Arcanum leftover or something from early development.
There's also data\rules\spell_enum.mes. This one is irrelevant for Temple+
There's also data\rules\spell_enum.mes. This one is irrelevant for Temple+
Starting Out
To start you off, take a look at existing files for spells that are similar to those you want to create. They are for the most part self explanatory, though there are some gotchas.
If there's nothing even remotely similar, odds are it's complicated to do and/or requires a high level of know-how and effort. As in months of learning and work, depending on how faithful you want to be to the spell. I believe all the low-hanging fruit have been picked by previous generations of modders, but who knows.
Spell Enums
Spell enums (or spell numbers) are unique identifiers for spell entries. They must match across the python script and rules\spells entry. They are also used to obtain the sound IDs from snd_spells.mes, and various other things.
Vanilla ToEE allows spell enums up to 801. In Temple+ this has been expanded up to 3999.
Reserved ranges
- 600-699 are reserved for creature spell-like abilities.
- 802-813 are reserved for internal Engine usage (these represent the empty spell slots for each level)
- 850-900 reserved for Etharil
- 901-950 reserved for Kosiciel
- 951-999 reserved for Endarire
- 1605-1614 are reserved for internal Engine usage (these represent the spell level labels).
- 3000-3999 are reserved for spell-like class abilities (for example: the new Bard songs).
Cleric Domain Spells
There are 22 domains in ToEE (23 including "Domain Special" which is used by monsters).
There's a decent summary of available domain spells in Co8 8.1.0 here. You can also use the ingame wiki.
Additional Spells
Co8 has released a tragically obscure addon for 8.1.0 with expanded domain spells and several other new spells here. Noting this here to prevent duplicate work and also to maintain compatibility with that addon.
Python Scripts
Besides looking at other spell scripts, you can refer to the Scripting API page for information on available python methods (commands). It's also possible to request new ones for Temple+
Other than that you can refer to general ToEE modding tutorials:
Ted's ToEE Modding Tutorials (available as PDF)
Co8 technical reference
It's also recommended to use a good IDE for editing scripts - you'll catch silly errors early this way and save yourself a bit of hair pulling. I personally recommend PyCharm (get the free Community edition).
Advanced - Making New Spell Effects
You will have probably noticed by now that a lot of spell effects are generated by a command of the form:
Code:
target_item.obj.condition_add_with_args( 'sp-XXX', spell.id, ... )
The 'sp-XXX' effects are all hardcoded. You can find a list of them here:
https://github.com/GrognardsFromHell/DllDocumentation/wiki/Conditions-(List)
https://github.com/GrognardsFromHell/DllDocumentation/wiki/Conditions-List-Pt2-(spell-effects)
You can sometimes mix and match different effects to create new spells, and some things can be emulated with clever workarounds. But sometimes you won't find anything suitable, and workarounds can be be bug-prone or clunky.
It is fortunately possible to create completely new spell effects using Temple+'s Python Modifiers.
This is quite a bit more complex than normal ToEE scripting, but it's the only way you can have new AoE effects for example, or otherwise create spell effects that don't have 'baggage' from other spells.
Making Particle Systems
Tutorials for particle system making are available at the Co8:
http://www.co8.org/community/index.php?threads/particle-system-tutorial-2016-edition.11973/
http://www.co8.org/community/index.php?threads/particle-system-tutorial.7317/
There's also a particle system editor that Pugmeister made. It's a bit clunky and not quite full featured, but it has one huge advantage over the V2brute - you can see the result of modifications instantly.
Link: TemplePlusTools build 1186
To get it going you need to do the following:
- Use the non-co8 GoG DLL. I think patch2 version should work too but I'm not 100% sure.
You can also use the Co8 dll but it will break the character model in the viewer.
- Extract the files from TemplePlusTools to your ToEE folder
- Copy the files from the Temple+ installation folder to your ToEE folder
e.g. copy the contents of C:\Users\<YOUR USERNAME>\AppData\Local\TemplePlus\app-1.0.21 to your ToEE folder
- Open the particleeditor.exe file, and click Set Data Path.
Choose the location with the toee folder with the GoG DLL.
- Open File → select a partsys.tab file
- After making edits to existing systems, you can copy them to clipboard and paste them into partsys.tab in a text editor
- Nag Pugmeister for more features
Item Spells & Crafting
To define a scroll, wand or potion bearing the new spell, you need to add an entry to protos.tab. It's recommended to use the Co8 World Builder tool.
Take a look at a similar item and make a duplicate. You then change the relevant properties (click Cnfg and select Potion/Scroll to filter it down to relevant fields).
In particular, you need to change the content of the first Spell field.
The format is as shown above:
Code:
'<SPELL NAME>' class_X <SPELL LEVEL>
Where
<SPELL NAME> is the spell name. It needs a matching entry in in rules\spell_enums.mes (in the 5000 range).
<SPELL LEVEL> is the spell level. The caster level is automatically set by the game to be spell level * 2 - 1
class_<X> is the class enum - currently it only supports the vanilla classes.
Publishing Your Files
So you've got your new spell in place, probably by editing the files from the Co8 folder. How do you ensure they don't clash with other people's contributions?
With Temple+, you can now create "extender files" for several things, including partsys.tab files, spell.mes and snd_spells.mes.
Packing files to .DAT
You can pack files to .dat files. See this for more information:
https://github.com/GrognardsFromHell/TemplePlus/wiki/Modding#files
Other Relevant links
http://www.co8.org/community/index.php?threads/learning-how-to-get-a-new-spell-in-game.7294/
Last edited: