ID:148461
 
Ok Heres the thing, i need a build proc, well, i got one, but it doesnt work, so i need you to tell me what i need to add or subtract from it---

obj/sign(T as text)
density = 1
Enter()
usr << "[src.desc]"
return 0

mob/verb/Create_Sign()
var/obj/T = new /obj/sign(locate(usr.x,usr.y,usr.z))
T.desc = input(usr,"What will the sign say?","Sign Text")as text


the error is---

build.dm:5:error:sign :undefined proc

why is this happening, its for the sign building.
Thanks

BeeJay
BeeJay wrote:
obj/sign(T as text)
density = 1
Enter()
usr << "[src.desc]"
return 0

Problems:

  • /obj/sign is not a proc; it should not have (T as text) in it. What you need to do is create a New() proc like this:
obj/sign
New(newloc,T)
..()
desc=T
  • Nothing was indented under Enter().
  • You put usr in Enter(), which is simply dead wrong. Never ever do that.
  • Enter() is of no use to you here anyway, since you seem to want to react when the sign is bumped. This is what you need to do instead:
atom
proc/Bumped() // empty proc unless overridden

movable/Bump(atom/A)
..()
A.Bumped(src)

obj/sign
...

Bumped(atom/movable/A)
A << "<B>[desc]</b>"
  • Your Create_Sign() verb is a little wonky. It should look like this instead:
mob/verb/Create_Sign(T as text)
if(!T) return
new/obj/sign(usr.loc, T)

Lummox JR
In response to Lummox JR
You Guys Rule!!!
Ive been messin with that one dfor ages.
Thanks!!!!
Now, just one more thing,

when the player logs out, it deletes everything they have built!!

how do i make it so that they can build whatever then log out and leave it so they can come back to it later??????
In response to BeeJay
This is a bump!!!!
U guys were SOOOOOOOOOOOOOO fast at answering my last question, and now i get nothing......
i know i shouldnt expect everything from you and im not, this is the last proc i need
this then the rest i can do, so pleeeeeese, help!!!!!!
In response to BeeJay
BeeJay wrote:
You Guys Rule!!!
Ive been messin with that one dfor ages.
Thanks!!!!
Now, just one more thing,

when the player logs out, it deletes everything they have built!!

how do i make it so that they can build whatever then log out and leave it so they can come back to it later??????

There are some demos out there on world saving.

If you feel like messing with it yourself, look up lists, and savefiles. (There might be more things needed, but these are most important)

~>Volte
In response to BeeJay
heres your problem,we dont know enough about what your code looks like. this is a way to save anything created during runtime to come back after you log out

proc/SAVEMAP()
var/savefile/save
save = new("stuff.sav")
for(var/atom/A in world)
save << A
proc/LOADMAP()
var/savefile/load
load = new("stuff.sav")
for(var/atom/A in world)
load >> A
world/New()
..()
LOADMAP()
world/Del()
SAVEMAP()
..()

add this straight into your code, i hope this helps.
In response to Erdrickthegreat2
Erdrickthegreat2 wrote:
heres your problem,we dont know enough about what your code looks like. this is a way to save anything created during runtime to come back after you log out

proc/SAVEMAP()
var/savefile/save
save = new("stuff.sav")
for(var/atom/A in world)
save << A
proc/LOADMAP()
var/savefile/load
load = new("stuff.sav")
for(var/atom/A in world)
load >> A
world/New()
..()
LOADMAP()
world/Del()
SAVEMAP()
..()

add this straight into your code, i hope this helps.


There are a few things wrong with this..

1. You can shorten the savefile creation by simply doing "var/savefile/save = new("stuff.sav")".
2. Under loadmap, it is safer to use fexists to make sure the savefile is there before loading. "if(fexists('stuff.sav'))"
3. This will not load the map. It will just duplicate what was on the map before, and add it at the beginning of the map, causing a pileup in mobs, turfs, and objects.

You need to have a way of relocating the atoms. Take note that not all atoms ARE moveable. Hence the reason they have their own subtype. (atom/moveable)

~>Volte
In response to Volte
your right Volte i typed that real fast not thinking, its an overload of lag having to create all those also, i was thinking, how could i make a verb that saves a new BYOND map file at runtime? I'm still learning with saving things its not my strong suit =)
In response to Erdrickthegreat2
Erdrickthegreat2 wrote:
your right Volte i typed that real fast not thinking, its > an overload of lag having to create all those also, i was > thinking, how could i make a verb that saves a new BYOND > map file at runtime? I'm still learning with saving
things its not my strong suit =)

Thanks, Guys.
That Helped ALOT.
You are All Invited To MY Game, when Its Uploaded!
It's Called -

DMIXtreme [DMIX]

~BeeJay~