TTL has a limited range. For objects beyond the range of TTL, use a flash auto range, where the light to the flash sensor controls the flash duration (3 ranges for the AF400T, 2 ranges for the AF280T). For even more distance, use the flash in Manual mode where you'll have to calculate the correct aperture.
For TTL, see the camera manual (TTL Auto Flash Operation). With a TTL auto flash for the camera (e.g., Pentax AF280T or AF400T), you set the ISO on the flash and when the flash is charged, the camera automatically goes to the 1/60 synchronization shutter speed. The only variable is then lens aperture and you can manually select this, based on the distance range on the flash, when the camera is set to Aperture Priority AE or Manual mode. Or, the camera will automatically select the aperture based on the camera ISO setting if you set the lens to A and the camera is in Aperture, Shutter, or Program AE mode.
You can also do TTL outdoor fill flash - set the flash to TTL and the film ISO; set the camera to the film ISO and shutter speed to 1/60; do not use the lens on A. With the flash off, meter the shadows and set the aperture for the correct exposure. Then turn on the flash and change the flash ISO setting by -1, -1.33, or -1.67 stops, depending on how much or little fill flash you want to fill shadows. For example, with 100 speed film, change the flash ISO to 200, 250, or 320 depending on how much fill flash you want (200 provides more fill, 250 and 320 less). Using 400 ISO film, you can only get -1 stop (flash ISO set to 800).