Service engine soon light!

I have a 1994 Ford F 150 truck XLT Super cab, Flare side with dual gas tanks, its a V8, 5.0 engine. My probelm is, when I am driving the truck and this just started happening. While driving Ithe truck felt as if it lose compression and started to slow down, the service engine light came on and so did the battery indicator, I could feel it losing spped so I pulled off the road and the truck just died. I was not able to restart it for about 10 minutes or so and when I did all seemed normal. I drove it to Autozone and had the battery checked and my new alternator and both came back with flying colors all working normally. However I did notice when I was trying to start it back up and how it would make that quick litttle noise from the engine to the gas as it feeds through just before the vehicle starts well this time it did not do that. I went to the back of the truck and removed both gas caps and replaced them and then went to restart the truck and it worked, thought that was off the wall. I cannot figure this out. It has a new alternator, the battery is good, I did a regual maintance chenged out the plugs and put in platinum 2 autolites, changed the oil, changed the fuel filter, air filter, greased it all up. Can someone have any idea before I decided to shoot the darn thing and yes it is paid for LOL. Thanks for listening.

You could take wild guesses or you could have the codes read and probably narrow down the problem quite a bit. The second choice makes more sense to me.

I think you may need a fuel pump.

Your engine quit running, thats why all those dash lights came on. When you have the key on and the engine isn’t running, the qarning lights come on to show you that the bulbs are working.
This isn’t necessarly going to set any trouble codes.
Did you hear a hissing sound when you opened the gas cap? If tou did it means a plugged fuel system vent or evaporitave system.

You need ti find out if it is lack of fuel or spark. If you don’t know how to tell which, let your mechanic drive it for a few dats, he should be able to tell.

Your truck should be in the last ones made using the TFI ignition module. These modules are prone to heat related failure anyway and with warm weather coming on the heat factor just gets worse.
Symptoms vary but one failure is loss of the ignition pulse to the ECM and which is required to keep the fuel pump relay and pump in operation.