Safety Checking Pull Script
by Dreamless Dancer
This I call the "Safety Pull" script, it does various error
checking to ensure that you can pull the furre into a location which they really
are not supposed to go if they were to go and try to walk there. I made this
complicated script becuase I found that while a 'normal' pull would not toss the
furre into a no-walk item or floor, it WOULD put them into anything from the E
files. And ghost them. |
|
* // begin Common Pull
* // catch positions int a pair of variables, and set
the error testing variable to 0
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
    (5:300) set variable %pullfailure
to the value 0.
    (5:350) set variable %furrepullfrom to the X,Y position the triggering furre (moved from/is standing at).
    (5:350) set variable %furrepullto to the X,Y position the triggering furre (moved from/is standing at).
* // We now move those positions to in front of and behind
of the triggering furre.
* // move positions ne/sw
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:13) and the triggering furre is facing northeast (up and right),
    (5:352) move the position in variable %furrepullfrom northeast (up and right) 1 step(s).
    (5:354) move the position in variable %furrepullto southwest (down and left) 1 step(s).
* // move positions se/nw
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:14) and the triggering furre is facing southeast (down and right),
    (5:353) move the position in variable %furrepullfrom southeast (down and right) 1 step(s).
    (5:355) move the position in variable %furrepullto northwest (up and left) 1 step(s).
* // move positions sw/ne
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:15) and the triggering furre is facing southwest (down and left),
    (5:354) move the position in variable %furrepullfrom southwest (down and left) 1 step(s).
    (5:352) move the position in variable %furrepullto northeast (up and right) 1 step(s).
* // move positions nw/se
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:16) and the triggering furre is facing northwest (up and left),
    (5:355) move the position in variable %furrepullfrom northwest (up and left) 1 step(s).
    (5:353) move the position in variable %furrepullto southeast (down and right) 1 step(s).
* // check if within main lobby area
* // this is a 'bounds' checking, if you want pull to work every where in your
dream, then either remove all the tests, or set them to the map limits.
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:201) and variable %furrepullfrom.x is greater than 8.
(1:202) and variable %furrepullfrom.x is less than 52.
(1:201) and variable %furrepullfrom.y is greater than 10.
(1:202) and variable %furrepullfrom.y is less than 54.
(1:201) and variable %furrepullto.x is greater than 8.
(1:202) and variable %furrepullto.x is less than 52.
(1:201) and variable %furrepullto.y is greater than 10.
(1:202) and variable %furrepullto.y is less than 54.
     (5:302) take variable
%pullfailure and add 1 to it.
* // protect furre if furre on extended object, this was
simply added to make any object in the extended objects an AFK object, ie, a
safe zone. If you don't want this, simply remove everything from the (5:381)
to the
(1:202) to bump the
error testing flag by one. Or make the next chunk add 2
to the variable.
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
    (5:381) set variable %pullfloor to the object type at (%furrepullfrom).
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
(1:202) and variable %pullfloor is less than 2400.
     (5:302) take variable
%pullfailure and add 1 to it.
* // protect furre if pullto is extended object, this is
the check which is the important one, this keeps the furre from being pulled
onto an extended object and causing the ghosting.
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
    (5:381) set variable %pullfloor to the
object type at (%furrepullto).
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
(1:202) and variable %pullfloor is less than
500.
    (5:302) take variable %pullfailure
and add 1 to it.
* // protect furre if furre on extended floor, this was
simply added to make any floor in the extended objects an AFK object, ie, a safe
zone. If you don't want this, simply remove everything from the (5:380)
to the
(1:202) to bump the
error testing flag by one. Or make the next chunk add 2
to the variable
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
    (5:380) set variable %pullfloor to the
floor type at (%furrepullfrom).
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
(1:202) and variable %pullfloor is less than
500.
     (5:302) take variable
%pullfailure and add 1 to it.
* // protect furre if pullto is extended object, this is
the check which is the important one, this keeps the furre from being pulled
onto an extended object and causing the ghosting.
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
    (5:380) set variable %pullfloor to the
floor type at (%furrepullto).
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
(1:202) and variable %pullfloor is less than 2400.
    (5:302) take variable %pullfailure
and add 1 to it.
* // pull furre if above conditions produce a 5 in
%pullfailure. Note, it's also not necessary to mask out the un-needed chucks if
you pay attention to the number of checks you run and just have this chunk be
[TRUE] for the right value in %pullfailure
(0:31) When a furre says {pull},
(1:11) and the triggering furre has got shared control (or is the dream owner),
(1:1100) and there's a furre at (%furrepullfrom),
(1:200) and variable %pullfailure
is equal to 5.
  (3:2) at position (%furrepullfrom) on the map,
    (5:16) move any furre present to (%furrepullto) if there's nobody already there.
* // Finally, being a programmer, I like to clean up
afterwards, so I set everything back to 0.
(0:31) When a furre says {pull},
    (5:300) set variable %pullfailure
to the value 0.
    (5:300) set variable %furrepullfrom.x to the value 0.
    (5:300) set variable %furrepullfrom.y to the value 0.
    (5:300) set variable %furrepullto.x to the value 0.
    (5:300) set variable %furrepullto.y to the value 0.
* // end Common Pull
It's possible to add additional checks in this mess to add other items and or
floors to protect the furre on them from being pulled off of, but for each check
you do, be sure to increase the final test value appropriately.
|
 |
Generated by DragonSpeak Editor, Feb. 14 2004, 17:42
|