My games

Rock 'n Roll

One way out - Allman Brothers Band

Back in black - ACDC

Highway to hell - ACDC

Layla - Eric Clapton

Barracuda - Heart

Magic Man - Heart

In a gadda da vida - Iron Butterfly

In the evening - Led Zeppelin

Listen to the music - Doobie Brothers

Road house blues - The Doors

Magic bus - The Who

Strangle hold - Ted Nugent

Smokey Joe

Online

Joined: Jun 27, 07

Learn how to love, and forget how to hate.

 

 

I'll be back for you, Jack and I'll let the machine speak.


 

game_del()

A small proc I've made that I find very helpful in my games, I thought I would share it.

This deletion method wont return your code like the built-in del does.


proc
    game_del(atom/a)

        var/list/built_in = list("type","parent_type","gender","verbs","vars","group")
        for(var/v in a.vars)
            if(!(v in built_in))
                a.vars[v] = null


Posted by Smokey Joe on Thursday, October 23, 2008 09:21AM - 4 comments / Members say: yea +0, nay -0

Login to post a comment.

Jeff8500:

Smokey Joe wrote:
> Jeff8500 wrote:
> > Or, instead of setting it to null, you could set it to its initial value with the initial() proc :P
>
> I want to delete it, when all its variables are null like this, it sets its loc to zero, and deletes any references to the object leaving it to the garbage collector.

Oh, I thought you were going for more of a game reset type thing :P

If you're wondering, garbage collection isn't my strong point...

Thursday, October 23, 2008 02:21PM

Smokey Joe:

Jeff8500 wrote:
> Or, instead of setting it to null, you could set it to its initial value with the initial() proc :P

I want to delete it, when all its variables are null like this, it sets its loc to zero, and deletes any references to the object leaving it to the garbage collector.

Thursday, October 23, 2008 02:18PM

Jeff8500:

Or, instead of setting it to null, you could set it to its initial value with the initial() proc :P

Thursday, October 23, 2008 01:49PM

Duelmaster409:

Well, you could do it manually, but that system works in fine. Could be used for starting new games or something, but either way I'd say that's an efficient way of exterminating all non-built in variables.

Thursday, October 23, 2008 11:32AM

 

 

 

Blog Calendar

October 2008
Su Mo Tu We Th Fr Sa
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
 
   

My hosted files

(273.7 KB)

stuff

respect