Current Selection Function for game and editor?

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Current Selection Function for game and editor?

Post by MadPumpkin »

So I'm working on my level editor now that I'm back. I've come across a problem that has been itching my brain, I need your guys' help to scratch it. I came across this problem in the past and gave up with it and did something else. However, I've become a much better programmer with all of your help and other sources, and now realize one way that seems logical to go about it.

I need some sort of function that will return what objects are selected in my level editor, so that I can alter the desired object. When you click on an object it will load all of the "current object"-'s data and allow you to change it in the 'Objects' window. Now, previously I was a lot more like, (immature 13 year old talk) "Hey guys HAHAHA give me cod3s too make my program work for me HAHA since I don't know how!!". So in the long run I never actually solved my problem. SOO... Now... Maybe some feedback on this theory and SUGGESTIONS on better directions would be greatly appreciated.

Give each object class a boolean value that changes depending on if the object is selected. Depending on this value, preform tasks such as, show a collision box, add it to the group of editable objects, highlight it in someway to show that it's selected.

Any help would be great :D.

Pepper out.
Last edited by MadPumpkin on Sun Mar 06, 2011 1:40 pm, edited 1 time in total.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
thejahooli
Chaos Rift Junior
Chaos Rift Junior
Posts: 265
Joined: Fri Feb 20, 2009 7:45 pm
Location: London, England

Re: Current Selection Function for game and editor?

Post by thejahooli »

I'm not entirely sure on the implementation you are looking for, but couldn't you just have your objects inheriting from a base object class and then have a pointer (or vector of pointers for multiple selection) to a base object which you then assign to whatever object you select.
I'll make your software hardware.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Current Selection Function for game and editor?

Post by dandymcgee »

Was there a question in there somewhere? I'm kinda confused as to what you're asking, it seems like your idea would work fine.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
ParticleGames
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 53
Joined: Sat Feb 19, 2011 1:20 pm
Current Project: A map editor for a platformer I plan to develop
Favorite Gaming Platforms: Wii, Gamecube
Programming Language of Choice: C++

Re: Current Selection Function for game and editor?

Post by ParticleGames »

Are you asking for advice on your idea? I think it's a good plan.
Check out my iPhone app here: http://twilighthop.com
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: Current Selection Function for game and editor?

Post by MadPumpkin »

sorry I worded it terribly,I went ahead and bolded the part that I kind of was wondering about. The rest of it is just my idea of how to do it. If that's a good idea, I'll just implement that one till I think of something better. I like Ginto's idea though, which is what I'm doing right now but a tid bit different.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
xiphirx
Chaos Rift Junior
Chaos Rift Junior
Posts: 324
Joined: Mon Mar 22, 2010 3:15 pm
Current Project: ******** (Unkown for the time being)
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Current Selection Function for game and editor?

Post by xiphirx »

How about you make the whole editor a class, and store a pointer to a base object that is selected?
StarCraft II Zerg Strategy, open to all levels of players!

Looking for paid work :< Contact me if you are interested in creating a website, need a web design, or anything else you think I'm capable of :)
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

[SOLVED]Current Selection Function for game and editor?

Post by MadPumpkin »

xiphirx wrote:How about you make the whole editor a class, and store a pointer to a base object that is selected?
Actually I'm done implementing my way of doing it. It's a pointer to a base object. But instead I used a vector of objects so that you can select anywhere from 1-75 objects at a time. I have the cap as 75 even though I doubt you would ever need that many in this editor.

EDIT: Also good suggestion but that would be a pain in the ass because most of the editor is multiple windows and I already have it set up one way, even the OpenGL rendering window is separate.
PS, I like your avatar image, looks sweet.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Current Selection Function for game and editor?

Post by Falco Girgis »

First of all, what are you even making your Editor with?

Frameworks like QT and wXWidgets have this built in. Is this a from-scratch Editor with nothing but a graphics API like SDL or OpenGL, or are you using a GUI framework?
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 484
Joined: Fri Feb 13, 2009 4:48 pm
Current Project: Octopia
Favorite Gaming Platforms: PS1-3, Genesis, Dreamcast, SNES, PC
Programming Language of Choice: C/++,Java,Py,LUA,XML
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: Current Selection Function for game and editor?

Post by MadPumpkin »

GyroVorbis wrote:First of all, what are you even making your Editor with?

Frameworks like QT and wXWidgets have this built in. Is this a from-scratch Editor with nothing but a graphics API like SDL or OpenGL, or are you using a GUI framework?
It's using Windows API and GL/GLU
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
Post Reply