ID:269370
 
I know this is a really lame question and is probably in the DM guide....but how do you end the game? Can someone send me a snippet of code showing how to quit the current world... Thanks

Bob Smith
mob/verb/shut_down_world()
world<<"World is shutting down in 30 seconds!"
sleep(300)
del(world)
Bob Smith wrote:
I know this is a really lame question and is probably in the DM guide....but how do you end the game? Can someone send me a snippet of code showing how to quit the current world... Thanks

Bob Smith

is it just me or have I seen this post before >.> ...
but anyway just put a:
del (world)

at the bottom of the proc/verb you want to shut the world down

O-matic
In response to O-matic
You have... the previous one was "del(world" by Hell Ramen. It didn't have the space...
In response to Jokerjohn
Thanks
In response to Bob Smith
Bob Smith wrote:
You have... the previous one was "del(world" by Hell Ramen. It didn't have the space...

the space doen't matter it will delete the world.

O-matic
I'm suprised that nobody's mentioned shutdown().

Admin/proc/Shutdown_World()
world << "The game is being shut down."
shutdown()


Not that there's anything wrong with manually deleting world, but in many cases, it would be a lot easier to control the manual shutdown process using shutdown().
In response to Wizkidd0123
I didn't knew that there was a shut down proc >.>

O-matic
In response to O-matic
Really? It didn't work for me...
In response to O-matic
Neiter did I. I always used del(world)
Hmmm....Which do you think would be more acepted in the 4K challenge?
In response to Jamesburrow
actually both do basicaly the same, so I think they are both accepted

But myself I've always used del(world) I've never heard of shutdown()before.

ahh well basically they both do the same thats what I'm trying to say :)

O-matic
In response to Jamesburrow
Probably "d w", considering you did:
#define D #define
D d del
D w world

;)
Or something similar.
In response to O-matic
That isn't what he meant. The 4K challenge is using 4 kilobytes (I think that is the measurement) or less of the whole project (excluding graphics I think.) So basically the more characters something is, the more bytes it takes up.
In response to N1ghtW1ng
Actually, O-matic understood what I was asking. Basically, I was asking which was the standard, and therefore better for the 4K contest.
In response to Jamesburrow
I'm pretty sure BYOND compiles to Machine Code. In that case, how long you type isnt all that important. All your long words get converted to a few bits.

var/ThisIsMyLongVariableAndItIsRidiculuslyLong
vs.
var/X

Each variable gets converted to a pointer to the location of the thing to remember, which is a hex number. The name of your variable is just to make it easier for you to remember. What is easier to remember? X or 0x004D31.

EDIT

Obviously more lines WILL take more room, but procedure and variables that take longer to write wont allways take more memory.

RE EDIT

I forgot to answer your question. If your trying to save memory, I would use ShutDown(). Because it is a pointer to a procedure, instead of a procedure + a variable, it should take less room.
In response to Jamesburrow
Jamesburrow wrote:
Actually, O-matic understood what I was asking. Basically, I was asking which was the standard, and therefore better for the 4K contest.

Heh, I don't think standards apply to the 4K contest, James.

It's every man for themselves when it comes to 4K- that means, unreadable, compact, and ugly code.

It's for the greater good!
In response to FranquiBoy
Yeah, but for the 4k challenge:
s-h-u-t-d-o-w-n-(-)
d-e-l--w-o-r-l-d


Plus, you'll probably already have del and world already defined, making it:
s-h-u-t-d-o-w-n-(-)
d--w
In response to Hell Ramen
if its 4kb for the compile version, the one with the shortest ammount of arguments is better. If it's 4kb none-compiled, its the shortest one. From what I understand its post-compiled, meaning The Length Of The Text Does Not Make A Diffrence.
In response to FranquiBoy
FranquiBoy wrote:
if its 4kb for the compile version, the one with the shortest ammount of arguments is better. If it's 4kb none-compiled, its the shortest one. From what I understand its post-compiled, meaning The Length Of The Text Does Not Make A Diffrence.

It's the size of the source code in .dm format, not post-compiled.

Since graphics and the map don't matter.
In response to FranquiBoy
(just a quick correction)

FranquiBoy wrote:
I'm pretty sure BYOND compiles to Machine Code.

Nope, BYOND compiles to interpreted byte code. Not the same thing. :)