Ok, so I've been working on the OpenFPS level editor, and I'm at the point where I want to have the user be able to select any object in the current level and then be able to move, scale and rotate that object as well as modify other options. I was thinking of using
pick object for this task, because the editor has two modes: "Edit Mode", and "Camera Mode" which can be activated by hitting the E key. When the user is in Edit Mode, I want them to be able to use the mouse to click on objects and select them. This is where I am having trouble.
sync on
sync rate 60
make object cube 1,10
do
me=pick object(mousex(),mousey(),1,3)
if me>0 then yrotate object me,object angle y(me)+1
center text 320,240,"OBJECT SELECTED:"+str$(me)
sync
loop
This little bit of code works normally, causing the object to rotate when the mouse is over it, which is a good example of pick object() being used properly.
Now, when I put in this code into the editor, it has different results: In fact, no results whatsoever! When the code should output object number 6, it always outputs 0, the default.
The code in the editor is this:
me=pick object(mousex(),mousey(),2,502)
text 200,200,"Object:"+str$(me)
if me>2 then yrotate object me,object angle y(me)+1
The only different between this and the first snippet is that the object start and end values are changed in order to avoid selecting the terrain object. This is how it looks in the editor:

(Since the cursor didn't show up I've taken the liberty of adding it in for you)
Now, I have no idea why this code is not working, my only theories were that maybe BlitzTerrain or BlueGUI are interfering with the pick object command. I don't use
set camera viewport or change the field of view, so I really have no idea what is going on. I have tried using alternate methods, and none of them are as accurate or bug free as
pick object.
If that code isn't enough, the full source is online at
http://openfps.googlecode.com/svn/trunk/openfps/editor//
Thanks in advance, Chris aka thenerd