Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Pick Object Problem

Author
Message
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 19th Oct 2010 00:44 Edited at: 19th Oct 2010 01:12
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.


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:


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

General Jackson
User Banned
Posted: 19th Oct 2010 01:17
What code are you using to import models?

French gui
22
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 19th Oct 2010 01:21
set camera range 1,1000000000
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 19th Oct 2010 01:24 Edited at: 19th Oct 2010 01:28
This, mind you it's just temporary:

However, that cube is created separate from the regular entity system, it was just a test created with make object cube 6,20, so the number returned should be 6.

[edit] French gui, our posts crossed, but ya...I did go a bit overboard with the camera range...

French gui
22
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 19th Oct 2010 01:31
I mean , it's screwing your pick object command...
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 19th Oct 2010 01:33 Edited at: 19th Oct 2010 02:24
Ohhhh... Oh cool it worked, thanks
...I always seem to overlook the simplest things.

Thanks!

Login to post a reply

Server time is: 2026-07-22 03:51:34
Your offset time is: 2026-07-22 03:51:34