弧光法術

作者 alexguldemond·版本 v1.0.1·更新於 2020-05-20

一個允許咒語追蹤拋物線拱中敵人的模組。 還允許其他咒語施放軌跡,例如圍繞施法者旋轉。

截圖 共 1 張

模組介紹 作者原文

一個允許咒語追蹤拋物線拱中敵人的模組。 還允許其他咒語施放軌跡,例如圍繞施法者旋轉。

3465/5000這個mod使彈丸類型的咒語能夠在各種非線性路徑中移動。當前,支持三種不同的路徑。第一個是圍繞腳輪的向外螺旋形軌跡。第二個是繞圈旋轉時向前移動的路徑。第三個是拋物線弧,它從施法者處開始向目標移動。這些和香草鑄造之間的切換通過可通過MCM分配的熱鍵進行管理。

電弧軌跡是該模塊的主要目標。如果您曾經玩過《質量效應2和3》,請考慮一下。在開發過程中,其他兩個是簡單的概念證明,我決定離開,以防人們發現它們很有趣。

怎麼運行的:

在飛弧模式下施放法術時,MOD首先選擇最接近您瞄準目標的敵對目標。如果此目標足夠接近,並且瞄準位置與目標之間的角度足夠小,則在腳輪和目標之間會插入二次弧。然後,彈丸沿着該軌跡行進,直到與某物碰撞爲止。這意味着在以電弧模式投射時仍然很可能會錯過,因爲彈丸瞄準的是目標所在的位置,而不是目標所在的位置。我這樣做是爲了使這個mod能夠做到,使瞄準弧線需要一些練習,而不僅僅是在施放咒語時自動命中。目前,此模組僅適用於玩家,其他所有演員仍會正常施放咒語。

兼容性:

這個Mod應該與一切兼容。它通過覆蓋MissileProjectiles上的GetLinearVelocity方法來工作,因此執行此操作的任何其他操作顯然都是不兼容的。但是,我不知道有什麼其他方法可以覆蓋此方法,因此其他所有方法都應該兼容。

這樣添加中游安全嗎?

據我所知,是的。

這樣消除中游安全嗎?

嗯,沒有什麼比大多數mod更好的了。 MCM和切換鍵的腳本非常簡潔,使用腳本刪除任何內容始終會帶來風險。如果您不喜歡它,只需使用切換開關將其更改回普通模式,然後將熱鍵分配給您從未使用過的功能。

這是我有史以來的第一個mod,所以任何反饋將不勝感激。我也樂於接受關於其他軌跡的任何要求。

弧光背後的數學:

令向量v爲代表您瞄準目標的向量。

設p0爲玩家的位置。

令P爲細胞中所有敵對行動者的位置集合。

令d(p)= min || x-p || ^ 2,其中x位於v生成的仿射子空間上,即從目標到目標的距離。 (此優化問題在p0,v和p方面有明確的解決方案)

令p1 = argmin {d(p):p在P中}。

令v2 = p1-p2。

如果|| v2 ||足夠小,並且v.v1 /(|| v || * || v1 ||)足夠大(即它們之間的角度足夠小),然後繼續前進,否則讓彈丸沿着香草軌跡行進。

Graham-Schmidt處理步驟:

令q1 = v

令q2 = v1-(v1.q1 / q1.q1)* q1

令e1 = q1 / / || q1 ||

令e2 = q2 / || q2 ||

插值步驟(具有差分的牛頓插值):

令f0 = 0

令f1 = 0

令f00 = sqrt(1-(v.v1 /(|| v || * || v1 ||))^ 2)/v.v1/(|| v || * || v1 ||)

令f01 =(f1- f0)/ || v2 ||

令f001 =(f01-f00)/ || v2 ||

令x(t)= f0 + f00(x-0)+ f001(x-0)^ 2

設p(t)= p0 + t * e1 + x(t)* e2

那麼p(t)是軌跡——————————————————————————————————————————————————————————————

This mod enables projectile-type spells to move in various non-linear paths. Currently, there are three different paths supported. The first is an outward spiraling trajectory centered around the caster. The second is a path that moves forward while spinning in circles. The third is a parabolic arc starting at the caster and moving towards a target. Toggling between these and vanilla casting is managed via hotkeys which can be assigned via the MCM.

The arcing trajectory is the primary goal of this mod. If you've ever played Mass Effect 2 & 3, think something like that. During development, the other two were simple proofs of concept that I decided to leave in in case people found them fun to play with.

How it works:

When casting a spell in arcing mode, the mod first chooses the hostile target that is closest to where you are aiming. If this target is sufficiently close, and the angle between where you are aiming and the target is sufficiently small, a quadratic arc is interpolated between the caster and the target. The projectile then travels along this trajectory until it collides with something. This means that it is still very possible to miss when casting in arcing mode, as the projectile aims for where the target was, not where it is going to be. I did it this way so that this mod would make it so that aiming the arc would take some practice and not just automatically hit whenever a spell is cast. Currently, this mod only works for the player, all other actors still cast spells normally.

Compatibility:

This mod should be compatible with everything. It works by overwriting the GetLinearVelocity method on MissileProjectiles, so anything else that does this will obviously be incompatible. However, I am not aware of anything else that overwrites this method, so everything else should be compatible.

Is this safe to add midgame?

As far as I can tell, yes.

Is this safe to remove midgame?

Eh, no more so than most mods. There is a very light script for the MCM and the toggle keys, and removing anything with scripts always comes with risks. If you don't like it, just use the toggles to change it back to vanilla mode, then assign the hotkeys to something you never use.

This is my first ever mod, so any feedback would be most appreciated. I am also open to any requests on other trajectories.

Math behind arcing:

Let the vector v be the vector that represents where you are aiming.

Let p0 be the player's position.

Let P be the set of positions of all hostile actors in the cell.

Let d(p) = min ||x - p||^2 …

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 這類遊戲沒有通用的模組管理器:有的模組直接替換遊戲檔案、有的放進遊戲專屬的 Mods 資料夾、有的要先裝遊戲對應的社群載入器或工具,以包內說明為準。
  3. 嚴格按說明放置檔案;標註「前置依賴」的模組需要把依賴一併裝好。
  4. 啟動遊戲確認載入成功;部分遊戲需要在設定或模組選單裡手動啟用。

不同遊戲、不同模組的安裝位置差異很大,包內說明是最可靠的依據。

檔案與校驗

檔案名稱
弧光法术
檔案大小
230.6 KiB