Beitrags-Archiv für die Kategory 'Museum Project'

Daily Report #4 - Museum Project

Thursday, 17. April 2008 10:33

“I did it!” as Hiro Nakamura from Heroes would say.

I finally managed to create the import GUI with the help of Thomas Bang
Before i had many ideas how to display the current folder and browse through it. It also worked very well but there were always some bugs that couldn’t be change without the use of another DLL function. So i wanted to ask Thomas Bang to write a new function, but in the same moment, he sent me a link to an interesting article about API Save and Open Dialogs for Torque Game Builder (the 2D Engine). Fortunately, it also works with TGE and TGEA.

So now the user can click “Import texture” and browse through all of his folders, choose a file and click “Open”. It delivers a string with the full path to the file.
Then i can manipulate the string a bit to use Thomas Bang’s SaveFileTo function to copy the new file to the folder where the frame is located, rename the file and list it in the texture gui.

As mentioned before, i had a problem displaying imported file cause the engines Resource Manager must refresh before you see the file. There is a small trick to do this:

Refresh Resource Manager

setModPath(getModPath());

This will re-check the folders of the current game and implement new file.

So the texturing Part is done now. I’m really happy about it and can now go on with manipulating the frame model ingame (make it bigger, smaller, change the ration, etc).

See ya next time, and don’t forget - Save the Cheerleader, save the world!

Thema: Museum Project, Torque | Kommentare (0) | Autor: $Kiyaku

Daily Report #3 - Museum Project

Tuesday, 15. April 2008 9:11

Just a note: “Daily” doesn’t mean i write this EVERY DAY, but every day i worked on the game!

So in my last post i mentioned the missing “Directory List” object and that i will write my own directory viewer then.
Well it’s kinda hard to do so but it’s getting better and better. I can browse the previous folders and look for the files inside. But there are still some problems.

  1. I don’t know how to display the current folders, i only can list the files yet
  2. When i browse back a folder, the function that reads the existing files in the current folder also browse the subfolders and displays the files. I don’t know how to control this (yet)

Beside this, i installed the import function. When selected a file in the import GUI, i can click the import Button and copy the file to the right folder (and even rename it). But of course there is also a problem - the engine doesn’t realize that there is a new bitmap in the folder. I first have to restart the engine to see the file displayed in my skin list. I probably have to reset some value or re-read the folders. Somehow i think the function “setModPath” has to do something with it.

That’s all for today actually. I got a bit busy with my real work and by watching my new favorite show “Heroes”.

Thema: Museum Project, Torque | Kommentare (0) | Autor: $Kiyaku

Daily Report #2 - Museum Project

Friday, 11. April 2008 23:14

Okay time for my second daily report.

Lets see the ToDo list from yesterday first:

- Creating a loading GUI to add files to the object folder
- When loading a new image, the materials.cs must be updated. I need a script that will do that for me.

Well actually i only finished one task from the list.

I couldn’t get to work the GUI yet cause there is an engine bug in the new Torque Game Engine Advanced 1.7 Version.
When i want to place an Directory View Object (that displays the folders at the current position), the engine will just crash.
So i actually have to write my own Viewer which is kinda lots of work but i’m doing well so far.

The second task is done. Now, if i import a new file (via console since the GUI isn’t done), the materials.cs file will be rewrite to be able to use the new texture.

BUT i finished more stuff!

  1. I coded a preview Window which displays the selected image from the list
  2. The ratio of the image preview is fit to the ratio of the selected image, but always stays at a max width or height of 200. Even if the image is 23 x 64 pixels big, it will be scaled up so one size is 200 pixels big
  3. You can see the Pixel size of the current selected image in the Image Browser
  4. Added buttons for the Import Gui

It was kinda hard to get this work without the knowledge of C++. I’m glad i know Thomas Bang, who is a great DLL writer and wrote 1 plugin in Delphi which includes 3 function:

  1. A function to copy a file from one folder to another one. I need this to let the “player” browse for his image on his HDD and copy it to the gamefolder and even rename the file.
  2. A function to create folders. If a user creates a new “Player”, a new folder with it’s name will be created to store all his files (images, galleries, etc).
  3. A function to read the resolution of an image. I need this to rescale the image preview and later on to scale the pictureframe to it’s picture ratio.

Thanks again to him, i really appreciate this efford.

So that’s for today, i’m super tired again and will go to bed now. See ya next time!

Thema: Museum Project, Torque | Kommentare (0) | Autor: $Kiyaku

Daily Report #1 - Museum Project

Thursday, 10. April 2008 23:56

All right guys, girls and whatever is running around there.
Today i finished several things on the museum project.

First i got some bugs with the GUI for changing the images. Everytime i closed the GUI, the player couldn’t move anymore. So i had to reopen it again to go on moving. This is fixed now and works like a charm :D

Second i changed the script to get access to the image GUI. Before, you could press a key or a button on screen and the image gui will open. To look around, you had to hold right mouse key. Now you just can walk around like a normal 1st Person Shooter game. When you are close to an object that is retextureable ™, you press the action key (”e”) and the image gui will open. You can’t change the cam rotation when entering the image gui but you also don’t have to, cause you want to place the image anyway.
If you placed your image, you can just click it off and go on moving, or away from the object and the image editor will close.

Third i added a button to delete the skin and get the base skin back to the object.

Fourth before the images where displayed in the GUI list with it’s full file path. Now they are only displayed with their filename.
Image GUI

 
Yeah i think that was everything yet. The bug mentioned first took lot of time but im glad it’s solved.
So what’s to do for tomorrow?

- Creating a loading GUI to add files to the object folder
- When loading a new image, the materials.cs must be updated. I need a script that will do that for me.

That’s it. Sounds kinda small but i think the loading gui will take a lot of time. If i should finish everything soon enough, i will already go on with next tasks.

That’s it, i’m super tired right now and will go offline now.

Canvas.popDialog($Kiyaku);

Thema: Museum Project, Torque | Kommentare (0) | Autor: $Kiyaku

Current Project: Virtual Museum

Thursday, 10. April 2008 18:36

Heya,
just want to write some words about my current project.

To learn torque, Frank Geppert from Dexsoft-Games and i are creating a virtual museum. You will be able to run around in different themes and place your own images on your virtual picture frames, add a text to the frame and adjust the size of it.

When i first was thinking about methods to create this project (code based), it sounded quite easy to manage. To my surprise, it was easier than i thought.

Until now i can say that 60% of the base code are done. I can move around, place frames, open a GUI with a list of available pictures and draw them on my frames. The list for the pictures is generated automatically by searching the folders for the necessary files.

The skin system for the frames is also quite easy. You just have to give the different skins a special name. Just let me give you an example.

Imagine you have your frame model called “frame.dts”. Then you have to assign a texture to the model which is called “base.frame.png”. The other skins you want to apply to your frame can have any name you want plus the “frame.png” at the end. So you can create images like “skin0.frame.png”, “skin1.frame.png”, “anotherpic.frame.png” and so on. The engine will recognize the “frame.png” and assign it to the “frame.dts” file.

To actually change the skin now, you use the function “%obj.setSkinName(’skinname_without_frame.png’);” and that’s it! If you want to apply skin1 to the model, you would write “%obj.setSkinName(skin1);” and the skin will be changed.

So to make the engine recognize the textures, you need to create a “materials.cs” file in the same folder. Just define the texture inside and you are done!

materials.cs

new Material(base_frame)
{
   baseTex[0] = "base.frame";
};

new Material(skin0_frame)
{
   baseTex[0] = "skin0.frame;
};

new Material(skin1_frame)
{
   baseTex[0] = "skin1.frame";
};

Easy, isn’t it?

So to display all available skin for the frame, i search for “./*.frame.png”. It will list all images that ends with “.frame.png” in the GUI i created.

If i have something visually to show, i will post some shots of course.

See ya next time!

Thema: Museum Project, Torque | Kommentare (1) | Autor: $Kiyaku