Repository navigation
[Lib] ArtilleryArc
A library for custom artillery arc heights on weapons - in tip images and on the board when aiming or firing. Originally by Lemonymous and enhanced here for two-click weapons and multishot effects (hooks onFinalEffectStart / onFinalEffectEnd as well as skill start/end).
This is mostly handled under the hood. Once loaded, it reads specific fields on skills and adjusts Values.y_velocity accordingly.
Requires modApiExt and weaponArmed.
Any issues or concerns? Join the Redacted Rice Discord and @Das Keifer
A library adding the functionality to set custom artillery arc heights for weapons; in the tip image and on the board, when aiming the weapon and when using it.
It is mostly automatic. Once the library has executed, it will look for some specific fields in all weapons, which if set, will change the world constants accordingly.
Default height is 18 (Values.y_velocity).
| Field | Type | Description |
|---|---|---|
ArtilleryHeight |
number | Height to apply whenever the weapon is armed or displayed in a tip image |
Setting this field of any skill to a number value will change the world constant height to this value whenever the weapon is armed or displayed in a tip image.
Example:
MyArtilleryWeapon = Skill:new{
ArtilleryHeight = 12,
}
| Field | Type | Description |
|---|---|---|
GetArtilleryHeight |
function | Function variant of ArtilleryHeight. Returns a number height |
If set, it will be called on state changes like armed -> unarmed, tipimage -> armed, etc. Since it does not update every frame, it cannot be used to dynamically change the height as freely as UpdateArtilleryHeight.
If both GetArtilleryHeight and ArtilleryHeight are present, the function result is preferred when it returns a number. Otherwise ArtilleryHeight is used.
Example:
function MyArtilleryWeapon:GetArtilleryHeight()
return self.DynamicHeight or 18
end
| Field | Type | Description |
|---|---|---|
UpdateArtilleryHeight |
function | Called each update frame while the skill is armed or viewed in a tip image |
If set, this function will be called every update frame when this weapon is armed or displayed in a tip image. This can be useful if the artillery height should change dynamically based on some other state than armed/tipimage.
The library handles resetting the value automatically when appropriate (unarm, tip hidden, skill end) unless ArtilleryHeightLock is set.
Example:
function MyArtilleryWeapon.UpdateArtilleryHeight()
Values.y_velocity = someLiveValue
end
| Field | Type | Description |
|---|---|---|
ArtilleryHeightLock |
boolean | (optional) If true, lock height for the duration of the skill/final effect |
If true on the skill, height is locked while that skill/final effect runs (ArtilleryArc.activeWeapon holds the weapon id until skill/final end). Prevents mid attack resets from other armed/hover state changes - useful for multishot / two click sequences.
Example:
MyArtilleryWeapon = Skill:new{
ArtilleryHeight = 10,
ArtilleryHeightLock = true,
}