In the wall script, you should define a skill for the wall so that it can be catagorized as an invisible wall.
define Object_type,skill1; // 0 is for player, 1 is for inv wall, etc.
action invisible_wall
{
my.passable=on;
my.object_type=1; // set 1 for an invisible wall
}
Now make a map entity that is just a block and build as map entity. Then go back to your main level and load this map entity. Assign the invisible_wall script to it.
Now in your turtle script do this:
while(1)
{
if(c_content(my.x)==content_passable) // check the content of the turtle
{
if(you.object_type==1)// if the content is a passable invisible block
{ turtle_stop();}
}
wait(1);
}
///////////////////////////////////////
What this does is it makes the turtle check the content of its current position. If the current posisition is a passable block, it will check to see if the passable block is an invisible wall that is meant to turn the turtle. Since c_content can return a valid "you" pointer immediatly after a successful content check, you can find out skills of the map entity if it were just like a model entity or any other entity. If the map entity that the turtle is in, has its object_type set to 1, it recognizes that it is inside a turning invisible block. Then it will excecute whatever code you want (stopping or turning).
With this method, you have to work with a few rules. You cant have a turning block touching another passable block, such as a water box. C_content might be random as to what map entity it will detect, so dont make a turning block touch a water block.
You also have to make sure that the turtle switches to a totally different state, once it detects a turning block. If you do just a simple my.pan+=10; in turning the turtle, the turtle will be seen endlessly spinning inside the map entity. So make a different state that attempts to move the turtle away, then switch back to the patrolling state.
There are MANY more ways to turn the turtle, scanning for turn trigger entities, using trace to find out the texture of a model that is used to signify turning.