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 … 11 12 13 14 15 … 18 Next »
[Help] Include/Requiring
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
[Help] Include/Requiring
27-08-2015, 03:05 PM,
#1
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
[Help] Include/Requiring
Hello!

I am currently working on a project which needs to have multiple files included. But there i have a problem. In my main file i am requiering two files which both include a folder. But it doesnt work. The strange is if i include just one script it works.

Here are the important parts of the scripts:

The main file code for the screen which doesnt work:

--@name StarOS
--@author SuperPlayer
--@require lib/staros/StarOSLib_Main.txt
--@requirecl lib/gui/GUILib_Main.txt
--@updater STEAM_0:0:74694146
--@shared

The main file codes for the screen which does work:

--@name StarOS
--@author SuperPlayer
--@require lib/staros/StarOSLib_Main.txt
--@updater STEAM_0:0:74694146
--@shared

AND

--@name StarOS
--@author SuperPlayer
--@requirecl lib/gui/GUILib_Main.txt
--@updater STEAM_0:0:74694146
--@shared
This is the file GUILib_Main:

--@name GUILib_Main
--@author SuperPlayer
--@updater STEAM_0:0:74694146
--@includedir lib/gui/modules

GUI = { }

function GUI.Load()
printConsole("GUI Lib is loading...")
require("lib/gui/modules/GUILib_Frame.txt")
printConsole("GUI Lib is loading...Frame")
require("lib/gui/modules/GUILib_Buttons.txt")
printConsole("GUI Lib is loading...Buttons")
require("lib/gui/modules/GUILib_Draw.txt")
printConsole("GUI Lib is loading...Draw")
end
timer.create("Load",1,1,GUI.Load)

This is the file StarOSLib_Main.txt:


--@name StarOSLib_Main
--@author SuperPlayer
--@includedir lib/staros/modules/client
--@includedir lib/staros/modules/server
--@updater STEAM_0:0:74694146

StarOS = { }

function StarOS.Boot()
StarOS.BootStatus = "Initializing..."
requireAll()
StarOS.FilesLoaded = true
end


As i said each of these files alone work but together i get the error:

sv: SF:lib/gui/modules/GUILib_Draw.txt:4: attempt to index global 'GUI' (a nil value)

In the given line is just:
GUI.Buttons = { }

I really hope someone can tell me what i am doing wrong.

SuperPlayer
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
[Help] Include/Requiring - by SuperPlayer - 27-08-2015, 03:05 PM
RE: [Help] Include/Requiring - by rouing - 27-08-2015, 04:37 PM
RE: [Help] Include/Requiring - by SuperPlayer - 27-08-2015, 04:51 PM
RE: [Help] Include/Requiring - by Person8880 - 27-08-2015, 05:56 PM
RE: [Help] Include/Requiring - by SuperPlayer - 27-08-2015, 05:59 PM
RE: [Help] Include/Requiring - by Person8880 - 27-08-2015, 06:09 PM
RE: [Help] Include/Requiring - by SuperPlayer - 28-08-2015, 12:52 PM
RE: [Help] Include/Requiring - by Person8880 - 28-08-2015, 06:32 PM
RE: [Help] Include/Requiring - by SuperPlayer - 28-08-2015, 06:47 PM
RE: [Help] Include/Requiring - by Person8880 - 28-08-2015, 06:52 PM
RE: [Help] Include/Requiring - by SuperPlayer - 22-09-2015, 09:43 PM
RE: [Help] Include/Requiring - by TheOneAndOnlyTee - 22-09-2015, 11:46 PM
RE: [Help] Include/Requiring - by SuperPlayer - 22-09-2015, 11:57 PM
RE: [Help] Include/Requiring - by TheOneAndOnlyTee - 23-09-2015, 12:15 AM
RE: [Help] Include/Requiring - by Person8880 - 23-09-2015, 05:38 PM
RE: [Help] Include/Requiring - by Destiny's Player - 23-09-2015, 05:57 PM
RE: [Help] Include/Requiring - by Person8880 - 23-09-2015, 06:11 PM

  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.