ID:264275
 
Code:
var
allowed_ppl
world
proc
SaveAllowedPpl()
var/savefile/F = new("System files/Allowed_ppl.sav")
if(F)
F << allowed_ppl
Write(F)
LoadAllowedPpl()
var/savefile/F = locate("System files/Allowed_ppl.sav")
if(F)
Read(F)
allowed_ppl << F


Problem description:
loading Project1.dme
Project1.dm:11:error:Write:undefined proc
project1.dm:15:error:Read:undefined proc


why wont this work?


Write() is not a /world proc.

You have to put that proc either under /atom or under /datum.
In response to Andre-g1
Or he could just manually save the vars.

var/list/allowed

world/New()
..()
if(fexists("Savefile")) //if it exists
var/savefile/F = new("Savefile") //make it a var
F["Allowed"] >> allowed //load the info from the allowed directory
if(!allowed) allowed = new //if there was nothing, make it a blank list
world/Del()
var/savefile/F = new("Savefile") //make it a var (and if it doesn't exist, make it)
F["Allowed"] << allowed //save the allowed list into it
..() //call the default action, which deletes the world
Biond_coder wrote:
not a clue what I'm doing (*fixed*)

Well, no offense, but that's that. Why are you even attempting to call Read() and Write()? Clearly you don't know what they're for, or how to use them, so why are you using them?
You shouldn't try until you're willing to learn about them; the DM Reference and DM Guide hold plenty of information about 'em.
There's also the problem that you're saving in your LoadAllowedPpl() too; you're using the writing operator still (<<).
So, you should look the following up in the DM Reference (press F1 in Dream Maker), (and if you don't get it then read the savefiles chapter on the DM Guide): >> and << savefile operators, savefile, Read() and Write().

why wont this work?

Clearly because the Write() and Read() procs are undefined, which means they don't exist (at least in the context you've used them). But I hope you've gathered as much from the error.
The problem is that Read() and Write() are not global procs, like which you're trying to use them, but object procs. They require an object to run (which is signified either by using the '.' (dot) or ':' (colon) operators, preferably the former), and they operate on it.
mob/verb/Use_Procs()
//(this verb itself is an object proc)
var/turf/T = locate(1,1,1) //locate() is a global proc
if(T) src.Move(T) //Move() is an object proc

You may have noticed your code seems to sometimes compile even when using Write() and Read() like you have. This would happen in an atom or mob proc for example, because when you use an undefiend var or proc, if the proc is an object proc the compiler will try to "autocomplete" it and use src for you, as a shortcut. In your example however the src is of /world type, which does not have Read() and Write() procs, so it errors.
So you're out of luck in this case, but even though your 2 problems here are straightforward to solve, in any case you should understand the procs you're using and not rely on luck to have them work, without knowing what's actually happening. Naturally the same from copying code from the forums or other sources.

Good luck.