ID:1262130
 
Code:
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
var/list/Lines = file2list(filename)

for(var/t in Lines)
if(!t) continue

t = trim(t)
if(length(t) == 0)
continue
else if(copytext(t, 1, 2) == "#")
continue

var/pos = findtext(t, " ")
var/name = null
var/value = null

if(pos)
name = lowertext(copytext(t, 1, pos))
value = copytext(t, pos + 1)
else
name = lowertext(t)

if(!name)
continue

if(type == "config")
switch(name)
if("download_external")
client/preload_rsc = "value"
-snipped-


Problem description:
I'm trying to make preload_rsc be toggled whether its in the configuration file. When client/preload_rsc is used outside of a proc it works fine and compiles. However when its inside a proc i get this error

client/preload_rsc: undefined var

/ can not be used as a variable dereferencer; use .
so, client.preload_rsc
In response to Super Saiyan X
Super Saiyan X wrote:
/ can not be used as a variable dereferencer; use .
so, client.preload_rsc

That will only work for a specific client, and no client is passed to this proc.
In response to Murrawhip
Murrawhip wrote:
Super Saiyan X wrote:
/ can not be used as a variable dereferencer; use .
so, client.preload_rsc

That will only work for a specific client, and no client is passed to this proc.


Well, yeah. He'd probably have to have a global variable to contain the value he'd want for preload_rsc; and set it for each client upon log in.
In response to Super Saiyan X
I'm wondering if the client downloads resources during client/New, or before. Any idea?
If it's before, naturally setting preload_rsc during client/New wouldn't accomplish much.
In response to Murrawhip
Murrawhip wrote:
I'm wondering if the client downloads resources during client/New, or before. Any idea?

Resources download between world/IsBanned() and client/New(), however, preload_rsc can be changed during runtime to download new files/zip packages as needed.