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
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.
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.