ok.
attn Nums!!!!!!!!!
I reported this before.
I keep getting this same runtime error 6 overflow.
in the Senses modual ... lookoccurr routine.
rob(o).vx is out of range.
now ...
you said the following would fix this ...
but you didn't specify if all of this had to be changed or where to insert it.
~~~
if abs(rob(o).vx) > rob(o).MaxVel then rob(o).vx = sgn(rob(o).vx) * rob(o).MaxVel
if abs(rob(o).vy) > rob(o).MaxVel then rob(o).vy = sgn(rob(o).vy) * rob(o).MaxVel
rob(n).mem(refvelup) = (rob(o).vx * Cos(rob(n).aim) + rob(o).vy * Sin(rob(n).aim) * -1) - rob(n).mem(velup)
rob(n).mem(refveldn) = rob(n).mem(refvelup) * -1
rob(n).mem(refveldx) = (rob(o).vy * Cos(rob(n).aim) + rob(o).vx * Sin(rob(n).aim)) - rob(n).mem(veldx)
rob(n).mem(refvelsx) = rob(n).mem(refvelsx) * -1
~~~
please, please, please, please ...
would you tell me exactly where in the following rountine this code goes ...
because if I put this at the top of the routine ...
I get a compile error ...
"method or data member not found."
and this highlighted:
Public Sub lookoccurr(n As Integer, o As Integer)
you guys want us to be specific when reporting the bugs ....
would you please be as specific with the fixes? ;)
and/or ...
might someone who now has a stable 2.37.4 upload it as 2.37.4b or something.
I sure would like to be running it as well.
thank you
~griz~
~~~~~~~~~~~~~~~~
' copies the occurr array of a viewed robot
' in the ref* vars of the viewing one
Public Sub lookoccurr(n As Integer, o As Integer)
If rob(n).Corpse Then Exit Sub
Dim t As Byte
'If rob(n).lastviewed <> rob(o).AbsNum Then
For t = 1 To 8
rob(n).mem(occurrstart + t) = rob(o).occurr(t)
Next t
rob(n).lastviewed = rob(o).AbsNum
'End If
If rob(o).nrg < 32001 Then
rob(n).mem(occurrstart + 9) = rob(o).nrg
Else
rob(n).mem(occurrstart + 9) = 32000
End If
rob(n).mem(occurrstart + 10) = rob(o).age '.refage
rob(n).mem(in1) = rob(o).mem(out1)
rob(n).mem(in2) = rob(o).mem(out2)
rob(n).mem(711) = rob(o).mem(18) 'refaim
rob(n).mem(712) = rob(o).occurr(9) 'reftie
rob(n).mem(refshell) = rob(o).Shell
rob(n).mem(refbody) = rob(o).body
rob(n).mem(refypos) = rob(o).mem(217)
rob(n).mem(refxpos) = rob(o).mem(219)
if abs(rob(o).vx) > rob(o).MaxVel then rob(o).vx = sgn(rob(o).vx) * rob(o).MaxVel
if abs(rob(o).vy) > rob(o).MaxVel then rob(o).vy = sgn(rob(o).vy) * rob(o).MaxVel
'give reference variables from the bots frame of reference
rob(n).mem(refvelup) = (rob(o).vx * Cos(rob(n).aim) + rob(o).vy * Sin(rob(n).aim) * -1) - rob(n).mem(velup)
rob(n).mem(refveldn) = rob(n).mem(refvelup) * -1
rob(n).mem(refveldx) = (rob(o).vy * Cos(rob(n).aim) + rob(o).vx * Sin(rob(n).aim)) - rob(n).mem(veldx)
rob(n).mem(refvelsx) = rob(n).mem(refvelsx) * -1
rob(n).mem(refvelscalar) = CInt((CLng(rob(n).mem(refvelup)) ^ 2 + CLng(rob(n).mem(refveldx)) ^ 2) ^ 0.5)
'replaced following line. overflow
'rob(n).mem(refvelscalar) = Sqr(rob(n).mem(refvelup) ^ 2 + rob(n).mem(refveldx) ^ 2) ' how fast is this robot
moving compared to me?
rob(n).mem(713) = rob(o).mem(827) 'refpoison. current value of poison. not poison commands
rob(n).mem(714) = rob(o).mem(825) 'refvenom (as with poison)
rob(n).mem(715) = rob(o).kills 'refkills
If rob(o).Multibot = True Then
rob(n).mem(refmulti) = 1
Else
rob(n).mem(refmulti) = 0
End If
If rob(n).mem(474) > 0 And rob(n).mem(474) <= 1000 Then 'readmem and memloc couple used to read a
specified memory location of the target robot
rob(n).mem(473) = rob(o).mem(rob(n).mem(474))
'rob(n).mem(474) = 0
End If
If rob(o).Fixed Then 'reffixed. Tells if a viewed robot is fixed by .fixpos.
rob(n).mem(477) = 1
Else
rob(n).mem(477) = 0
End If
rob(n).mem(825) = rob(n).venom
rob(n).mem(827) = rob(n).poison
End Sub
There, fix should be self evident (unless you're color blind ;))