ID:2260059
 
(See the best response by Maximus_Alex2003.)
Code:
var list/books = new
var save_path = "worldsaves.sav"
obj/
BookShelves
Click()
var mob/m = usr
var chosen
var information
switch(input(m,"What would you like to do?") in list("Cancel","Read","Write"))
if("Read")
if(global.books.len == 0)
src << "The bookcase is empty."
return
chosen = input(m,"Which book?","Select a Book") in global.books
information = global.books[chosen]
// chosen = Title of the Book
// information = The contents of the book/text.
src << "Reading <u>[chosen]</u>."
src << information
if("Write")
chosen = input(m,"Title?","Title") as text
if(chosen && length(chosen) > 3)
information = input(m,"The title is [chosen].","Contents") as message
if(information && length(information) > 23)
global.books[chosen] = information
world/New()
..()
global.books = new
if(fexists(save_path))
var savefile/s = new(save_path)
s["books"] >> global.books
world/Del()
var savefile/s = new(save_path)
s["books"] << global.books
..()

icon='bookshelf.dmi'
One
icon_state="bookshelf"
density=1
layer=TURF_LAYER+1
Two
icon_state="bookshelf1"
density=1
layer=TURF_LAYER+1
Three
icon_state="bookshelf2"
density=1
layer=TURF_LAYER+1
Four
icon_state="bookshelf3"
density=1
layer=TURF_LAYER+1
Five
icon_state="bookshelf4"
density=1
layer=TURF_LAYER+1


Problem description:This is what i have so far. I was making a library/book system and i have only one error stating the this process definition not allowed inside another proc
The line below is the one holding the error
icon='bookshelf.dmi'
Best response
I would like to just point out that you're issue has already been resolved. Please take the advise from BYOND members and staff before making a new post.


Also, this is probably why you're having issues.







tl;dr: Double check your code. Something completely obvious is wrong and you're expecting copypasta code when you should be easily able to see what's wrong and what others have told you is wrong. Hint: The location of a code block is incorrect.

Also, Ter13 isn't staff. You're getting helpful members who do this for hobby confused with "staff".
Greetings ! Its a pleasure. Try to take it slow with me. Im learning through reading the dm guide as well as the help offered to me but after all its best to take it a step at a time

:D how have you been?
To add onto Maximus_Alex2003's hint:
Hint: The location of a code block is incorrect.

Look at the placement of the children of /obj/BookShelves, what do you see wrong there? What's interfering?

This error should be glaringly obvious even if you've only read the first chapter of the DM guide.
^
mob
Login()
Library()
proc
Library()
world<<"^"
Library()

There, your welcome
world
New()
// world/New() is called upon the world booting up.
..()
global.books = new
if(fexists(save_path))
var savefile/s = new(save_path)
s["books"] >> global.books
Del()
// world/Del() is called upon the world shutting down.
var savefile/s = new(save_path)
s["books"] << global.books
..()

// These are global variables that can be used anywhere.
var list/books = new
var save_path = "worldsaves.sav"


// This is the Bookshelves path, indentation is important, compare to the above.
obj
BookShelves
Click()
var mob/m = usr
var chosen
var information
switch(input(m,"What would you like to do?") in list("Cancel","Read","Write"))
if("Read")
if(global.books.len == 0)
src << "The bookcase is empty."
return
chosen = input(m,"Which book?","Select a Book") in global.books
information = global.books[chosen]
// chosen = Title of the Book
// information = The contents of the book/text.
src << "Reading <u>[chosen]</u>."
src << information
if("Write")
chosen = input(m,"Title?","Title") as text
if(chosen && length(chosen) > 3)
information = input(m,"The title is [chosen].","Contents") as message
if(information && length(information) > 23)
global.books[chosen] = information
// Below would be /obj/BookShelves/One
// Instead of setting all their variables seperate do this.
icon='bookshelf.dmi'
density=1
layer=TURF_LAYER+1
One
icon_state="bookshelf"
Two
icon_state="bookshelf1"
Three
icon_state="bookshelf2"
Four
icon_state="bookshelf3"
Five
icon_state="bookshelf4"
In response to Kozuma3


OP, your issue is you interrupted the chain from the parent obj to its children by introducing the world New/Del() functions. The children didn't know what to do, they didn't have a path structure and were improperly indented.

Solution 1:
world
New()
Del()

obj/BookShelves
Click()
Child1
Child2


Solution 2:
obj/BookShelves
Click()

world
New()
Del()

obj/BookShelves // You had to simply redefine the parent path below the world functions
Child1
Child2


Solution 1 is obvious ideal, as to not interrupt obj grouping meaninglessly. Please, continue reading the DM guide. Please.