As promised (although a little overdue) here's my usage of the Global Type pointer.
What I needed was the variable 'TargetEntity' to equal the instance of the RadarTargets Type when that instance was currently 'selected' as the target in-game. However, many other routines needed to check RadarTargets (for placing them all on my 3D radar, labelling them etc.) Also TargetEntity is used a lot because a special crosshair may be pinned to it, and an alternative radar camera was used to display it elsewhere on-screen.
What I needed was the variable 'TargetEntity' to equal the instance of the RadarTargets Type when that instance was currently 'selected' as the target in-game. However, many other routines needed to check RadarTargets (for placing them all on my 3D radar, labelling them etc.) Also TargetEntity is used a lot because a special crosshair may be pinned to it, and an alternative radar camera was used to display it elsewhere on-screen.
Global CurrentTarget.RadarTargets .............. RadarSorter.RadarTargets=First RadarTargets TargetEntity=RadarSorter\TargetEntityHandle ...... ;CHANGING RADAR PlaySound radar_blip Target_Sorter_First.RadarTargets=First radartargets Target_Sorter_Last.RadarTargets=Last radartargets If targetentity=0 targetentity=Target_sorter_First\TargetEntityhandle CurrentTarget=First RadarTargets EndIf For CountTargets.RadarTargets = Each RadarTargets If targetentity=CountTargets\TargetEntityHandle Then CurrentTarget=CountTargets Next If changetarget$="Forward" If Null <> After CurrentTarget CurrentTarget = After CurrentTarget Else CurrentTarget = First RadarTargets EndIf EndIf If changetarget$="Back" If Null <> Before CurrentTarget CurrentTarget = Before CurrentTarget Else CurrentTarget = Last RadarTargets EndIf EndIf targetentity=CurrentTarget\TargetEntityHandle .................................. For SelectTarget.RadarTargets=Each Radartargets If targetEntity=SelectTarget\TargetEntityHandle skip=0 EntityColor radar_pointer,SelectTarget\TargetColourRED,SelectTarget\TargetColourGREEN,SelectTarget\TargetColourBLUE Color SelectTarget\TargetColourRED,SelectTarget\TargetColourGREEN,SelectTarget\TargetColourBLUE Text radarX+(Radarlength/2),RadarY-(small_text_size*2.5),SelectTarget\TargetType$,1,0 Text radarX+(Radarlength/2),RadarY-(small_text_size),SelectTarget\Name$,1,0 If EntityDistance (targetentity,ship)>radar_range# Or targetentity=sunsprite Or targetentity=sunsphere Text radarX+(Radarlength/2),RadarY-(small_text_size*5),"OUT OF RANGE",1,0 skip=1 EndIf If EntityDistance (targetentity,ship)<=radar_range# And skip=0 Text radarX+(Radarlength/2),RadarY-(small_text_size*5),Int(EntityDistance(Ship,Targetentity)),1,0 EndIf EndIf Next