The code below should get you started. I haven't tested it, though, so it may not work as is. I've used 'Then If' instead of 'And' so that the test will abort early if any of the checks fail (Using 'And' would cause the entire series of checks to be tested even if an early check failed).
If EntityX#( player ) < high_x# Then If EntityX#() > low_x# Then If EntityY#() < high_y# Then If EntityY#() > low_y# Then If EntityZ#() < high_z# Then If EntityZ#() > low_z#
; Player's centerpoint is inside box.
EndIf
If the range box is rotated relative to global space (and assuming it has a pivot or some other type of entity that you can use as a reference which is axially aligned in its local space) then you can map the centerpoint of your player to the range box's local space, using 'TFormPoint', before doing your range-checking.
TFormPoint EntityX#( player ), EntityY#( player ), EntityZ#( player ), 0, range_check_reference_entity
If TFormedX() < high_x# Then If TFormedX() > low_x# Then If TFormedY() < high_y# Then If TFormedY() > low_y# Then If TFormedZ() < high_z# Then If TFormedZ() > low_z#
; Player's centerpoint is inside box.
EndIf
|