Funtion Not found...

Blitz3D Forums/Blitz3D Beginners Area/Funtion Not found...

Here is my code (sorry it's kind of long) :

Graphics3D 1280,800,32,1
SetBuffer BackBuffer()


w=17
a=30
s=31
d=32
q=16
e=18
space=57
lshift=42

Global scenery=1

Global character=2

Global go=0

Global finishrun=0


;Input Variables
Global m_up=0
Global m_left=0
Global m_right=0
Global m_down=0

Global move=0
Global direction=0
Global rota=0
Global turning=0
Global idle=0
Global ey=0


;Start Set Up


camera=CreateCamera()

light=CreateLight()
PositionEntity light,100,80,70
LightRange light,3000


;Start Loading Stuff!!!


plane=CreatePlane()
grass=LoadTexture("grass.jpg")
ScaleTexture grass,4,4
EntityTexture plane,grass 
EntityType plane,scenery


dwarf=LoadAnimMesh("dwarf2.x")
dwarfsrun=ExtractAnimSeq(dwarf,40,75)
dwarfrun=ExtractAnimSeq(dwarf,45,75)
dwarferun=ExtractAnimSeq(dwarf,45,80)
;The animation for the dwarf might be confusing.
;To start running start at "frame 40" and to end is frame 80.
;To continue running start at frame 45 and finish on frame 75.




dwarfbox=LoadAnimMesh("dwrfboxalone.x")
axebox=LoadAnimMesh("axeboxalone.x")
MoveEntity axebox,2.5,-1.7,1
dwarfboxrun=ExtractAnimSeq(dwarfbox,45,75)
axeboxrun=ExtractAnimSeq(axebox,45,75)
dwarfboxsrun=ExtractAnimSeq(dwarfbox,40,75)
axeboxsrun=ExtractAnimSeq(axebox,40,75)
dwarfboxerun=ExtractAnimSeq(dwarfbox,45,80)
axeboxerun=ExtractAnimSeq(axebox,45,80)


;End Loading Stuff!!!!



EntityParent axebox,dwarf
EntityParent dwarfbox,dwarf

EntityAlpha dwarfbox,0.3

commandbox=CreateCube()
MoveEntity commandbox,0,-1.9,0
EntityParent dwarf,commandbox
EntityAlpha commandbox,0





pivot=CreatePivot()
EntityParent pivot,commandbox
EntityParent camera,pivot
MoveEntity commandbox,0,10,9
EntityType dwarfbox,character

EntityType commandbox,character

MoveEntity camera,0,5,-12


Collisions character,scenery,2,2



HideEntity dwarfbox
HideEntity axebox



;End Set Up



;The Parenting Goes like this:
;            
;             Command Box
;                 ^
;          Dwarf  &  Pivot
;           ^     |      ^
;Axebox & DwarfBox|   Camera




FlushKeys()

While Not KeyDown(1)

;;;;;;;;;;;;;;;;;;;
;KEY INPUT!!!
;;;;;;;;;;;;;;;;;;;

;Section 1

idle = 1




If KeyDown(w)
      move = 1
      m_up = 1
End If 

If KeyDown(a)
      move = 1
      m_left = 1
End If

If KeyDown(d)
      move = 1
      m_right = 1
End If

If KeyDown(s)
      move = 1
      m_down = 1
End If


;Section 2

If m_up = 1
      If m_right = 1
            direction = 2
      Else If m_left = 1
            direction = 8
      Else If m_down = 1
            direction = 0
      Else 
            direction = 1
      End If


Else If m_right = 1
      If m_down = 1
            direction = 4
      Else If m_left = 1
            direction = 0
      Else 
            direction = 3
      End If


Else If m_left = 1
      If m_down = 1
            direction = 6
      Else 
            direction = 7
      End If


Else If m_down = 1
      direction = 5


Else 

      move = 0
End If


;Section 3



;;;;;;;;;;;;;;;;;;;;PROBLEM SPOT;;;;;;;;;;;;;;;;;;;;;

ey = EntityYaw(commandbox)
rota = ey / 45

rota - direction = turning      ;<<<<<<<<<<<Right Here
turning = turning  * 3

;;;;;;;;;;;;;;;;;;;;END PROBLEM SPOT;;;;;;;;;;;;;;;;;



If turning > 0
      TurnEntity commandbox,0,15,0
      turning = turning - 1
Else If turning < 0
      TurnEntity commandbox,0,-15,0
      turning = turning + 1
Else If move = 1
      MoveEntity commandbox,0,0,2
      

Else 
      idle = 1
End If

;Reset Time!!!
            
m_up = 0
m_left = 0
m_right = 0
m_down = 0

direction = 0
rota = 0
turning = 0
ey=0


;;;;;;;;;;
;End INPUT
;;;;;;;;;;


;Apply Gravity...
MoveEntity commandbox,0,-0.1,0



UpdateWorld
RenderWorld

Flip
Wend
End



When I compile it, Blitz says "Function "rota" not found" on the line:

rota - direction = turning ;<<<<<<<<<<<Right Here

Thanks for your help!

It should be

turning = rota - direction

Remember, this isn't like you would write out a math problem; you do the math on the right, and assign to a variable on the left. I wouldn't expect that to give a Function Not Found error though.

O my gosh!! Stupid me. Thanks Master J. Hocking!

"[code][/code]"
"[codebox][/codebox]"

@H&K
Done.