2019-08-24 11:23 CEST

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0005056Spring engineLuapublic2017-05-09 16:29
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynoneSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version100.0+git 
Target VersionFixed in Version103.0 +git 
Summary0005056: Feature: Get weapon blocked state.
DescriptionThe debug collision volume view places little red or yellow spheres on the pieces returned by script.QueryWeapon. If the unit has an attack command then colour of these spheres seems to indicate whether the weapon is able to fire. Whether it is able to fire depends partially on whether something that it avoids is in the way (eg. avoid Friendly).

I would like lua to be able to know whether a weapon is blocked from firing because of the presence of something it avoids. A more powerful feature would be to be able to check whether an arbitrary projectile, emit position, target position and unitID would be blocked by something the weapon avoids. The unitID argument is required for allyTeamID and because units do not consider their own collision volume when firing.
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files

-Relationships
+Relationships

-Notes

~0015627

Kloot (developer)

"I would like lua to be able to know whether a weapon is blocked from firing because of the presence of something it avoids"

Spring.GetUnitWeaponHaveFreeLineOfFire

~0015629

Google_Frog (reporter)

Nice, I had thought it would be part of the GetUnitWeaponState return table.

It looks like all that is left to this request is a version of Spring.GetUnitWeaponHaveFreeLineOfFire which takes firing location as an argument. This would be useful for detecting when a burst weapon will hit a friendly when the emit piece changes during the burst. I would detect these cases and change the barrels which are used for the burst.

If causing new line of fire checks is too expensive or messy I can probably find another workaround.

~0015630

Kloot (developer)

Last edited: 2016-02-05 16:38

View 2 revisions

"a version of Spring.GetUnitWeaponHaveFreeLineOfFire which takes firing location as an argument"

That would be easy, but won't be in 101.

~0017578

Anonymous (viewer)

Fix 7ab766502390c115037695a5142c67f8daf57a63 committed to develop branch: fix 0005056 (extend Spring.GetUnitWeaponHaveFreeLineOfFire to take aiming-from coors)

old API: Spring.GetUnitWeaponHaveFreeLineOfFire(unitID, weaponNum, targetID | [ tgtPosX [, tgtPosY [, tgtPosZ ]]]])
new API: Spring.GetUnitWeaponHaveFreeLineOfFire(unitID, weaponNum, targetID | [srcPosX [, srcPosY [, srcPosZ [, tgtPosX [, tgtPosY [, tgtPosZ]]]]]])

if the srcPos* arguments are all nil, the default aiming location is used as before., repo: spring changeset id: 8177
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2016-02-05 15:30 Google_Frog New Issue
2016-02-05 15:45 Kloot Note Added: 0015627
2016-02-05 16:29 Google_Frog Note Added: 0015629
2016-02-05 16:33 Kloot Note Added: 0015630
2016-02-05 16:33 Kloot Status new => resolved
2016-02-05 16:33 Kloot Resolution open => no change required
2016-02-05 16:33 Kloot Assigned To => Kloot
2016-02-05 16:36 Kloot Assigned To Kloot =>
2016-02-05 16:36 Kloot Status resolved => feedback
2016-02-05 16:36 Kloot Resolution no change required => reopened
2016-02-05 16:38 Kloot Note Edited: 0015630 View Revisions
2016-02-05 16:42 Kloot Assigned To => Kloot
2016-02-05 16:42 Kloot Status feedback => assigned
2017-05-09 16:27 Changeset attached => spring develop 7ab76650
2017-05-09 16:27 Anonymous Note Added: 0017578
2017-05-09 16:29 Kloot Status assigned => resolved
2017-05-09 16:29 Kloot Resolution reopened => fixed
2017-05-09 16:29 Kloot Fixed in Version => 103.0 +git
+Issue History