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 the FLH of DiskLaser actually determines the center of the ring, in this scenario, during the update process, the direction of the line connecting the beam's starting point to the center is fixed relative to the ground and the distance is constant - that is, the starting point will still remain on the ring.
    • 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

In vanilla, an occupied building uses the weapons of its occupants in turn. Thus, if an infantry's occupy weapon uses Firer , the laser's starting point will update to the position specified by the most recently used MuzzleFlashX after each shot.

Note

For a sub-weapon created by ShrapnelWeapon or AirburstWeapon, 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
Comment thread src/Misc/Hooks.LaserDraw.cpp Outdated
Comment thread src/Misc/Hooks.LaserDraw.cpp Outdated
Comment thread docs/New-or-Enhanced-Logics.md
@DeathFishAtEase DeathFishAtEase marked this pull request as draft May 18, 2026 14:45
@DeathFishAtEase
Copy link
Copy Markdown
Collaborator Author

DeathFishAtEase commented May 18, 2026

Since a certain error introduced during local testing of Phobos Build#46 - Phobos DevBuild#47 may cause TargetCoordOffset of BuildingType to be not respected, and the functionality of this PR may mask that error, I will first focus on investigating that existing error and optimizing this PR, rather than immediately completing and merging it.

Z%Q7X1P ITXH~IKWE{RXP51

96c6550

VZ6@DKS8 9KZ1NIF9(FY(YC

838c2e7 (#1553)

Resolved in #2222.

@TaranDahl
Copy link
Copy Markdown
Contributor

I thought those were supposed to be several GIFs

@DeathFishAtEase
Copy link
Copy Markdown
Collaborator Author

DeathFishAtEase commented May 18, 2026

I think it's that after further refining the scope, I forgot to remove the image of Ares 3.0p1 without Phobos, so perhaps the three images arranged together earlier looked a bit confusing. :P
However, I have located it!

@DeathFishAtEase DeathFishAtEase marked this pull request as ready for review May 24, 2026 03:35
@DeathFishAtEase DeathFishAtEase requested a review from TaranDahl May 24, 2026 03:35
Co-authored-by: Netsu_Negi <71598172+NetsuNegi@users.noreply.github.com>
@DeathFishAtEase DeathFishAtEase marked this pull request as draft May 25, 2026 13:43
@DeathFishAtEase DeathFishAtEase marked this pull request as ready for review May 27, 2026 07:34
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