[crossfire] Time delay in maps

Mark Wedel mwedel at sonic.net
Tue Mar 19 23:16:12 CDT 2013


On 03/19/13 09:55 AM, Kevin Zheng wrote:
> Hi,
>
> I'm trying to implement time delay in one of the maps I'm working on.
> Unfortunately, I have no idea how to approach this. I suspect I have to
> do something in Python, but I've never done this before, either.
>
> Basically, a magic ear will activate a connection, which needs to start
> a timer. When the timer runs out, it should activate a different
> connection that opens a door.
>
> Any suggestions?

  In the past, people did things like this with clever use of boulders, 
connected spike traps, etc.  I'm not sure if there is any simple way to do this.

  The way it works with boulders is that first connection (magic ear) activates 
the spikes under the boulder.  IIRC, you can set the speed of the spikes, so can 
control the timing to some extent.  The spikes push the boulder onto a button 
which then activates the next step (could be another set of spikes with another 
boulder).  The initial spikes, button, and boulder are in a hidden 1x2 room so 
that the boulder can only get pushed onto the spikes.

  Now if you want this to reset in some time, you then need a set of spikes 
beneath the boulder to push it back to its original location (and some logic to 
lower those initial spikes).

  Or you could do with this with a script - I'm not sure the details, but I'd 
certainly imagine something like having the script tied to some normally 
inactive object that is linked to that ear.  On magic ear activation, the script 
updates the speed of another object to be non zero, and based on the speed and 
speed_left value and pretty precisely set a time.  When that second object gets 
an action, it runs a different script/pushes a different button.

  This could probably be done in one object by toggling the speed - one just has 
to also design that script to behave properly if it gets activated multiple times.


More information about the crossfire mailing list