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 / Boolean code screwy?

Author
Message
Mugen Wizardry
User Banned
Posted: 26th Jan 2011 19:38 Edited at: 26th Jan 2011 19:39
Hi all. I'm having a bit of a problem fixing selecting and unselecting a 3D object.

i have it to where u can click the background to unselect it, but when u click ON the object itself AFTER the object is selected, it WON'T unselect.

Here's what I have:




yes i've already tried putting them in text form to see if they were working. they aren't.

btw. i is <= to the amount of objects currently on the screen. _picked is the object to be selected. _oldpicked is the object that has already been selected.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 26th Jan 2011 21:05
Wrote this pretty quick to give you an idea:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 27th Jan 2011 03:44
Sasuke - Nice piece of code!
I will have to play with it, learn from it, and use it in something
Thanks
Mugen Wizardry
User Banned
Posted: 27th Jan 2011 05:17
Thanks alot Sasuke! Is there any way I can make it so when I click on an object for the second time, it will turn off wireframe and highlighting?

Thanks!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jan 2011 12:18
Here's another way of using pick object:



That snippet allows you to independently select or unselect each individual object by clicking.
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 27th Jan 2011 14:01
Here's how to do what you asked on my bit of code, although I think the code can be improved, more efficient:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 27th Jan 2011 17:46
Thanks guys!

Thanks Sasuke! This is PERFECT!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 28th Jan 2011 23:18
Hi guys. I found a SMALL glitch where if you have too many objects and you click on some of them, then mouse over them, the object bounds seems to stay on a few of them.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 28th Jan 2011 23:41
Well I just tried 2000 objects with that bit of code I post and couldn't reproduce the issue. Can you show us a bit of the code your using unless it's the same?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 28th Jan 2011 23:57


CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 29th Jan 2011 00:13
0xFFFFF is pretty high isn't it. That's more than a millon, that could be the issue, though I don't see why it would be.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 29th Jan 2011 06:27
well the thing is. i CAN show u the real code, but its part of my level editor. so chances are u wont know what the BLEEEEEEEEEEEP im talking about. lol

but here's the code:



Here's what I call when the user either holds control and presses C,X or V. which will either Copy (C), Cut (X), or Paste (V), the object to another area, copy it to paste to another area, or cut the object out of the scene.

When I make a copy of an object a few times, SOMETIMES the bounds stays on it.

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 29th Jan 2011 14:13
Anyone? :/

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 00:02
Sasuke, can you help?

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 30th Jan 2011 04:15
Sorry for the delay, my nets on the fritz. As of your issue, I can't seem to replicate it, meaning I have to guess. I wonder if it's an order issue, try this instead:



A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Mugen Wizardry
User Banned
Posted: 30th Jan 2011 17:48
Thanks Sasuke! Works like a charm man!

CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!

Login to post a reply

Server time is: 2026-07-19 01:26:31
Your offset time is: 2026-07-19 01:26:31