I am getting weird results when I use CamerPick to select a dice from my new game awriting.
I get different values when I select while running the program in the interpreter than when I do after the program has compiled. Code is as follows... I didn't write it... I modified the code in the dungeontrigger code a lot.
While Not KeyDown( 1 )
;=-=-=-=-=-=-=-=-=-=-=-=-=> SETS UP MOUSE PICK
x=MouseX()
y=MouseY()
e=CameraPick(camera,x,y)
If e<>entity#
If entity Then EntityColor entity,255,255,255
entity#=e
EndIf
; =-=-=-=-=-=-=-=-=-=-=-=> COLORS MOUSE PICK
If entity#
EntityColor entity,255,220,60 ; COLOR=Golden Yellow
selected=entity ; Did this to show what the computer thought the address was
If MouseDown(1) ; push L/mousebutton and get the number showing on the die
Select entity
Case die1 numb=dice1
Case die2 numb=dice2
Case die3 numb=dice3
Case die4 numb=dice4
Default numb=0
End Select
EndIf
EndIf
; =-=-=-=-=-=-=-=-=-=-=-=-> When you hit the SPACEBAR make a new set of dice totals
If KeyDown ( 57 ) =True Then dice1=Rand(5)+1 : dice2=Rand(5)+1 : dice3=Rand(5)+1 : dice4=Rand(5)+1
Now the default numbers are already selected going in so that is not the problem.
The selected objects are a set of dice I created as .X files and I rotate to show what number has been rolled.
Irreguardless of the number rolled the same reference appears for the dice.
When the program is running in the interpreter I get a 8 digit number.
After the program has compiled and run I get a 7 digit number with no apparent rference to the 8 digit number.
|