Jump to content

Netherwulf

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Netherwulf

  1. 7 hours ago, Josh said:

    Your second code shows a "/" is inserted, and the first one does not.

    The path being in the proper format was the first thing I looked into when I started having trouble. That doesn't seem to be the issue. 

    Furthermore, I tried using the FileSystem:CreateFile() and FileSystem:OpenFile() commands that Marcousik suggested, but that doesn't work for me either. My local "stream" variable continues to return a nil value.  

  2. Greetings!

    I'm hitting a wall trying to create a game state file that can be opened and read back. Here is my code.
     

    filePath = FileSystem:GetAppDataPath() .. "gamestate.txt"
    
    
    function Script:UpdatePhysics()
    	
    	if window:KeyHit(Key.S) then
    		local stream = FileSystem:WriteFile(filePath) 
    		if (stream==nil) then Debug:Error("Failed to write file.") end
    
    		stream:WriteInt(GameData)
    		stream:Release()
    	end
    
    end

    When I run the program and press the key to create and save the file, the debug error is fired and the program ends. I can't tell if the problem lies in my code or somewhere else. 

  3. Hello, all.

    I'm new to coding in Leadwerks and I'm looking over some of the included scripts to get a feel for how they work. I can interpret most of it, but I keep coming across function calls like, "self:CallOutputs(string)" or "self.component:CallOutputs(string)" and I have no idea what the function does, nor can I find anything about it in the documentation. Could someone please explain to me what it does, or direct me to where it is discussed in the documentation?

    Thank you!

×
×
  • Create New...