Game Development Community

Levelshot (Click map name in list-->Show small image)

by Chris Byars · in Torque Game Engine · 03/28/2005 (6:49 am) · 11 replies

Heh. One thing that's been troubling my GUI is, getting it so when I click on one of the map names in the create game list, to have a small 128x128 or so image appear to give you a "levelshot" of the map you wish to load, so you can see if that's the one you wish to load up.

Any suggestions? Besides saying to simply look into the code deeper. If I could've found it by that, I'd've already. =P

Thanks.

#1
03/28/2005 (7:31 am)
When the start-game dialog searches for missions to display, it actually opens each one and reads the title/description from the .mis file's missioninfo scriptobject.

You could add a preview image field to the missioninfo object and read it at the same time you read the name/description. Then, when the user chooses the map from the list, set a bitmap control to display that image. You'd have to manually take the screenshots place them in a folder, and set up the preview field, but that's probably not a very big deal.
#2
03/28/2005 (7:43 am)
Interesting, I'll take a look into it.
#3
03/28/2005 (8:28 am)
Could you explain technically how I would set this as you said? =)
#4
03/28/2005 (2:26 pm)
I know its been done in Realm Wars, and maybe a few other Torque based games, someone's gotta know exactly how it is structured.
#5
03/29/2005 (4:05 pm)
Sorry dude, I forgot to turn on "Notify me" for this thread.

Ok, Here's a pretty quick solution to this...

EDIT: link removed, see below for link to the resource

Grab that, there's two files in there. Copy stronghold.mis.png into your missions folder, and copy the startMissionGui.gui script into starter.fps/client/ui (back up the old one first)

This is really quick and dirty, but maybe it'll give you some ideas. Basically, it just looks for a preview image that has the same name as the mission file (with .png on the end) and displays it. (If there isn't an image avaliable it just shows a empty rectanagle)

Note that this was meant to go with the starter.fps kit, if you don't have a stronghold.mis it won't work. You'll also need to provide your own level screenshots for each level.

Like I said, this is really ugly, but it works and it's a start.
#6
03/29/2005 (4:19 pm)
I <3 you. lol

But seriously, I appreciate that, a lot. =)
#7
04/03/2005 (9:38 am)
Hey Drew,

Do you know how to add the mission description with the preview pic?

Thanks in advance.

Joseph.
#8
04/03/2005 (4:54 pm)
Joseph, I updated the zip file I linked above, just grab it again.

It hasn't been tested very well. There will be some strange behavior if a mission doesn't have a MissionInfo. (it probably won't display anything)

Anyway, check it out, I'm sure you'll be able to customize or finish this if you read through the functions at the end of the gui file. One improvement that you could make is to store the preview image's filename in the MissionInfo.

EDIT: Ok, now it's working, go ahead and grab it.
#9
04/05/2005 (1:22 am)
Should post as a resource, pretty useful start.
#10
04/23/2005 (10:59 pm)
I was bored tonight, so I cleaned this up and made it into a nice resource.

I'm writing the instructions right now, I'll post a link once i'm done with it.

EDIT: The zip posted above is pretty much the same thing functionality-wise, but the new version is a little more fault tolerant.

EDIT2: It's up but awaiting approval.