discussion about presentations, sniper zoom, helmet cam, etc...

Users who are viewing this thread

HokieBT

Grandmaster Knight
M&BWB
ok, we managed to get a zoom key working, see this post for more info
http://forums.taleworlds.com/index.php/topic,68192.msg1815186.html#msg1815186

Now, I want to put a picture overlay on the screen.  For example a sniper scope or narrow your field of view like you are looking through binoculars or your helmet blocks your field of vision.

I tried doing the following:
1) made a 2d mesh that takes up the entire screen
2) added a texture that was a solid on the outside, but transparent in the middle (added shaders on the material to support this)
3) called the following presentation when I press a key

Code:
("binocular_display", 0, mesh_load_window, [
	(ti_on_presentation_load,
		[
		(presentation_set_duration, 999999),
        (create_mesh_overlay, reg1, "mesh_binocular_display"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),	
		]),
	(ti_on_presentation_event_state_change,
		[
		#(presentation_set_duration, 0),
		]),
	(ti_on_presentation_run,
       		[
			(try_begin),
				#(this_or_next|key_clicked, key_escape),
		        #(this_or_next|key_clicked, key_tab),
				#(this_or_next|key_clicked, key_b),
				(le, "$binocular_magnification", 0),
		        (presentation_set_duration, 0),
	        (try_end),
        	]),	
]),

However, when I do this, the picture displays, but the normal M&B background (ie. bg2.dds) just displays through in the middle of the transparent area, not the scene itself....  When I turn the presentation off the normal MB background is still visible...  Is it possible to disable that background from appearing?

Is there an easier way to do this?  How would I add the code to display a new shield or health status bar?


edit:  nevermind, looks like I need to remove mesh_load_window from the presentations background mesh....  I'll test it later, but would be curious to see any other code people have used to add additonal status bars or other information to the battle screens.

 

jik

Knight
I haven't done this kind of thing yet, but I would look at the battle map info thingie presentation when you press the backspace key.  I saw it there before, actually I just looked it's called battle.  Check that out and compare there.  That one overlays on the screen, with a bit of transparency. 
 

Slawomir of Aaarrghh

Grandmaster Knight
M&BWBWF&SNWVC
("binocular_display", 0, mesh_load_window,

Thats why normal M&B background shows. Change it to "0".

edit: ahh, sorry, I didn't see the edit. :wink:

edit: HokieBT, let me if your presentation works fine with mesh overlay on the whole screen. I tried the same thing long time ago, when I wanted to make a first person look from a helmet, but I had an issue with M&B arrow cursor being showed (cause it shouldn't be visible).
 

HokieBT

Grandmaster Knight
M&BWB
np, thanks for confirming that is the issue, I'll try it out later tonight and post a screenshot.  :smile:

I just wish there was more information on presentations, they are really powerful but not too many people seem to know how to use them.  MartinF did some cool stuff in the star wars mod using presentations for a ship purchasing system, but there are some issues, and he's gone for a few months and I have no clue how to fix it.  :???:  I'm slowly starting to understand it as I play around, so maybe we'll eventually be able to hack together a guide for pictures, buttons, text, checkbox's, etc...  There are a lot of potential uses, and the dialog system I saw in the With Fire and Sword screenshot below looks really cool, so I hope to understand this better in the future.

 

HokieBT

Grandmaster Knight
M&BWB
ok, I managed to get this working, it looks pretty damn cool.  The aiming crosshairs are still visible if you have a gun equipped and the sniper scope concept doesn't seem to work great, but binoculars are very cool.

       
 

jik

Knight
If you are looking to do a write up on presentation stuff, can I add it to the tutorial update?  I have nothing on presentations...
 

HokieBT

Grandmaster Knight
M&BWB
I barely got this thing working, and really don't understand it much at all, but if I get a little better using it I'll try and type up something.
 

HokieBT

Grandmaster Knight
M&BWB
well, a helmet cam was surprisingly easy, no wonder why stormtroopers aim is so bad, you can't see anything in this!!!  :wink:

   

besides being very difficult to see, there are only two main issues:
    1)  I can't seem to stack mesh's on top of one another, so the aiming dots pass through the helmet
    2)  I don't know how to tell in the code if the player is in first-person mode, so right now I have it as a toggle switch, but you can still use it in 3rd person which is weird....

I may make the eye-holes much bigger so they take up the majority of the screen, since otherwise it would be almost impossible to play, but overall this is a very cool concept.
 
HokieBT said:
well, a helmet cam was surprisingly easy, no wonder why stormtroopers aim is so bad, you can't see anything in this!!!  :wink:

   

besides being very difficult to see, there are only two main issues:
    1)  I can't seem to stack mesh's on top of one another, so the aiming dots pass through the helmet
    2)  I don't know how to tell in the code if the player is in first-person mode, so right now I have it as a toggle switch, but you can still use it in 3rd person which is weird....

I may make the eye-holes much bigger so they take up the majority of the screen, since otherwise it would be almost impossible to play, but overall this is a very cool concept.

well, binocular vision allows us to merge images, can that be brought into consideration a bit,.

oh, is it possible to merge this with the custom commander kit and allow players to set waypoints using thew binoculars, and that form only works with binoculars equipped.
 

HokieBT

Grandmaster Knight
M&BWB
binocular vision has the same issue, the aiming dots show through and the health bar appears in the bottom right, etc.    Its on my to-do list to integrate custom commander but I haven't had a chance yet.  The most movement is a little jerky on the binocular vision, so I probably won't force people to use that tho.
 

HokieBT

Grandmaster Knight
M&BWB
Happy Stormtrooper helped me with the graphic a bit (still a work in progress).  I also fixed the issue with the mesh overlay blocking each other (higher render order on the material tab), so the health bar and aiming circles look fine now.

     
 

foxyman

Sergeant Knight
M&BWB
    I'm not so familiar about presentation. I just want to know, how do you keep the normal control while showing the presentation? As I know, calling presentation in mission template like order panel just blocks mouse control of the character. But yours seems fine about that, what's the trick here?
 

HokieBT

Grandmaster Knight
M&BWB
foxyman said:
    I'm not so familiar about presentation. I just want to know, how do you keep the normal control while showing the presentation? As I know, calling presentation in mission template like order panel just blocks mouse control of the character. But yours seems fine about that, what's the trick here?
That was a little tricky to figure out, you have to use prsntf_read_only and then you have full control

Code:
("helmet_view", prsntf_read_only, 0, [		#must use prsntf_read_only or you cannot attack
	(ti_on_presentation_load,

also briefly tried out a mandalorian helmet, so now when you switch helmets the view changes, etc...

   
 

HokieBT

Grandmaster Knight
M&BWB
this concept also made me realize it would be very easy to remove the health bar, and just have the screen gradually grow more red or have blood spots like what happens with some video games...  I'm not sure I'll bother with that in my star wars mod, but there are a lot of possible options.
 

foxyman

Sergeant Knight
M&BWB
Well that just interests me! Could you go more into details? Like if you could remove the aiming crosshairs and the ammo display?
 
Top Bottom