Could someone please tell me why I can't seem to get EntityCollided to work with EntityName? In the code, if you turn on the line that's currently off, it crashes. But that makes no sense, because it's just doing the same thing as the line 2 lines above it: turning an id number into a name. Why does passing it through EntityCollided make it incapable of doing that anymore? The answer's probably simple, but I can't seem to figure it out.
Graphics3D 640,480,32,1 SetBuffer BackBuffer() Global character%=1 Global levelpart%=2 Global collisionmethod%=2 Global collisionresponse%=2 Global player1position#=0 Global player1speed#=0 camera=CreateCamera() MoveEntity camera,0,5,-10 TurnEntity camera,20,0,0 CameraZoom camera,1.6 light=CreateLight() TurnEntity light,67.5,-22.5,0 AmbientLight 63,63,63 Global ground=CreateCube() ScaleEntity ground,5,.1,1 MoveEntity ground,0,-1,0 EntityColor ground,63,63,63 Global wall=CreateCube() ScaleEntity wall,.1,1,1 MoveEntity wall,3,0,0 EntityColor wall,63,63,63 EntityType wall,levelpart NameEntity wall,"Wall" Global player1=CreateSphere() ScaleEntity player1,.5,.5,.5 MoveEntity player1,0,-.5,0 EntityColor player1,127,127,127 EntityType player1,character EntityRadius player1,.5 While Not KeyHit(1) If KeyDown(203) player1speed=-.1 ElseIf KeyDown(205) player1speed=+.1 Else player1speed=0 EndIf MoveEntity player1,player1speed,0,0 Collisions character,levelpart,collisionmethod,collisionresponse UpdateWorld RenderWorld Color 127,127,127 Text 0,0,"Wall's id number is " +wall Text 0,15,"it's name is " +EntityName(wall) Text 0,45,"Player1 has touched " +EntityCollided(player1,levelpart) ;Text 0,60,"it's name is " +EntityName(EntityCollided(player1,levelpart)) Text 0,460,"Move with left and right" Flip Wend End