Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 13 14 15 16 17 18 Next »
reading and writing to a file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
reading and writing to a file
27-06-2015, 01:12 AM, (This post was last modified: 27-06-2015, 01:17 AM by shinji144.)
#1
shinji144 Offline
TSCM Member
***
Posts: 5
Threads: 2
Joined: Jun 2015
Question  reading and writing to a file
I'm trying to save my ship's 'crew' to a text file, but what I'm doing doesn't seem to be making the text file and writing to it (or I just can't find it..). Ideally I'll be serializing my 'crew-members' table using vON, and then writing the resulting string into the text file. The crew file will be loaded every time my ship gets spawned.

For now, here is my test code that I've been trying to run:
Code:
local _savedCrewPath = "ShipCrewFile.txt" local _savedCrewFile = nil _savedCrewFile = io.open(_savedCrewPath, "w") _savedCrewFile:write("asdf123") _savedCrewFile:close() _savedCrewFile = io.open(_savedCrewPath, "r") io.input(_savedCrewFile) print(io.read())

Once I get this figured out I'll be happy to make a tutorial on this topic.
Website Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
reading and writing to a file - by shinji144 - 27-06-2015, 01:12 AM
RE: reading and writing to a file - by LocInt - 27-06-2015, 10:10 AM
RE: reading and writing to a file - by Red The Blue Color - 28-06-2015, 07:03 AM
RE: reading and writing to a file - by Person8880 - 27-06-2015, 11:31 AM
RE: reading and writing to a file - by LocInt - 27-06-2015, 11:32 AM
RE: reading and writing to a file - by Person8880 - 27-06-2015, 11:38 AM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.