Дэвелопер
Регистрация: 21.11.2009
Сообщений: 1,701
Написано 658 полезных сообщений (для 1,963 пользователей)
|
NameEntity - Entity does not exist

SetBuffer(BackBuffer())
SeedRnd(MilliSecs())
Graphics3D(0,0,0,1)
;global
Global cam
Global gw=GraphicsWidth()
Global gh=GraphicsHeight()
Global p,g
Global map
;/global
Type properties
Field entity, e_type, rx,ry,rz,mx,my,mz
End Type
createworld()
Repeat
control()
UpdateWorld
RenderWorld
Text 10,10,CountChildren(map)
Flip
Until KeyHit(1)
End
Function control()
If (KeyDown(205)) Or (KeyDown(32)) MoveEntity (cam,1,0,0)
If (KeyDown(203)) Or (KeyDown(30)) MoveEntity (cam,-1,0,0)
If (KeyDown(208)) Or (KeyDown(31)) MoveEntity (cam,0,0,-1)
If (KeyDown(200)) Or (KeyDown(17)) MoveEntity (cam,0,0,1)
mxs=-MouseXSpeed() : mys=MouseYSpeed()
TurnEntity(cam,0,mxs,0)
TurnEntity(cam,mys,0,0)
MoveMouse(gw/2,gh/2)
End Function
Function createworld()
map=LoadAnimMesh("ololo.3ds")
cam=CreateCamera()
CameraRange(cam,.1,10000)
SortMapObjects(map)
End Function
Function SortMapObjects(entity)
name$=EntityName(entity)
EntityPickMode entity,2
If Instr(name,"p") Then
PositionEntity cam,EntityX#(entity),EntityY#(entity),EntityZ#(entity)
HideEntity(entity)
p=1
EndIf
If Instr(name,"g") Then
prop.properties=New properties
prop\e_type="g"
prop\rx=Float(Mid(name,2,1))
prop\ry=Float(Mid(name,3,1))
prop\rz=Float(Mid(name,4,1))
prop\mx=Float(Mid(name,5,1))
prop\my=Float(Mid(name,6,1))
prop\mz=Float(Mid(name,7,1))
g=2
EndIf
For i=0 To CountChildren(entity)-1
SortMapObjects(GetChild(entity,i))
Next
End Function
Ругается на NameEntity
__________________
осталось 7
|