[Trigger] Make floating text only visible to players within range

Status
Not open for further replies.
Could someone please help me with how to make floating text visible to players only if their units have sight of it? I'm a GUI user but I'll work with custom scripts if that's the solution. Thanks in advance

ok depend that unit and permanent text or no.

with unit group, pick all unit in x range around ur specific unit

if it is just a time floating text then something like this


  • Set p = (Position of (*your special unit*))
  • Unit Group - Pick every unit in (Units within 600.00 of p matching (Visible[(Player number of (Matching player))] Equal to False)) and do (Actions)
    • Loop - Actions
      • Set Visible[(Player number of (Picked player))] = True
      • Set unit = (Picked unit)
      • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_unit) then
      • -------- here create the float text --------
      • Custom script: endif
  • Custom script: call RemoveLocation(udg_p)
if permanent then something like this

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • Floating Text - Destroy FText[(Integer A)]
  • Set p = (Position of (Triggering unit))
  • Unit Group - Pick every unit in (Units within 600.00 of p matching (Visible[(Player number of (Matching player))] Equal to False)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Visible[(Player number of (Owner of (Picked unit)))] Equal to False
        • Then - Actions
          • Set Visible[(Player number of (Picked player))] = True
          • Set unit = (Picked unit)
          • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_unit) then
          • -------- here create the float text --------
          • Set FText[(Player number of (Owner of (Picked unit)))] = (Last created floating text)
          • Custom script: endif
        • Else - Actions
  • Custom script: call RemoveLocation(udg_p)
 
Status
Not open for further replies.
Back
Top