Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Any "alarm" script?  (Read 1255 times)

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Any "alarm" script?
« on: May 29, 2015, 10:34:43 pm »

What am I trying to do is checking whether some dangerous creatures have entered a certain area(burrow or the entire map), and sound the alarm if there's any.

The announcement should be like a standard ambush message. For example, a giant olm has entered your dining hall! The game should pause and zoom to the position of the giant olm.

Is it possible? I know there's a lua api which checks if a point is inside a certin burrow. But it has to be checked frequently, and ignore the same creature within a certain period of time (i.e., if the giant olm stays in your dining hall, you don't want to be spammed by the message).

Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

lethosor

  • Bay Watcher
    • View Profile
Re: Any "alarm" script?
« Reply #1 on: June 07, 2015, 10:43:01 am »

It's definitely possible, although obtaining a list of dangerous creatures would be somewhat difficult and the checks could be noticeably slow if done in a script instead of a plugin.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

scamtank

  • Bay Watcher
    • View Profile
Re: Any "alarm" script?
« Reply #2 on: June 07, 2015, 11:20:26 am »

Ignoring all other practical problems, would a simple check for a [LARGE_PREDATOR] tag or maybe even a BODYSIZE threshold be too much overhead? I'm sure anyone would choke on his pretzels seeing an agitated bison tromping around the living room.
Logged