Halo, I think what crashes your game is this line:
Quote: "
`tests if door will activate
if len# < 40 `and doorup(obj) = 0 <-----"
Solution? You need to separate the lines using the semi-colon symbol as follows:
`tests if door will activate
if len# < 40 : `and doorup(obj) = 0
An alternative way to check if your player is close to a door is to use something which I call "Zone Check". What it does is that it checks to see whether
A Coordinate is
inside the defined rectangular zone. Here is the function:
Function CheckRegion(ObjNum, MinimumX, MaximumX, MinimumZ, MaximumZ)
Check=0
If (Object Position X(ObjNum) >= MinimumX) AND (Object Position X(ObjNum) =< MaximumX)
If (Object Position Z(ObjNum) >= MinimumZ) AND (Object Position Z(ObjNum) =< MaximumZ)
Check=1
EndIf
EndIf
EndFunction Check
I believe the function is self-explanatory. To see if the player is close to a door, check the player against the doorstep-zone. If it's at the doorstep, then it will return a value of 1.
AsriCE Crew,
- Adi
There's only one hope.