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

Users who are viewing this thread

Hehe, I went on holiday, I come back and I see that you did what I was working on. I had everything done, except the presentations which I didn't understand at all. Mind if I 'steal' your presentation code a bit?
 
I have a small problem here with mission_templates. Click the link to see my build_module errors.
I have tried to fix it myself, but with no succes.


Nvm fixed it.


 
Hmm. I could use a little help with this. So basically I did everything that was needed to be done. Not sure did I do it right obviously since It ain't working. So, I made a 2d model, made a texture to it which was whole black, expect the middle, which was transparent. But when I applied it to the model, it was whole black, no transparent circle. Then made the brf file with open brf, not sure about the settings. But I used no fog, blend and rend order 8 and simple shader. Added the codes

module meshes
Code:
("scope", 0, "scope", 0, 0, 0, 0, 0, 0, 1, 1, 1),

module presentations. Before the last bracket
Code:
          (try_end),
        (try_end),
        ]),
     ]),
("zoom_view", prsntf_read_only, 0, [      #must use prsntf_read_only or you cannot attack
   (ti_on_presentation_load,
      [
      (presentation_set_duration, 999999),
      
      (assign, ":view", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_wielded_item, ":item_handone", ":player_agent", 0),
      #(agent_get_wielded_item, ":item_handtwo", ":player_agent", 1),
      (try_begin),
         (eq, ":item_handone", -1),
         (assign, ":view", 1),   #use binoculars
      (else_try),
         #(ge, ":item_handone", 0),
         (item_get_type, ":item_type_handone", ":item_handone"),
         (try_begin),
            (this_or_next|eq, ":item_type_handone", itp_type_one_handed_wpn),
            (this_or_next|eq, ":item_type_handone", itp_type_two_handed_wpn),
            (this_or_next|eq, ":item_type_handone", itp_type_bow),
            (eq, ":item_type_handone", itp_type_polearm),
            (assign, ":view", 1),   #use binoculars
         (else_try),
            (eq, ":item_type_handone", itp_type_crossbow),
            (assign, ":view", 2),   #use scope
         (else_try),
            (assign, ":view", 0),   #pistol, other, don't do anything
         (try_end),
      (try_end),

      (try_begin),
         (eq, ":view", 1),
         (create_mesh_overlay, reg1, "mesh_scope"),
         (position_set_x, pos1, 0),
         (position_set_y, pos1, 0),
         (overlay_set_position, reg1, pos1),   
      (else_try),
         (eq, ":view", 2),
         (create_mesh_overlay, reg1, "mesh_scope"),
         (position_set_x, pos1, 0),
         (position_set_y, pos1, 0),
         (overlay_set_position, reg1, pos1),         
      (try_end),
      
      ]),
   (ti_on_presentation_run,
             [
         (neg|game_key_is_down,gk_zoom),
         #(assign, "$zoom_view", 0),
         (presentation_set_duration, 0),
           ]),   
]),
  ]

Module mission templates

Code:
common_zoom_view = (0, 0, 0, [
   (game_key_is_down, gk_zoom)
 ],
 [
   (get_player_agent_no, ":player_agent"),
   (agent_is_alive, ":player_agent"),
   (start_presentation, "prsnt_zoom_view"),
])
Tried this in mp, didn't work. I tried adding multiplayer is server on top off get_player_agent_no but I got errors while testing it. Any help? Trying to implent this to mp.

 
Hmm. I could use a little help with this. So basically I did everything that was needed to be done. Not sure did I do it right obviously since It ain't working. So, I made a 2d model, made a texture to it which was whole black, expect the middle, which was transparent. But when I applied it to the model, it was whole black, no transparent circle. Then made the brf file with open brf, not sure about the settings. But I used no fog, blend and rend order 8 and simple shader. Added the codes

module meshes
Code:
("scope", 0, "scope", 0, 0, 0, 0, 0, 0, 1, 1, 1),

module presentations. Before the last bracket
Code:
          (try_end),
        (try_end),
        ]),
     ]),
("zoom_view", prsntf_read_only, 0, [      #must use prsntf_read_only or you cannot attack
   (ti_on_presentation_load,
      [
      (presentation_set_duration, 999999),
     
      (assign, ":view", 0),
      (get_player_agent_no, ":player_agent"),
      (agent_get_wielded_item, ":item_handone", ":player_agent", 0),
      #(agent_get_wielded_item, ":item_handtwo", ":player_agent", 1),
      (try_begin),
         (eq, ":item_handone", -1),
         (assign, ":view", 1),   #use binoculars
      (else_try),
         #(ge, ":item_handone", 0),
         (item_get_type, ":item_type_handone", ":item_handone"),
         (try_begin),
            (this_or_next|eq, ":item_type_handone", itp_type_one_handed_wpn),
            (this_or_next|eq, ":item_type_handone", itp_type_two_handed_wpn),
            (this_or_next|eq, ":item_type_handone", itp_type_bow),
            (eq, ":item_type_handone", itp_type_polearm),
            (assign, ":view", 1),   #use binoculars
         (else_try),
            (eq, ":item_type_handone", itp_type_crossbow),
            (assign, ":view", 2),   #use scope
         (else_try),
            (assign, ":view", 0),   #pistol, other, don't do anything
         (try_end),
      (try_end),

      (try_begin),
         (eq, ":view", 1),
         (create_mesh_overlay, reg1, "mesh_scope"),
         (position_set_x, pos1, 0),
         (position_set_y, pos1, 0),
         (overlay_set_position, reg1, pos1),  
      (else_try),
         (eq, ":view", 2),
         (create_mesh_overlay, reg1, "mesh_scope"),
         (position_set_x, pos1, 0),
         (position_set_y, pos1, 0),
         (overlay_set_position, reg1, pos1),        
      (try_end),
     
      ]),
   (ti_on_presentation_run,
             [
         (neg|game_key_is_down,gk_zoom),
         #(assign, "$zoom_view", 0),
         (presentation_set_duration, 0),
           ]),  
]),
  ]

Module mission templates

Code:
common_zoom_view = (0, 0, 0, [
   (game_key_is_down, gk_zoom)
 ],
 [
   (get_player_agent_no, ":player_agent"),
   (agent_is_alive, ":player_agent"),
   (start_presentation, "prsnt_zoom_view"),
])
Tried this in mp, didn't work. I tried adding multiplayer is server on top off get_player_agent_no but I got errors while testing it. Any help? Trying to implent this to mp.
So the problem is to make a correct 2d mesh, no ? I have the same problem
 
A 2D mesh is simply a planar mesh. Look up how some of the UI stuff is getting done, it's all a texture getting drawn upon a flat mesh. You can also look up how other mods like Bear Force or Star Wars Galactic Conquest etc. are doing it. You need to implement it then as a presentation upon a specific condition. Here is a very basic tutorial for presentations:
 
Back
Top Bottom