Unable to Convert from 'TMesh' to 'Int'

BlitzMax Modules Forums/MiniB3D/Unable to Convert from 'TMesh' to 'Int'

Strict

Import sidesign.minib3d

Local screenX:Int=800,screenY:Int=600

Type TPlayer Extends TEntity
	Field model:TMesh

	Method CopyEntity:TPlayer(parent_ent:TEntity=Null)

	End Method
	
	Function Create:TPlayer(file$)
		Local ent:TPlayer = New TPlayer
		ent.model = CreateCube() 'LoadAnimMesh(file$)
 		ent.EntityListAdd(entity_list)
	End Function
	
	Method Update()
			
	        .TurnEntity model,0,0,+5
		
	End Method
	
End Type

Graphics3D screenX,screenY,32,0

Local light:TLight=CreateLight()

Local alan:TPlayer=TPlayer.Create("meshes\box.b3d")

While Not KeyHit(KEY_ESCAPE)
	UpdateWorld
	RenderWorld
	Flip
Wend


The problem lies in your type, exactly that you're extending it from TEntity and so in your update method you're in the scope of TEntity and TurnEntity is a method within the Type TEntity.
To call the correct Function you have to leave the scope of TEntity to add a point (.TurnEntity(model,x,y,z) or you have to call the models' method directly (model.TurnEntity(x,y,z) .
The last one is called with your code but instead of the correct x value you have assigned the model:TMesh to it and that caused the FLoat - TMesh error.

I hope this was understandable :)

cheers klepto2