Skip to content

Allow Laser drawing position update#2218

Open
DeathFishAtEase wants to merge 5 commits into
Phobos-developers:developfrom
DeathFishAtEase:LaserPositionUpdate
Open

Allow Laser drawing position update#2218
DeathFishAtEase wants to merge 5 commits into
Phobos-developers:developfrom
DeathFishAtEase:LaserPositionUpdate

Conversation

@DeathFishAtEase
Copy link
Copy Markdown
Collaborator

@DeathFishAtEase DeathFishAtEase commented May 18, 2026

  • Now you can define whether the endpoints of a laser drawing are updated during its duration.
    • None: No update.
    • Firer: The start point follows the firer's FLH; if the firer dies, the update stops.
      • Since DiskLaser's FLH actually determines the center of the ring, this would cause the beam's start point after charging to become the FLH, so this scenario may not be suitable for using Firer.
    • Target: The end point follows the target; if the target object dies, the update stops.
    • All: Equivalent to specifying both Firer and Target.
move.mp4

Used together with Projectile interception logic

Note

For a sub-weapon created by ShrapnelWeapon, its start point is the position where the parent weapon detonates, not the firer's FLH.

  • If Firer is set, it will be treated as None.
  • If All is set, it will be treated as Target.

In rulesmd.ini:

[SOMEWEAPON]             ; WeaponType with IsLaser=yes or DiskLaser=yes
LaserPositionUpdate=none ; Position Follow Enumeration (none|firer|target|all)

Warning

If the weapon sets this logic to a non-None value while also using other logics that change the drawing position, such as FlakScatter, then after initially drawing the laser according to those other logics, the drawing position will be forced to change due to the update rules.

@DeathFishAtEase DeathFishAtEase self-assigned this May 18, 2026
@DeathFishAtEase DeathFishAtEase added ❓New feature Needs testing ⚙️T1 T1 maintainer review is sufficient No Documentation Needed No documentation needed whatsoever labels May 18, 2026
@phoboscn-bot
Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/478/1

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

Comment thread src/Misc/Hooks.LaserDraw.cpp Outdated
if (ObjectClass::Array.FindItemIndex(info.Shooter) != -1 && !info.Shooter->IsDead())
{
CoordStruct flh;
info.Shooter->GetFLH(&flh, info.WeaponIndex, CoordStruct { 0, 0, 0 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should consider Burst

Comment thread src/Misc/Hooks.LaserDraw.cpp Outdated
}

// Per‑frame coordinate update
DEFINE_HOOK(0x550173, LaserDrawClass_UpdateCoords_Update, 6)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LaserDrawClass_Update_UpdateCoords

Comment thread src/Misc/Hooks.LaserDraw.cpp
In `rulesmd.ini`:
```ini
[SOMEWEAPON] ; WeaponType with IsLaser=yes or DiskLaser=yes
LaserPositionUpdate=none ; Position Follow Enumeration (none|firer|target|all)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a global value would be useful?

Copy link
Copy Markdown
Collaborator Author

@DeathFishAtEase DeathFishAtEase May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I've gone to the corresponding topic on Forum and started a poll to see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs testing ❓New feature No Documentation Needed No documentation needed whatsoever ⚙️T1 T1 maintainer review is sufficient

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants