Enhanced Magic

Discuss modding questions and implementation details.
Post Reply
dit
Posts: 1
Joined: Sun Jan 17, 2021 7:22 pm

Enhanced Magic

Post by dit »

I'm starting on a new mod that will hopefully improve current magic effects. It will include 3D animations with environment awareness and light support. As I'm not skilled in Unity 3D animations, they will be done mostly through scripts.

For a start I have found these tutorials:
https://www.dfworkshop.net/projects/dag ... y/modding/
https://www.dfworkshop.net/projects/dag ... /features/

I have created an initial set up and started looking through Daggerfall Unity code. In Game/Scripts folder I have found DaggerfallMissile.DoAreaOfEffect() which allowed me to start creating the most simple effects. As this immediately gave me the ability to do something I felt like I was changing the engine core functionality and that instead I should do this in my custom scripts inside Game/Mods folder.

This is where I would need your help. I will appreciate if you could tell me please how magic is cast, how the system works and what classes I could use?
Are there any interfaces/classes that I could inherit as I assume that it would not be a really good idea to overwrite the original code.

l3lessed
Posts: 1409
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Enhanced Magic

Post by l3lessed »

Well, it is kind of complicated.

The hand animations themselves are rendered through a fps script that pulls the proper atlas for the spell. Can't remember the exact script name.

The spell effects themselves are managed by the spell management script system.

For 3d animations, you would need to first rewrite and override the current 2d animation script file. This would have to run the 3d animations for the hands.

The spell effects themselves would need to be redone. The easiest way, off the top of my head, would be to use the unity particle system, create the effects in it, and then export them as prefabs. Have the prefabs load for each spell, in place of the classic 2d sprites. I had already thought about this, when I got the particle system working on my combat mod.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

KipHead
Posts: 1
Joined: Thu Jan 28, 2021 6:23 am

Re: Enhanced Magic

Post by KipHead »

This is what I found for you as an example:
Scriptname castSpell extends activemagiceffect
Spell Property WarpJump Auto
Spell Property SlowTime Auto
Event OnSpellCast(Form akSpell)
Spell spellCast = akSpell as Spell
if spellCast == WarpJump
SlowTime.Cast(GetTargetActor())
Debug.Trace("Slow Time successful!")
endif
EndEvent

Hope this helps

Post Reply