View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006062 | Spring engine | Lua | public | 2018-11-04 12:58 | 2018-11-04 17:13 |
| Reporter | Floris | Assigned To | gajop | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 104.0 +git | ||||
| Summary | 0006062: IsUnitInView() and IsUnitVisible() return true for unsynced gadgets | ||||
| Description | The unit is invisible to me but these functions return true regardless | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | |||||
|
|
Unsynced gadgets have global LOS afaik: https://springrts.com/wiki/Lua:Environments |
|
|
they do, see also the discussion in #6011 |
|
|
6011 = Access Denied. |
|
|
[me] Spring.IsUnitVisible only returns whether a unit is potentially visible by the camera, and if called from a gadget (which has more access priviledges than a widget) it ignores LOS. [Doo] isn't that "Spring.IsUnitInView"? What are the differences? Is there a specfic call that returns true if a unit is curently being drawn, regardless of los? [me] Spring.IsUnitInView is a stripped-down version of Spring.IsUnitVisible (IsUnitVisible checks access rights of the Lua script calling it and takes some optional arguments, IsUnitInView does neither) "Is there a specfic call that returns true if a unit is curently being drawn, regardless of los?" no, that would not make sense because unit drawing is itself tied to LOS. [Doo] There are some cases though, aren't there? Using SetUnitAlwaysVisible, wouldn't that make a unit visible regardless of its LOS state? [me] "Using SetUnitAlwaysVisible, wouldn't that make a unit visible regardless of its LOS state?" An always-visible unit will still only be drawn if it is in view, so IsUnitInView will see it when the player does. |
|
|
okay... so no way to know if a unit is in user-los from a gadget. I've stripped the nanolaser gadget unsynced part and made it into a widget, it works |
|
|
Seems to me the issue is resolved then. |
|
|
fyi you should be able to just wrap IsUnitInLos in a CallAsTeam. |
|
|
Ah yes, see here: https://springrts.com/wiki/Lua_System |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2018-11-04 12:58 | Floris | New Issue | |
| 2018-11-04 13:51 | gajop | Note Added: 0019469 | |
| 2018-11-04 14:14 | Kloot | Note Added: 0019470 | |
| 2018-11-04 15:30 | Floris | Note Added: 0019472 | |
| 2018-11-04 15:52 | Kloot | Note Added: 0019473 | |
| 2018-11-04 16:42 | Floris | Note Added: 0019474 | |
| 2018-11-04 17:03 | gajop | Assigned To | => gajop |
| 2018-11-04 17:03 | gajop | Status | new => closed |
| 2018-11-04 17:03 | gajop | Resolution | open => no change required |
| 2018-11-04 17:03 | gajop | Note Added: 0019475 | |
| 2018-11-04 17:11 | Kloot | Note Added: 0019476 | |
| 2018-11-04 17:13 | gajop | Note Added: 0019477 |