Coordinates in presentation problem.

Users who are viewing this thread

EmielRegis

Sergeant Knight at Arms
Hello. I playing with presentation and encountered annoying problem. Often even if coordinates for overlays are same, they are placed in different positions.  In code below I commented 2 examples.

Code:
###################################################################################		
	("inventory", prsntf_manual_end_only, 0, [
    (ti_on_presentation_load,
     [(set_fixed_point_multiplier, 1000),
#--------------------------------------------	
	 (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),
      
	  (position_set_x, pos1, 700),
      (position_set_y, pos1, 100),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),
      (position_set_y, pos1, 900),
      (overlay_set_size, ":over1", pos1),
	  
#--------------------------------------------		  
	  
	  (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),
	  
	  
	  
	  (position_set_x, pos1, 20),
      (position_set_y, pos1, 100),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),
      (position_set_y, pos1, 900),
      (overlay_set_size, ":over1", pos1),

	  
#--------------------------------------------		  
	 
      (str_clear, s1),
	  (create_text_overlay, ":over", s1, tf_scrollable_style_2),
      (overlay_set_color, ":over", 0xFFFFFF),
	  (position_set_x, pos1, 700),
      (position_set_y, pos1, 120),
      (overlay_set_position, ":over", pos1),
	  
	  (position_set_x, pos1, 280),
      (position_set_y, pos1, 440),
      (overlay_set_area_size, ":over", pos1),
      #(set_container_overlay, ":over"),
	  
	  
	  
	  
	  
	  
	  
	  
#--------------------------------------------	  
	  #(set_container_overlay, -1),
	  
	  #(str_clear, s1),
	  (create_text_overlay, ":over", "@HELMET", tf_scrollable_style_2),
      (overlay_set_color, ":over", 0xFFFFFF),
	  (position_set_x, pos1, 40),
      (position_set_y, pos1, 560),                                # coordinates same as in button below 
	  (overlay_set_position, ":over", pos1),
	  
	  #(position_set_x, pos1, 100),
      #(position_set_y, pos1, 100),
	  #(overlay_set_size, ":over", pos1),
	  
	 
#--------------------------------------------	



	  (create_button_overlay, ":over", "@Back", 0),
	  (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 720),
      (position_set_y, pos1, 560),                                 # button y value
      (overlay_set_position, ":over", pos1),	


  
	  
     


	   
	  
	  
	  
	  
	  (presentation_set_duration, 999999),
      ]),
    
#-------------------------------------------------------------------   

   (ti_on_presentation_event_state_change,[
		(store_trigger_param_1, ":object"),
		
		
	
	 ]),
#-------------------------------------------------------------------  	
	(ti_on_presentation_run,
     [
      
     
	
	]),
	
	]),
###################################################################################

Here is screen from game. You can see that even if "y" value is same in both overlays "HELMET" is placed about 100 units above.

23lh5q8.jpg

Can someone explain what I did wrong?
 
@Helmet has tf_scrollable_style_2

this flag is used for containers of other objects generally. Could very well be the cause of it.

EDIT: Might as well turn this post in a rather quick presentations tutorial thing:
Generally, a list of similar buttons/objects are stored in containers. In warband presentations, these containers are text_overlays for some reason. See:
Code:
      (str_clear, s0),
      (create_text_overlay, "$g_presentation_obj_escape_menu_container", s0, tf_scrollable_style_2),
      (position_set_x, pos1, 285),
      (position_set_y, pos1, 75),
      (overlay_set_position, "$g_presentation_obj_escape_menu_container", pos1),
      (position_set_x, pos1, 405),
      (position_set_y, pos1, 550),
      (overlay_set_area_size, "$g_presentation_obj_escape_menu_container", pos1),
      (set_container_overlay, "$g_presentation_obj_escape_menu_container"),
For text_overlays, overlay_set_size sets the font-size, which is irrelevant for containers. overlay_set_area_size sets the container size.

Note on positions: the y goes from 0 (bottom) to 750 (top of screen) and x goes from 0 (left) to 1000 (right), so a 3:4 ratio.
With containers, it seems that the best way is to take the total height of the container, then subtract 40 or so for each object.
 
Depends on the mesh size in the BRF as well.

If you want a fullscreen presentation, you want a mesh that measures 0.75 height and 1.0 width (as measured with the same ruler you use for weapon length). Then you set size to 1000 x 1000 so it keeps the ratio and size.
 
Ok, thx. I have now another problem, with containers this time.  Big  containers works good, when I set biggest overlay "y" to 2000 it appearing first on top and so on,  but when I trying to make smaller than 600 units it doesnt let me. Its like 600 is minimal size of container.
In picture below overlay with biggest hight is "body" with "y" 500 and you can see that there is still space above it. No matter how low I set "y" size of container stays same at 600. What I did wrong again?

25hmpmd.jpg

Here is code:

Code:
###################################################################################		
	("inventory", prsntf_manual_end_only, 0, [
    (ti_on_presentation_load,
     [(set_fixed_point_multiplier, 1000),
#--------------------------------------------	
	  (multiplayer_get_my_player, ":player_no"),
	  (player_get_agent_id, ":agent", ":player_no"),
	 
	 
	 
	  (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),  
      
	  (position_set_x, pos1, 700),           
      (position_set_y, pos1, 100),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),         
      (position_set_y, pos1, 900),
      (overlay_set_size, ":over1", pos1),
	  
#--------------------------------------------		  
	  
	  (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),
	  
	  
	  
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 350),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),
      (position_set_y, pos1, 480),
      (overlay_set_size, ":over1", pos1),

	  

#--------------------------------------------		  
	  
	  (str_clear, s1),
	  (create_text_overlay, ":over", s1, tf_scrollable_style_2),
      (overlay_set_color, ":over", 0xFFFFFF),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 340),            
      (overlay_set_position, ":over", pos1),
	  
	  (position_set_x, pos1, 290),             
      (position_set_y, pos1, 275),				
      (overlay_set_area_size, ":over", pos1),
      (set_container_overlay, ":over"),
	  
	  
#--------------------------------------------	  
	 
	  (create_text_overlay, ":over", "@Head:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 100),          
	  (overlay_set_position, ":over", pos1), 
	  
	  
#--------------------------------------------	  
	 
	  (create_text_overlay, ":over", "@Body:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 500),
	  (overlay_set_position, ":over", pos1),
	  
#--------------------------------------------	  
	  (create_text_overlay, ":over", "@Legs:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 450),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Hands:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
	  
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 1:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 2:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 3:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 4:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),	  
	  
	  
	  
	 
#--------------------------------------------	



	  (create_button_overlay, ":over", "@Back", 0),
	  (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 720),
      (position_set_y, pos1, 560),  
      (overlay_set_position, ":over", pos1),	


  
	  
      
	  
	  
	  
	  (presentation_set_duration, 999999),
      ]),
    
#-------------------------------------------------------------------   

   (ti_on_presentation_event_state_change,[
		(store_trigger_param_1, ":object"),
		
		
	
	 ]),
#-------------------------------------------------------------------  	
	(ti_on_presentation_run,
     [
     
     
	
	]),
	
	]),
###################################################################################
 
EmielRegis said:
Ok, thx. I have now another problem, with containers this time.  Big  containers works good, when I set biggest overlay "y" to 2000 it appearing first on top and so on,  but when I trying to make smaller than 600 units it doesnt let me. Its like 600 is minimal size of container.
In picture below overlay with biggest hight is "body" with "y" 500 and you can see that there is still space above it. No matter how low I set "y" size of container stays same at 600. What I did wrong again?

25hmpmd.jpg

Here is code:

Code:
###################################################################################		
	("inventory", prsntf_manual_end_only, 0, [
    (ti_on_presentation_load,
     [(set_fixed_point_multiplier, 1000),
#--------------------------------------------	
	  (multiplayer_get_my_player, ":player_no"),
	  (player_get_agent_id, ":agent", ":player_no"),
	 
	 
	 
	  (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),  
      
	  (position_set_x, pos1, 700),           
      (position_set_y, pos1, 100),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),         
      (position_set_y, pos1, 900),
      (overlay_set_size, ":over1", pos1),
	  
#--------------------------------------------		  
	  
	  (create_mesh_overlay, ":over1", "mesh_mp_ingame_menu"),
	  
	  
	  
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 350),
      (overlay_set_position, ":over1", pos1),
      (position_set_x, pos1, 600),
      (position_set_y, pos1, 480),
      (overlay_set_size, ":over1", pos1),

	  

#--------------------------------------------		  
	  
	  (str_clear, s1),
	  (create_text_overlay, ":over", s1, tf_scrollable_style_2),
      (overlay_set_color, ":over", 0xFFFFFF),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 340),            
      (overlay_set_position, ":over", pos1),
	  
	  (position_set_x, pos1, 290),             
      (position_set_y, pos1, 275),				
      (overlay_set_area_size, ":over", pos1),
      (set_container_overlay, ":over"),
	  
	  
#--------------------------------------------	  
	 
	  (create_text_overlay, ":over", "@Head:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 100),          
	  (overlay_set_position, ":over", pos1), 
	  
	  
#--------------------------------------------	  
	 
	  (create_text_overlay, ":over", "@Body:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 500),
	  (overlay_set_position, ":over", pos1),
	  
#--------------------------------------------	  
	  (create_text_overlay, ":over", "@Legs:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 450),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Hands:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
	  
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 1:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 2:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 3:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),
#--------------------------------------------	  
	  
	  (create_text_overlay, ":over", "@Item slot 4:"),
      (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 400),
	  (overlay_set_position, ":over", pos1),	  
	  
	  
	  
	 
#--------------------------------------------	



	  (create_button_overlay, ":over", "@Back", 0),
	  (overlay_set_color, ":over", 0xFF0033),
	  (position_set_x, pos1, 720),
      (position_set_y, pos1, 560),  
      (overlay_set_position, ":over", pos1),	


  
	  
      
	  
	  
	  
	  (presentation_set_duration, 999999),
      ]),
    
#-------------------------------------------------------------------   

   (ti_on_presentation_event_state_change,[
		(store_trigger_param_1, ":object"),
		
		
	
	 ]),
#-------------------------------------------------------------------  	
	(ti_on_presentation_run,
     [
     
     
	
	]),
	
	]),
###################################################################################

So this part is your container:
Code:
	  (str_clear, s1),
	  (create_text_overlay, ":over", s1, tf_scrollable_style_2),
      (overlay_set_color, ":over", 0xFFFFFF),
	  (position_set_x, pos1, 10),
      (position_set_y, pos1, 340),            
      (overlay_set_position, ":over", pos1),
	  
	  (position_set_x, pos1, 290),             
      (position_set_y, pos1, 275),				
      (overlay_set_area_size, ":over", pos1),
      (set_container_overlay, ":over"),
After it, you give a number of its contents to the same Y position:

(position_set_y, pos1, 400),

So they all show up on top of one another.

Here's an example of an old presentation of mine with a scroll able container and an increasing list of things (iterated...backwards...in this case), and I've added #### to the key parts after creating the container
Code:
      (str_clear, s0),
      (create_text_overlay, "$g_presentation_obj_bugdet_report_container", s0, tf_scrollable_style_2),
      (position_set_x, pos1, 50),
      (position_set_y, pos1, 100),
      (overlay_set_position, "$g_presentation_obj_bugdet_report_container", pos1),
      (position_set_x, pos1, 385),#was 360
      (position_set_y, pos1, 500), 
      (overlay_set_area_size, "$g_presentation_obj_bugdet_report_container", pos1),
      (set_container_overlay, "$g_presentation_obj_bugdet_report_container"),
   
      (assign, ":in_count", 0),
      (assign, ":cur_y_adder", 40),   #####
      (party_get_num_companion_stacks, ":num_of_stacks", "p_main_party"),
      (store_mul, ":cur_y", ":num_of_stacks", ":cur_y_adder"),
      
        (try_for_range, ":i", 0, ":num_of_stacks"),
            (party_stack_get_troop_id, ":troop_id", "p_main_party", ":i"),
            (neq, ":troop_id", "trp_player"),
            (party_stack_get_size, ":stack_size", "p_main_party", ":i"),
            (party_stack_get_num_wounded, ":stack_wounded", "p_main_party", ":i"),
            (val_sub, ":stack_size", ":stack_wounded"),
            (troop_get_slot, ":num_of_agents", ":troop_id", slot_troop_prebattle_first_round),
            (val_min, ":num_of_agents", ":stack_size"),
            (troop_set_slot, ":troop_id", slot_troop_prebattle_first_round, ":num_of_agents"),
            
            (val_add, ":in_count", ":num_of_agents"),
            
            (str_store_troop_name, s1, ":troop_id"),
            (create_text_overlay, reg0, s1),
            (position_set_x, pos1, 800),
            (position_set_y, pos1, 800),
            (overlay_set_size, reg0, pos1),
            (position_set_x, pos1, 25),
            (position_set_y, pos1, ":cur_y"), ########
            (overlay_set_position, reg0, pos1),
            
            (assign, reg0, ":stack_size"),
            (str_store_string, s1, "@/ {reg0}"),
            (create_text_overlay, reg0, s1),
            (position_set_x, pos1, 325),
            (position_set_y, pos1, ":cur_y"), ######
            (overlay_set_position, reg0, pos1),
                        
            (val_add, ":stack_size", 1), #for upper limit of number box
            
            (create_number_box_overlay, reg0, 0, ":stack_size"),
            (overlay_set_val, reg0, ":num_of_agents"),
            (position_set_x, pos1, 250),
            (position_set_y, pos1, ":cur_y"),
            (overlay_set_position, reg0, pos1),
                
            (troop_set_slot, "trp_temp_array_a", ":troop_id", reg0),

            (val_sub, ":cur_y", ":cur_y_adder"),   ######
        (try_end), #End Stack/Troop Loop

        (set_container_overlay, -1),

The Ys of the contents need to be continually increasing to make a list. The container size will not change, but so long as it is scrollable, you can scroll down to the other contents.

There's not a minimal size for a container.
 
I made that presentation for topic purposes and contents overlaping isnt problem. I made already presentation like yours and yes, its working, but my problem occurs only when there are very few items in container and their "y" value is less than 600 units.
 
I see, I apologize for misunderstanding. Have you tried the other scrollable tag "tf_scrollable"?

Natively, it is used with smaller containers, e.g.:
Code:
        (create_text_overlay, reg0, s2, tf_scrollable),
        (overlay_set_color, reg0, 0xFFFFFF),
        (position_set_x, pos1, 230),
        (position_set_y, pos1, 425),
        (overlay_set_position, reg0, pos1),
        (position_set_x, pos1, 540),
        (position_set_y, pos1, 150),
        (overlay_set_area_size, reg0, pos1),

Those flagged with scrollable_style_2 all have at least a Y of 500. Perhaps the scroll bar isn't scaling?



(On an a partly related note...I remember knowing something about this...it is frustrating not having written it down and having forgotten. Grumble.)
 
Back
Top Bottom