More Noob Questions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

More Noob Questions

Post by LemonMan »

I'm very new to Irrlicht and think that it's an awesome project.
I have some questions about how to do things in a First Person Shooter type game.

How would I setup a health/armor bar/percentage counter?
How would I setup a HUD? Weapon and ammo. Put a picture of the current weapon in the HUD.
How would I make it so that when you press escape it brings up a menu?
How would I make a menu? With mission info, options, and exit buttons.
How would I make a mirror (like a bathroom mirror?)

I have been modifying the code from the Tutorials, Mainly the "Collision" tutorial, if anyone has any examples of how to do these things...

Please and Thankyou! :)
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
JonLT
Posts: 152
Joined: Thu Mar 15, 2007 5:47 pm
Location: Denmark

Post by JonLT »

thats really a lot of different things.
For the health/ammo and stuff i guess you should use the irrlicht gui.
The weapon could be a mesh locked in front of the camera as a child (or with bones? ).
For the menu, you'd need an event receiver to get the input and a gui to draw the menu.
A mirror is rather complicated, something with render to texture i guess.

I've seen all the things explained in this forum, so you just need to do some searching.

good luck! :)
Tocs1001
Posts: 10
Joined: Tue Jun 27, 2006 7:15 pm

Post by Tocs1001 »

Huds and health bars are considered GUI which can be really really really ...really... (did I mention really) annoying. Irrlicht has gui built into it but its not custom to the game its got a generic look. you can put 2D Images on the screen. So just combine a bunch of images positioned right to look like your hud. Stretch the image of the health bar to be a gage.

equation as follows...

WidthOfHealthBar = (Health/MaxHealth)*MaxWidthOfHealthBar;


As for reflections. I forget where the post was but some guy made a cool reflective water, you could borrow the shader and stick it on a flat surface and call it a mirror
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

Post by LemonMan »

I tryed doing some gui stuff like text but could NOT do it...
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

There is a GUI tutorial... modify that.
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

Post by LemonMan »

OHHHH!

You have to draw the gui...

lol

Another question how do you make the text bigger? I can barely see it right now. And is it easy to use a different font?

Also, with the gui some of the peramaters of some commands are extremely wierd. Do you just get used to them after a while?
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
Masterhawk
Posts: 299
Joined: Mon Nov 27, 2006 6:52 pm
Location: GERMANY
Contact:

Post by Masterhawk »

Perhaps you schould use the IrrFontTool for that....just create a larger fontset...
the IrrFontTool is also delivered with the SDK.....
Image
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

the 2d graphics tutorial I believe shows how to change the font.
Can you give an example of a wierd parameter?
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

Post by LemonMan »

Not just with the gui but wenever you do some thing like addCubeScenenode

You have to put in stuff like <s32> and L before text and stuff that I don't understand...[/code]
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
LLDD
Posts: 43
Joined: Fri May 11, 2007 9:50 am

Post by LLDD »

LemonMan wrote:Not just with the gui but wenever you do some thing like addCubeScenenode

You have to put in stuff like <s32> and L before text and stuff that I don't understand...[/code]
Those are templates. Google it for further information.
________
IOLITE VAPORIZER REVIEW
Last edited by LLDD on Sun Feb 20, 2011 7:49 am, edited 1 time in total.
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

Post by LemonMan »

How do you print a variable to the screen?
Like if I was trying to make a health counter.

I tryed this but it didn't work...
addStaticText(L"Health:" health)
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

LemonMan wrote:How do you print a variable to the screen?
Like if I was trying to make a health counter.

I tryed this but it didn't work...
addStaticText(L"Health:" health)
You need to make a wchar_t and put that in there instead of "L"Health:" health".

You should also use setText or whatever it is, because if you addStaticText its just going to leave the old text and add new text on top every frame.
LemonMan
Posts: 16
Joined: Sat May 26, 2007 4:49 pm
Location: Duluth, Minnesota, U.S.A.
Contact:

Post by LemonMan »

What's a wchar_t and how would I use it?
GO HERE NOW! please? :)
My friends website - http://www.ecoblues.net/joomla/

My website - http://www.harborcityschool.net/~pjewell
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

its a variable type, just like int, float, or char.
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

Hey I think a tutorial section will be coming to my website soon on basic C++ coding :D
Programming Blog: http://www.uberwolf.com
Post Reply