get-age not working in 2.7b?

Hey all,

I'm trying to write a simple simulation that requires individuals to die after a certain amount of seconds. Individuals are Mobiles, and LIFESPAN is a constant. My code is as follows:

if (self get-age) > LIFESPAN: free self.
print (self get-age).

The output is always zero. Is this a beta issue or am I just being dense =P.

Boom

2.6

Turns out 2.6 CLI version has the same issues. I can't get-time or get-age. Those both spew 0's.

seems to work for me...

If I add "print (self get-age)." in any of the demo simulations, it prints out a number that grows as the simulation runs.

Are you sure that time is stepping forward in your simulation? A missing call to "super iterate" in your controller could cause time to not step forward properly. Since "get-time" isn't working for you either, I would actually guess that this is the problem.

- jon

super iterate

Yep, forgot the super iterate. Sorry about that. Thanks for the help.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.