Console output too long? Solution?

I’m trying to print a Vehicle Table out but the output is way too long. There is a simple fix for this I am sure but I am just now learning to use tables and have a very basic knowledge level at that.

(Trying to make a derma button spawn a TGM/ photon car but I need to know what paths to use)

Save whatever you need to a .txt file.

how? I know there’s file.Write but how do I get the entire console output there?

That’s not what I meant. Just convert the table to a readable string (like JSON, for example), write it to the file, and then search for whatever you need when you open the text file.


local carInfo = list.Get("Vehicles")

local carInfoAppend = table.ToString(carInfo, "Vehicle Table",true)

file.Write("MyVehicletables.txt", carInfoAppend)


I keep getting console error : [ERROR] expected near ‘Vehicles’ is the syntax wrong?

local carInfo = list.Get("Vehicles")

file.Write('vehiclelist.txt', table.ToString(list.Get('Vehicles'), 'Vehicle List', true))

Works fine for me.

Got the list…now I just need to figure out how to put in to spawn correctly…

local ent = ents.Create ("prop_vehicle_jeep")
	ent:SetModel ("models/sentry/caison_fire.mdl")
	if "Caison Fire Truck" then
		ent.VehicleTable = list.Get("Vehicles")["Emergency Vehicles"]  //have to pull up the correct vehicle for the photon script to work

There is a photon script that goes with that I’m not sure how to access it’s table though

EDIT: Right now I just get an empty model (It’s not even a vehicle, I can run through it)