Page 1 of 1

SetUnitLosState()

Posted: 18 May 2008, 04:21
by trepan
fwiw ...

Code: Select all

r5907 | trepan | 2008-05-17 23:13:53 -0300 (Sat, 17 May 2008) | 24 lines
* Added the following LuaSyncedCtrl call-outs:
    - SetUnitLosMask(unitID, allyTeamID, number | table) -> nil
    - SetUnitLosState(unitID, allyTeamID, number | table) -> nil
  - If a mask bit is enabled, than the engine will not update
    the corresponding state bit (think of them as 'lock' bits)
  - If a table is used, entries should be of the form:
    { string = boolean } -- 'false' to clear, 'true' to set
    ex:  SetUnitLosState(3, 2, { los = true, radar = false })
  - The valid strings are 'los', 'radar', 'prevLos', and 'contRadar'
      prevLos:    previous LOS
      contRadar:  continuous radar  (since prevLos contact)
      *** These 2 dictate whether or not a unit type is known

Re: SetUnitLosState()

Posted: 18 May 2008, 05:15
by Argh
Thanks for adding that.

Is there any difference between setting Spring.SetUnitAlwaysVisible to true, and the following, in the case of AllyTeamID 1?

Code: Select all

SetUnitLosMask(1, 1 {los = true})
SetUnitLosState(1, 1, {los = true})
IOW, would setting that mask state to true for AlwaysVisible Units have any impact at all on LOS performance with large numbers of Units, or is it already set to true in that case?

Re: SetUnitLosState()

Posted: 18 May 2008, 12:39
by Tobi
It wouldn't have any impact at all.

EDIT: however, using your los=true solution INSTEAD of alwaysVisible=true will have a minor performance decrease.

Re: SetUnitLosState()

Posted: 18 May 2008, 16:58
by Argh
Okie doke. I figured it wouldn't improve things much either way.