ID:264449
 
Code:
world
New() //overrides the world's New() proc
for (var/Atype in typesof(/area)) //loops through area prototypes
var/area/A = new Atype //creates a new instance of each prototype
A.tag = A.name //makes it's tag the same as it's name

..() //calls the parent


area
var //declare new area variables
North
South
East
West
Courtyard
desc = "Hushed noises from the lounge drift out into this pleasant-smelling courtyard."
East = "Lounge"
var/list/ExitList = list("East")

Kitchen
desc = "A refrigerator is here, stocked with snacks and drinks for people who help newbies with their code."
South = "Lounge"

Lounge //create a new area prototype
desc = "It is very comfy here. The walls are edged in bean bag chairs."
North = "Kitchen"
West = "Courtyard"

obj
Certificate
desc = "The certificate reads, 'I hate byond.'"


mob
Login() //overrides the mob's login proc
Move(locate("Lounge")) //finds Lounge and puts the mobs there
..() //calls the parent
new /obj/Certificate (usr)
Move(area/A) //overrides the mob's Move() proc
..() //calls the parent
src <<"<b>[A.name]</b>"
src << A.desc //displays room description
src << "People here: \..."
for (var/mob/M in A) //loops through mobs in room, displaying each
if (M == src) src << "You \..."
else src << "[M] \..."
src << "\nStuff here: \..."
for (var/obj/O in A) src << "[O] \..."
src << "\nExits: \..." //displays any exits
if (A.North) src << "North \..."
if (A.South) src << "South \..."
if (A.East) src << "East \..."
if (A.West) src << "West \..."
src << ""

verb
say(msg as text) //what the usr says is passed into 'msg' as text
Msg23("You say, '[msg]'", "[usr] says, '[msg]'") //gives our task to Msg23

emote(msg as text) //what the user emotes is passed into 'msg' as text
world << "[usr] [msg]" //everyone sees this

wave(var/mob/M as mob in oview()) //waves to a mob in oview()
Msg223("You wave to [M].",target = M,"[usr] waves to you.","[usr] waves to [M].")

drop(var/obj/O in usr.contents) //drops an item at your position
Msg23("You drop [O].","[usr] drops [O].")
O.loc = usr.loc

get(var/obj/O as obj in oview()) //picks up an item at your position
Msg23("You get [O].","[usr] gets [O].")
O.loc = usr.contents

inventory() //checks your inventory
usr << "You are carrying:"
for (var/obj/O in usr.contents) usr << O

look(var/obj/O in view()) //examines an object in view
usr << "You look at [O]."
usr << O.desc

move //error: invalid proc definition
Move




proc
Msg23(second,third) //declares a new proc that takes two arguments.
usr << second //outputs the first to the usr
oview() << third //outputs the second to oview()
Msg223(second1,target,second2,third)
usr << second1 //outputs the first text string to the usr
target << second2 //outputs second text string to verb target
for (var/mob/M in oview()) //outputs third to mobs in view who are neither
if (M != target) M << third
Move //error: invalid proc definition
var/area/A = usr.loc
var/list/ExitList
var/Decision = input("Which direction?")as null|anything in ExitList
if(Decision == East) usr.loc = A.East
else if(Decision == West) usr.loc = A.West
else if(Decision == North) usr.loc = A.North
else if(Decision == South) usr.loc = A.South

client
North() //overrides the client's North() proc
var/area/A = usr.loc //creates a variable to hold the user's loc position
if (A.North) usr.Move(locate(A.North)) //moves player North if possible
else usr << "You can't go there." //otherwise not
South()
var/area/A = usr.loc
if (A.South) usr.Move(locate(A.South))
else usr << "You can't go there."
East()
var/area/A = usr.loc
if (A.East) usr.Move(locate(A.East))
else usr << "You can't go there."
West()
var/area/A = usr.loc
if (A.West) usr.Move(locate(A.West))
else usr << "You can't go there."


Problem description:
'move' verb and 'Move' proc both give error: invalid proc definition.

And I have no idea how to fix this. >w>;

var/list/ExitList = list("East")as null|anything in ExitList


I dont think you want to be setting the exit list based off of the exit list, its kind of bad, ill see what you're trying to do
In response to Morialis
I think you should take out "in ExitList" from that line, does that fix that one?
In response to Morialis
Mm... I think I'm doing this wrong. I can't exactly name every list for the room as 'ExitList', or it'll try and call every 'ExitList' when it goes looking... *ponder* and I can't think of how to make this work. >w<;
In response to Morialis
Morialis wrote:
I think you should take out "in ExitList" from that line, does that fix that one?

Gives warning: 'anything' has no meaning without a list.
In response to Axel Wildfire
oh I see what you did, you don't need all the stuff on the end of that one since its not making a decision, try this

var/list/ExitList = list("East")
In response to Morialis
That fixes that problem; the only issue is that move and Move still give me error: invalid proc definition, which I have no clue how to fix.
I've answered this in your first thread. Unfortunately, I took a while doing so and Morialis gave a whole bunch of bad advice. Please ignore it.

And Morialis, please don't try to help people before you yourself are capable.
In response to Axel Wildfire
basically, i have no idea what you're trying to do with this one lol

move //Error: invalid proc definition
Move


what are you trying to do with that? maybe even just removing it from the code will work?
In response to Morialis
but to start with, verbs need () at the end of them

[Edit] putting () at the end of every move/Move without them might work
In response to Morialis
Right, here's how it looks after Garthor's help:

world
New() //overrides the world's New() proc
for (var/Atype in typesof(/area)) //loops through area prototypes
var/area/A = new Atype //creates a new instance of each prototype
A.tag = A.name //makes it's tag the same as it's name

..() //calls the parent


area
var/list/exits
verb //errors: missing comma ',' or right-paren ')'; expected end of statement.
go(var/destination in exits)
set src = usr.loc
//get the associated area
var/dest = exits[destination]
var/area/A = locate(dest)
//move there, routing through client.Move because it's a voluntary movement
usr.Move(A)

proc
look(var/mob/looker)
//tell us about the room
looker << desc

//tell us about what the room contains
var/foundsomething = 0
for(var/atom/movable/A in src)
if(A != looker)
if(!foundsomething)
looker << "You see:"
foundsomething = 1
looker << "\t[A]"
looker << "Exits:"
for(var/v in exits)
looker << "\t[v]"

Entered(var/atom/movable/A)
if(ismob(A))
A << "You enter [src]."
oview() << "[A] has entered the room."
src.look(A)

Courtyard
desc = "Hushed noises from the lounge drift out into this pleasant-smelling courtyard."
exits = list("East" = /area/Lounge)

Kitchen
desc = "A refrigerator is here, stocked with snacks and drinks for people who help newbies with their code."
exits = list("South" = /area/Lounge)

Lounge //create a new area prototype
desc = "It is very comfy here. The walls are edged in bean bag chairs."
exits = list("North" = /area/Kitchen, "West" = /area/Courtyard)


mob
Login()
Move(locate(/area/Lounge)

verb
say(msg as text) //what the usr says is passed into 'msg' as text
Msg23("You say, '[msg]'", "[usr] says, '[msg]'") //gives our task to Msg23

emote(msg as text) //what the user emotes is passed into 'msg' as text
world << "[usr] [msg]" //everyone sees this

wave(var/mob/M as mob in oview()) //waves to a mob in oview()
Msg223("You wave to [M].",target = M,"[usr] waves to you.","[usr] waves to [M].")

drop(var/obj/O in usr.contents) //drops an item at your position
Msg23("You drop [O].","[usr] drops [O].")
O.loc = usr.loc

get(var/obj/O as obj in oview()) //picks up an item at your position
Msg23("You get [O].","[usr] gets [O].")
O.loc = usr.contents

inventory() //checks your inventory
usr << "You are carrying:"
for (var/obj/O in usr.contents) usr << O

look()
var/area/A = loc
if(istype(A))
A.look(src)





proc
Msg23(second,third) //declares a new proc that takes two arguments.
usr << second //outputs the first to the usr
oview() << third //outputs the second to oview()
Msg223(second1,target,second2,third)
usr << second1 //outputs the first text string to the usr
target << second2 //outputs second text string to verb target
for (var/mob/M in oview()) //outputs third to mobs in view who are neither
if (M != target) M << third

/*client
North() //overrides the client's North() proc
var/area/A = usr.loc //creates a variable to hold the user's loc position
if (A.North) usr.Move(locate(A.North)) //moves player North if possible
else usr << "You can't go there." //otherwise not
South()
var/area/A = usr.loc
if (A.South) usr.Move(locate(A.South))
else usr << "You can't go there."
East()
var/area/A = usr.loc
if (A.East) usr.Move(locate(A.East))
else usr << "You can't go there."
West()
var/area/A = usr.loc
if (A.West) usr.Move(locate(A.West))
else usr << "You can't go there."*/


The problem is this part:

area
var/list/exits
verb //errors: missing comma ',' or right-paren ')'; expected end of statement.
In response to Axel Wildfire
if you didn't get help with this yet its probably

for (var/Atype in typesof(/area))  //loops through area prototypes
var/area/A = new Atype //creates a new instance of each prototype
A.tag = A.name


Needs to be
for (var/Atype in typesof(/area))  //loops through area prototypes
var/area/A = new(Atype) //creates a new instance of each prototype
A.tag = A.name
In response to Morialis
Morialis, please stop trying to help. You have been consistently wrong.