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
Pages (2): « Previous 1 2
Threaded Mode
[Help] Include/Requiring
22-09-2015, 09:43 PM, (This post was last modified: 22-09-2015, 09:44 PM by SuperPlayer.)
#11
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: [Help] Include/Requiring
Well here I am again. The thing i do for requiring works. Atleast for me. The problem is no one else can see anything on my screen.
This is the code i am using for including requiring in my lib:

--@name StarOSLib_Main
--@author SuperPlayer
--@include lib/gui/GUILib_Main.txt
--@includedir lib/staros/modules/client
--@includedir lib/staros/modules/server
--@updater STEAM_0:0:74694146

StarOS = { }
StarOS.LoadedFiles = { }
StarOS.Started = false
StarOS.FilesLoaded = false
StarOS.ShowStartMenu = false
function StarOS.Boot()
StarOS.BootStatus = "Initializing..."

if CLIENT then
require("lib/gui/GUILib_Main.txt")
table.insert(StarOS.LoadedFiles,"lib/gui/GUILib_Main.txt")
ClientModules = getScripts()
for i = 1, #ClientModules do
table.insert(StarOS.LoadedFiles,ClientModules[i])
require(ClientModules[i])
end
end


if SERVER then
ServerModules = getScripts()
for i = 1, #ServerModules do
table.insert(StarOS.LoadedFiles,ServerModules[i])
require(ServerModules[i])
end
--StarOS.LoadSettings()
end
StarOS.FilesLoaded = true
StarOS.BootStatus = "Loading Settings..."
StarOS.LoadSettings()

end

StarOS.Boot()

And then this is what I am using in my screen:

--@require lib/staros/StarOSLib_Main.txt

Does anyone has an idea why just i can see stuff?
Thank you in advance!

[Image: banner_sgmgnlsa1.png]
Stargate Modding Group
Find
Reply
22-09-2015, 11:46 PM,
#12
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: [Help] Include/Requiring
Is it possible that --@includedir ...modules/client isn't working like --@requirecl ... , the client might not have the modules to draw with hence nothing drawing

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
22-09-2015, 11:57 PM,
#13
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: [Help] Include/Requiring
Hmm. Could work gonna try that out. Thank you.
But one problem: How do i requirecl a whole folder? Because i just can include one file with it if i am not mistaken?

[Image: banner_sgmgnlsa1.png]
Stargate Modding Group
Find
Reply
23-09-2015, 12:15 AM,
#14
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: [Help] Include/Requiring
No clue, if there's not many it shouldn't matter

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
23-09-2015, 05:38 PM,
#15
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: [Help] Include/Requiring
You're again mis-understanding how getScripts() works.

-- This snippet loads all script files.
local Scripts = getScripts()
for FilePath, CompiledScript in pairs( Scripts ) do
-- If you want to only load those from a certain folder, check FilePath starts with the folder path.
-- Calling the CompiledScript function loads the script file.
CompiledScript()
end

I'll add this example to the in-game documentation too.
Find
Reply
23-09-2015, 05:57 PM,
#16
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
RE: [Help] Include/Requiring
Also, is it just me being a ninny or there's a "--@shared" missing? Or is it not needed in this case?
Find
Reply
23-09-2015, 06:11 PM,
#17
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: [Help] Include/Requiring
(23-09-2015, 05:57 PM)Destinys Player Wrote: Also, is it just me being a ninny or there's a "--@shared" missing? Or is it not needed in this case?
I think he's including this file from another file which presumably has --@shared.
Find
Reply
« Next Oldest | Next Newest »
Pages (2): « Previous 1 2


  • 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.