Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I am looking for is code like this
from module_items import *
 
def get_item_accuracy():
  item_accuracy = []
  for i_item in xrange(len(items)):
    item_accuracy.append((item_set_slot, i_item, slot_item_accuracy, get_leg_armor(items[i_item][6])))
  return item_accuracy[:]

def get_item_shoot_speed():
  item_shoot_speed = []
  for i_item in xrange(len(items)):
    item_shoot_speed.append((item_set_slot, i_item, slot_item_shoot_speed, get_missile_speed(items[i_item][6])))
  return item_shoot_speed[:]

def get_item_speed_rating():
  item_speed_rating = []
  for i_item in xrange(len(items)):
    item_speed_rating.append((item_set_slot, i_item, slot_item_speed_rating, get_speed_rating(items[i_item][6])))
  return item_speed_rating[:



But I do not know where to write
 
HungKnight said:

go into module_scripts and paste all of those stuffs BEFORE "scripts = [" line. Then make a script like this:
Quote
("whatever_name_you_want_here", get_item_accuracy() + get_item_shoot_speed() + get_item_speed_rating()),
After that, you need to call that script from somewhere, once. If you want to work in multiplayer, then go into script "game_quick_start" and put this somewhere in that script:
Quote
(call_script, "script_whatever_name_you_want_here"),

If you want it to work in single player, then go into script "game_start" and call the script like shown above.
 
Dusk Voyager said:
Well, I thought it would be clear, Reports would have child (sub) menus. Not sure what's vanilla in the game, never played it that way (only played Floris and Gekokujo).
Anyway I just noticed it does not matter which dialog I click at all.
Open Reports > Click on Menu View list of known lords by relation (starts a presentation) > select a lord from the list on the right side > click on Talk > (Dialog at the set scene opens) say good by to the lord > (finding yourself at the Reports mainmenu) > click on Resume Travelling
Status: OK
Do the whole procedure again [or just click on the view list again, and do the talk, without resume travelling], no matter the lord or dialog, ends (unwanted) in Resume Travelling = jump_to_menu, "mnu_reports" endless loop.


If you'd still like to help me, here's the complete code which is used.
Menu
Code:
      ("lord_relations",[],"View list of known lords by relation.",
       [
		#(jump_to_menu, "mnu_lord_relations"),
        (assign, "$g_jrider_pres_called_from_menu", 1),
        (assign, "$g_character_presentation_type", 1),
        (start_presentation, "prsnt_jrider_character_relation_report"),
        ]
       ),
Code:
      ("resume_travelling",[],"Resume travelling.",
       [(change_screen_return),
        ]
       ),
	   
      ]
  ),
Presentation
Code:
  ## Character relations report
  ("jrider_character_relation_report", 0,
   mesh_message_window,
   [
     ## Load Presentation
     (ti_on_presentation_load,
      # generic_ti_on_load +
      [
    (presentation_set_duration, 999999),
        (set_fixed_point_multiplier, 1000),

        (str_clear, s0),
        (str_clear, s1),

        # Character presentation type variations
        (try_begin),
            ###############################
            ## Courtship Relations presentation
            (eq, "$g_character_presentation_type", 0),

            # Set presentation title string
            (str_store_string, s0, "@_Courtships in progress_"),

            # Set size of listbox
            (assign, ":base_scroll_y", 160),
            (assign, ":base_scroll_size_y", 480),
            (assign, ":base_candidates_y", 0), # scrollable area size minus (one line size + 2) 430

            # Set storage index
            (assign, "$g_base_character_presentation_storage_index", 1000),

            # presentation specific extra overlays
            (call_script, "script_generate_knonwn_poems_string"),

            # Extra text area for knowns poems (filling once so we use a register), filled from s1 generated in script call
            (create_text_overlay, reg1, s1, tf_left_align),
            (position_set_x, pos1, 590), # position
            (position_set_y, pos1, 55),
            (overlay_set_position, reg1, pos1),
            (position_set_x, pos1, 750), # size
            (position_set_y, pos1, 850),
            (overlay_set_size, reg1, pos1),
            (overlay_set_color, reg1, 0xFF66CC), # color
        (else_try),
            ###############################
            ## Lord Relations presentation
            (eq, "$g_character_presentation_type", 1),

            # Set presentation title string
            (str_store_string, s0, "@_Known Lords by Relation_"),

            # Set size of listbox
            (assign, ":base_scroll_y", 110),
            (assign, ":base_scroll_size_y", 550),
            (assign, ":base_candidates_y", 0), # scrollable area size minus 530

            # Set storage index
            (assign, "$g_base_character_presentation_storage_index", 2000),
        (else_try),
            ###############################
            ## Player and Companions presentation
            (eq, "$g_character_presentation_type", 2),

            # Set presentation title string
            (str_store_string, s0, "@_Character & Companions_"),

            # Set size of listbox
            (assign, ":base_scroll_y", 110),
            (assign, ":base_scroll_size_y", 550),
            (assign, ":base_candidates_y", 0), # scrollable area size minus (one line size + 2) 530

            # Set storage index
            (assign, "$g_base_character_presentation_storage_index", 3000),

            # Extra area for equipment display
            (assign, ":inv_bar_size", 0),
            (position_set_x, ":inv_bar_size", 400),
            (position_set_y, ":inv_bar_size", 400),

            (create_mesh_overlay, reg1, "mesh_mp_inventory_left"),
            (position_set_x, pos1, 67),
            (position_set_y, pos1, 300),
            (overlay_set_position, reg1, pos1),
            (overlay_set_size, reg1, ":inv_bar_size"),

            (create_mesh_overlay, reg1, "mesh_mp_inventory_right"),
            (position_set_x, pos1, 450),
            (position_set_y, pos1, 330),
            (overlay_set_position, reg1, pos1),
            (overlay_set_size, reg1, ":inv_bar_size"),
        (try_end),
        # END of presentation type specific init and static overlay

        ###############################
        # Create common overlays
        # set foreground mesh overlay (has some transparency in it, so can't use it directly)
        (create_mesh_overlay, reg1, "mesh_face_gen_window"),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, reg1, pos1),
    (position_set_x, pos1, 1000),
        (position_set_y, pos1, 1000),
    (overlay_set_size, reg1, pos1),

    # Presentation title overlay, centered at the top of right pane (from s0, presentation type specific)
        (create_text_overlay, reg1, s0, tf_center_justify),
        (overlay_set_color, reg1, 0xDDDDDD),
    (position_set_x, pos1, 740), # Higher, means more toward the right
        (position_set_y, pos1, 680), # Higher, means more toward the top
        (overlay_set_position, reg1, pos1),
    (position_set_x, pos1, 1200),
        (position_set_y, pos1, 1200),
    (overlay_set_size, reg1, pos1),

    # Done button
        (create_game_button_overlay, "$g_jrider_character_report_Return_to_menu", "@_Done_"),
    (position_set_x, pos1, 187),
        (position_set_y, pos1, 10),
        (overlay_set_position, "$g_jrider_character_report_Return_to_menu", pos1),
		
    # Talk button
        (create_game_button_overlay, "$g_jrider_character_report_talk_to_npc", "@_Talk_"),
    (position_set_x, pos1, 387),
        (position_set_y, pos1, 10),
        (overlay_set_position, "$g_jrider_character_report_talk_to_npc", pos1),

        # Character Information text to fill when an entry is clicked in the list
        (create_text_overlay, "$g_jrider_character_information_text", "str_space", tf_left_align),
        (overlay_set_color, "$g_jrider_character_information_text", 0xFFFFFF),
        (position_set_x, pos1, 55), # Higher, means more toward the right
        (position_set_y, pos1, 60), # Higher, means more toward the top
        (overlay_set_position, "$g_jrider_character_information_text", pos1),
        (position_set_x, pos1, 700), # smaller means smaller font
        (position_set_y, pos1, 800),
        (overlay_set_size, "$g_jrider_character_information_text", pos1),

        # Character selection listbox overlay
        # use scrollable text area with global reference so objects can be put inside using overlay_set_container
        (create_text_overlay, "$g_jrider_character_relation_listbox", "str_empty_string", tf_scrollable_style_2),
        (position_set_x, pos1, 590),
        (position_set_y, pos1, ":base_scroll_y"),
        (overlay_set_position, "$g_jrider_character_relation_listbox", pos1),
        (position_set_x, pos1, 335),
        (position_set_y, pos1, ":base_scroll_size_y"),
        (overlay_set_area_size, "$g_jrider_character_relation_listbox", pos1),

        # Faction filter
        (create_combo_button_overlay, "$g_jrider_character_faction_filter", "str_empty_string",0),
        (position_set_x, pos1, 507),
        (position_set_y, pos1, 709),
        (overlay_set_position, "$g_jrider_character_faction_filter", pos1),
        (position_set_x, pos1, 550),
        (position_set_y, pos1, 650),
        (overlay_set_size, "$g_jrider_character_faction_filter", pos1),

        # add elements to filter button
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Your supporters"),
		#gekokujo 3.0 name changes and additional factions
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Swadians"),
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Vaegirs"),
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Khergits"),
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Nords"),
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Rhodoks"),
        #(overlay_add_item, "$g_jrider_character_faction_filter", "@Sarranids"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Uesugi"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Date"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Oda"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Mori"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Takeda"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Tokugawa"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Miyoshi"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Amako"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Otomo"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Nanbu"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Asakura"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Chosokabe"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Hojo"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Mogami"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Shimazu"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Ryuzoji"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Satake"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Satomi"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Ukita"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@Ikko Ikki"),
        (overlay_add_item, "$g_jrider_character_faction_filter", "@All Factions"),

        # Set initial value for selection box
        (try_begin),
            (this_or_next|eq, "$g_jrider_pres_called_from_menu", 1),
            (eq, "$g_jrider_faction_filter", -1),

            (assign, "$g_jrider_faction_filter", -1),
			#gekokujo 3.0 "all factions" is now index 21
            #(overlay_set_val, "$g_jrider_character_faction_filter", 7),
            (overlay_set_val, "$g_jrider_character_faction_filter", 21),
        (else_try),
            (overlay_set_val, "$g_jrider_character_faction_filter", "$g_jrider_faction_filter"),
        (try_end),

        ###############################
        # Populate lists
        # Init presentation common global variables
        (assign, "$num_charinfo_candidates", 0),

        # Fill listbox (overlay_add_item and extra storage)
        (call_script, "script_fill_relation_canditate_list_for_presentation", "$g_character_presentation_type", ":base_candidates_y"),
        (assign, "$g_jrider_reset_selected_on_faction", 0),
        # stop if there's no candidate
        (gt, "$num_charinfo_candidates", 0),

        # get extra information from storage
        (store_add, ":current_storage_index", "$g_base_character_presentation_storage_index", "$g_latest_character_relation_entry"),
        (troop_get_slot, "$character_info_id", "trp_temp_array_c", ":current_storage_index"),

        # Fill text information for current entry and update text information overlay
        (call_script, "script_generate_extended_troop_relation_information_string", "$character_info_id"),
        (overlay_set_text, "$g_jrider_character_information_text", s1),

        # color selected entry
        (overlay_set_color, "$g_jrider_last_checked_indicator", 0xFF6666FF),
        (overlay_set_alpha, "$g_jrider_last_checked_indicator", 0x44),

        # Begin common dynamic overlay
        # mesh Overlay for character portrait (global not needed)
        (create_image_button_overlay_with_tableau_material, "$g_jrider_character_portrait", -1, "tableau_troop_note_mesh", "$character_info_id"),
        (position_set_x, pos2, 100),
        (position_set_y, pos2, 280),
        (overlay_set_position, "$g_jrider_character_portrait", pos2),
        (position_set_x, pos2, 1100), #1150
        (position_set_y, pos2, 1100), #1150
        (overlay_set_size, "$g_jrider_character_portrait", pos2),

        # mesh Overlay for faction coat of arms
        (try_begin),
            (store_troop_faction, ":troop_faction", "$character_info_id"),
            (neq, ":troop_faction", "fac_player_supporters_faction"),
            (is_between, ":troop_faction", kingdoms_begin, kingdoms_end),
            (store_sub, ":faction_mesh_index", ":troop_faction", kingdoms_begin),
            (val_add, ":faction_mesh_index", "mesh_pic_recruits"),

            (create_mesh_overlay, "$g_jrider_faction_coat_of_arms", ":faction_mesh_index"),
            (position_set_x, pos3, 150),
            (position_set_y, pos3, 600),
            (overlay_set_position, "$g_jrider_faction_coat_of_arms", pos3),
            (position_set_x, pos3, 250),
            (position_set_y, pos3, 250),
            (overlay_set_size, "$g_jrider_faction_coat_of_arms", pos3),
        (try_end),

        # Begin presentation type specific dynamic overlay
        # equipement meshes for character/companions
        (try_begin),
            (eq, "$g_character_presentation_type", 2),

            (assign, ":base_inv_slot_x", 452),
            (assign, ":base_inv_slot_y", 536),

            (try_for_range, ":item_eq", 0, 9),
            # loop equipment slots
                (troop_get_inventory_slot, reg1, "$character_info_id", ":item_eq"),

                (try_begin),
                    (eq, ":item_eq", 4),
                    (assign, ":base_inv_slot_x", 68),
                    (assign, ":base_inv_slot_y", 557),
                (try_end),
                (try_begin),
                    (lt, reg1, 1),
                    # empty... assign default mesh
                   (try_begin),
                       (lt, ":item_eq", 4),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_equip"),
                   (else_try),
                       (eq, ":item_eq", 4),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_helmet"),
                   (else_try),
                       (eq, ":item_eq", 5),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_armor"),
                   (else_try),
                       (eq, ":item_eq", 6),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_boot"),
                   (else_try),
                       (eq, ":item_eq", 7),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_glove"),
                   (else_try),
                       (eq, ":item_eq", 8),
                       (assign, ":mesh_id", "mesh_mp_inventory_slot_horse"),
                   (try_end),

                   (create_mesh_overlay, reg11, ":mesh_id"),
                   (overlay_set_size, reg11, ":inv_bar_size"),

                   (position_set_x, pos1, ":base_inv_slot_x"),
                   (position_set_y, pos1, ":base_inv_slot_y"),
                   (overlay_set_position, reg11, pos1),

                   (troop_set_slot, "trp_temp_array_a", ":item_eq", -1),
                   (store_add, ":item_eq_id", ":item_eq", 10),
                   (troop_set_slot, "trp_temp_array_a", ":item_eq_id", -1),
                # end missing item
                (else_try),
                    (create_mesh_overlay_with_item_id, reg10, reg1),
                    (position_set_x, pos1, 450),
                    (position_set_y, pos1, 450),
                    (overlay_set_size, reg10, pos1),

                    (store_add, ":item_inv_slot_x", ":base_inv_slot_x", 25),
                    (store_add, ":item_inv_slot_y", ":base_inv_slot_y", 25),

                    (position_set_x, pos1, ":item_inv_slot_x"),
                    (position_set_y, pos1, ":item_inv_slot_y"),
                    (overlay_set_position, reg10, pos1),

                    # save id for reuse
                    (troop_set_slot, "trp_temp_array_a", ":item_eq", reg10),
                    (store_add, ":item_eq_id", ":item_eq", 10),
                    (troop_set_slot, "trp_temp_array_a", ":item_eq_id", reg1),
                # real items
                (try_end),
                (val_sub, ":base_inv_slot_y", 51),
            (try_end),
            # end loop equipments slots
        (try_end),

        # do an update if called from menu and reset init variable
        (try_begin),
            (eq, "$g_jrider_pres_called_from_menu", 1),
            (assign, "$g_jrider_pres_called_from_menu", 0),
        (try_end),
    ]),
    # end presentation load

    ## Mouse-over
    (ti_on_presentation_mouse_enter_leave,
      [
      (store_trigger_param_1, ":object"),
      (store_trigger_param_2, ":enter_leave"),

      (try_begin),
          (eq, "$g_character_presentation_type", 2),
          (try_begin),
              (eq, ":enter_leave", 0),
              (try_for_range, ":slot_no", 0, 9),
                  (troop_slot_eq, "trp_temp_array_a", ":slot_no", ":object"),
                  (store_add, ":slot_no_eq", ":slot_no", 10),
                  (troop_get_slot, ":item_no", "trp_temp_array_a", ":slot_no_eq"),

                  (set_fixed_point_multiplier, 1000),

                  (position_set_x,pos0,740),
                  (position_set_y,pos0,235),
                  (show_item_details, ":item_no", pos0, 100),
              (try_end),
          (else_try),
              (try_for_range, ":slot_no", 0, 9),
                (troop_slot_eq, "trp_temp_array_a", ":slot_no", ":object"),
                (close_item_details),
              (try_end),
          (try_end),
      (try_end),
    ]),
    # end mouseover

    ## Check for buttonpress
    (ti_on_presentation_event_state_change,
     [
        (store_trigger_param_1, ":object"), # object
        (store_trigger_param_2, ":value"),  # value

        (try_begin),
            # pressed  (Return to menu)
            (eq, ":object", "$g_jrider_character_report_Return_to_menu"),

            (try_begin),
                (neq, "$num_charinfo_candidates", 0),
                (overlay_set_text, "$g_jrider_character_information_text", "str_empty_string"),
                (overlay_set_alpha, "$g_jrider_last_checked_indicator", 0),
            (try_end),
            (presentation_set_duration, 0),
			
        (else_try),
            # pressed  (talk_to_npc)
            (eq, ":object", "$g_jrider_character_report_talk_to_npc"),

            (try_begin),
                (neq, "$num_charinfo_candidates", 0),
                (overlay_set_text, "$g_jrider_character_information_text", "str_empty_string"),
                (overlay_set_alpha, "$g_jrider_last_checked_indicator", 0),
            (try_end),
            #(presentation_set_duration, 0),
			 (modify_visitors_at_site, "$g_training_ground_melee_training_scene"),
			 (set_visitor, 4, "$character_info_id"),
			 (set_jump_mission, "mt_training_ground_trainer_training"),
			 (jump_to_scene, "$g_training_ground_melee_training_scene"),
			 (change_screen_map_conversation, "$character_info_id"),

        (else_try),
            # Faction filter
            (eq, ":object", "$g_jrider_character_faction_filter"),
            (try_begin),
				#gekokujo 3.0 "all factions" is now index 21
                #(eq, ":value", 7),
                (eq, ":value", 21),
                (assign, "$g_jrider_faction_filter", -1),
            (else_try),
                (assign, "$g_jrider_faction_filter", ":value"),
            (try_end),

            # reset selected to first
            (assign, "$g_jrider_reset_selected_on_faction", 1000),

            # restart presentation to take filters into account
            (start_presentation, "prsnt_jrider_character_relation_report"),

        (else_try),
            (neq, ":object", "$g_jrider_character_information_text"),
            (neq, ":object", "$g_jrider_character_portrait"),
            (neq, ":object", "$g_jrider_character_relation_listbox"),
            #(neq, ":object", "$g_jrider_faction_coat_of_arms"),
            # clicked on list entry
            # get storage index + base storage index
            (store_add, ":storage_button_id", ":object", "$g_base_character_presentation_storage_index"),
            (troop_get_slot, ":character_number", "trp_temp_array_b", ":storage_button_id"),

            (overlay_set_alpha, "$g_jrider_last_checked_indicator", 0),
            (overlay_set_color, "$g_jrider_last_checked_indicator", 0xDDDDDD),

            # update last entry and check variables
            (assign, "$g_latest_character_relation_entry", ":character_number"),
            (assign, "$g_jrider_last_checked_indicator", ":object"),

            # color selected entry
            (overlay_set_color, "$g_jrider_last_checked_indicator", 0xFF6666FF),
            (overlay_set_alpha, "$g_jrider_last_checked_indicator", 0x44),

            # get troop information from storage to update text
            (val_add, ":character_number", "$g_base_character_presentation_storage_index"),
            (troop_get_slot, "$character_info_id", "trp_temp_array_c", ":character_number"),

            # restart presentation to update picture and text
            (start_presentation, "prsnt_jrider_character_relation_report"),
			
    (try_end),
     ] # + generic_ti_on_presentation_event_state_change
     ),
     # end event state change

    ## Event to process when running the presentation
    (ti_on_presentation_run,
     # generic_ti_on_presentation_run +
     [
        (try_begin),
      (this_or_next|key_clicked, key_escape),
      (key_clicked, key_right_mouse_button),
      (presentation_set_duration, 0),
      (jump_to_menu, "mnu_reports"),
        (try_end),

        ]),
     # end presentation run
     ]),
    ###################################
    # Character relation presentation end

all this stuff is already part of Gekokujo-mod I only wanted to create this talk to a lord stuff (as I did with the minister [but there no presentation is active in any form, only menu, child menu > dialog scene > menu]).

edit: just noticed that you had edited your post a few times, I've read it at its original time and it was different.
Using change_screen_map without anything or do I need to add values? (the header_operations doesn't say any word about it, it's just listed)
Replacing it with jump_to_menu had no different result
 
Melphiz said:
Well, I thought it would be clear, Reports would have child (sub) menus. Not sure what's vanilla in the game, never played it that way (only played Floris and Gekokujo).
The presentation is just a better version of the normal lords menu, so you might well have deleted it. But anyway, it's pointless to argue about it because you didn't and it's also OK.
Why don't you use (change_screen_map), instead of (change_screen_return), in the "Resume travelling" option of the reports menu? No value is needed.

PS. That was just another idea.
 
Dusk Voyager said:
Why don't you use change_screen_map instead of change_screen_return in the "Resume travelling" option of the reports menu? No value is needed.
Because I have noticed after I posted the stuff that you had edited your post which I had already read by the original time and the time I noticed I wasn't sure if you mean I should replace it with the jump_to_menu.

I'll try with the resume travelling.
 
(before the edit gets lost, a new post)
Ok, so the change_screen_map as replacement for change_screen_return does work but comes with a sideissue (which must be the real reason for the issue before).

[list type=decimal]
[*]Go to the menu, talk to a lord, say good bye - dialog ends and you are on the map (not in the reports menu anymore).
[*]Go again to the menu, talk again to a lord (or two, or three), say good bye - dialog ends and you find yourself in the reports menu and can hit resume travelling w/o any problem.
[*]Go a 3rd time to the menu, talk again to a lord, say again good bye - dialog ends and you are on the map.
[*]see point 2
[*]see point 1
[/list]

I'd like to find and get rid of the original issue causing this weird behaviour.

Edit: I want to say thank you already for your time, patience and helpful answers =)

Solution
The reason it works with my minister is only because of the fact the dialog-scene is called from a childmenu(!).
The list of known lords is called from a parentmenu ("Reports"), so when I place this stuff where my minister stuff is ("Camp" > "Take an action") it works. It always comes back to "Take an action" menu and from there can go back to "Camp" and there "Resume travelling" without any issue.

So if I place my direct jump-to-minister-scene-dialog where the presentation of the lords list would normally be, I get the same error occuring.

Ok, so need to place it into a child menu, well, then I can make a complete overhaul (hopefully) with all lords instead of the known ones.
 
Hello! I was looking through the header_music file, trying to add a new mtf flag for the new cultures' music.

I was wondering what the highlighted bit of code effected,

mtf_culture_6                          = 0x00000020
 
MadocComadrin said:
That leads me to my next question then, does omit_key_once work with game_keys or just specific keys?
Scratch that, omit_key_once apparently only works on key-code in presentations, so it wouldn't work if the block key was reassigned. What I ended up doing was detecting if the block game key was down and forcing an animation with a higher priority.
 
The_dragon said:
HungKnight said:

go into module_scripts and paste all of those stuffs BEFORE "scripts = [" line. Then make a script like this:
Quote
("whatever_name_you_want_here", get_item_accuracy() + get_item_shoot_speed() + get_item_speed_rating()),
After that, you need to call that script from somewhere, once. If you want to work in multiplayer, then go into script "game_quick_start" and put this somewhere in that script:
Quote
(call_script, "script_whatever_name_you_want_here"),

If you want it to work in single player, then go into script "game_start" and call the script like shown above.


sorry, silly me, the line ("whatever_name_you_want_here" get_item_accuracy () + get_item_shoot_speed () + get_item_speed_rating ()), it was error even though I have paste all of those stuffs BEFORE "scripts = ["
 
Frenzied_Crocoduck_Herder said:
Hello! I was looking through the header_music file, trying to add a new mtf flag for the new cultures' music.

I was wondering what the highlighted bit of code effected,

mtf_culture_6                          = 0x00000020
Module code uses (music_set_situation) and (music_set_culture) operations to notify the game engine what background music should play at the moment. Engine picks random tracks that match the specified settings. Flag mtf_culture_6 is one of culture flags used for this.
 
HungKnight said:
sorry, silly me, the line ("whatever_name_you_want_here" get_item_accuracy () + get_item_shoot_speed () + get_item_speed_rating ()), it was error even though I have paste all of those stuffs BEFORE "scripts = ["

sorry; put a ',' between the name of the script and the get_ functions.
("whatever_name_you_want_here", get_item_accuracy () + get_item_shoot_speed () + get_item_speed_rating ()),
 
MadocComadrin said:
Scratch that, omit_key_once apparently only works on key-code in presentations, so it wouldn't work if the block key was reassigned. What I ended up doing was detecting if the block game key was down and forcing an animation with a higher priority.
I'd say you could start a presentation beforehand that stores the responsible key in a loop and ends when the block game key is pressed, with the value used in the mt trigger. Then again, omit_key_once might well mix up a named key and the game key with the same ID.
 
Is it somehow possible to sort the output of a result alphabetical?
You know, like when putting the output of
Code:
(try_for_range, ":faction", kingdoms_begin, kingdoms_end),
into a str_store_string, s1 and have {s1} as output in a menu. The output is then in the order the factions/troops etc. exist with their numbers in the modules kingdom_1, kingdom_2 for example. But I'd like to have the output in alphabetical order.
Means when kingdom_1 is Horde it should appear in the output behind kingdom_7 Barbarians.

Is there any chance of doing so by code? Until now I have listed all entries by hand one for one without using a range.
 
You can do some compile time tricks, but not entire at run time.
At compile time, you can rearrange the factions so that they will be arranged alphabetical resulting when you loop over them, their names will be alphabetical (this can break a lot of stuffs).
You have no operations to compare two strings, so you can't arrange strings or stuffs like that only by script.
 
I know it's hardcoded. I just thought, if the game uses that language and puts out such a list in that order it might be possible with the module system, too, but doesn't look like (at least no easy way, hehe).
 
Status
Not open for further replies.
Back
Top Bottom