MongoosePeople. Places. Questionable inventions.

Changelog

All public mailing lists

random events, or, revents

2008-03-12 15:22 UTC · Daiverd (#2)

Added:

$room:revent, $room.last_revent = time of last revent, $room.revent_interval = 30, $room.revent_padding = 10, $room_utils:do_revent

Notes:

$room_utils:do_revent needs to be put on a scheduler somewhere

everytime do_revent is called it looks at locations where connected players are and if current time is greater equal to last_revent plus revent_interval it forks random revent_padding in the fork it calls :revent on that room and sets it's last_revent to the current time.

This means, that if someone hasn't been in a room for a while revent interval will be long passed so that room will get an event in random revent_padding seconds.

this looks like an easy way to make things happen without them happening without people in the room. instead of them being room by room based they're based on where connected players are.

Back to Changelog