Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello again good mates. Which MS files and lines should I modify if I want to change the places where companions tell me their stories? I mean the home_description strings.
Thanks!
 
mike56 said:
Hello again good mates. Which MS files and lines should I modify if I want to change the places where companions tell me their stories? I mean the home_description strings.
Thanks!

its a event, so should be triggered by a trigger  :mrgreen:

module_simple_triggers.py has this

Code:
		(else_try), #check for regional background
            (eq, "$disable_local_histories", 0),
            (eq, "$g_infinite_camping", 0),
            (try_for_range, ":npc", companions_begin, companions_end),
                (main_party_has_troop, ":npc"),           
                (troop_slot_eq, ":npc", slot_troop_home_speech_delivered, 0),
                (troop_get_slot, ":home", ":npc", slot_troop_home),
                (gt, ":home", 0),
                (store_distance_to_party_from_party, ":distance", ":home", "p_main_party"),
                (lt, ":distance", 7),
                (assign, "$npc_map_talk_context", slot_troop_home),
				
				(str_store_string, s51, "str_triggered_by_local_histories"),
				
                (start_map_conversation, ":npc", -1),
            (try_end),
note: horrible indentation from Native code

that is the condition. You can check module_dialogs.py if you want edit the conversation, and module_strings.py if you want change the text ("npc1_home_intro" and on)
 
When adding
Code:
str_255          = bignum | 0x000000ff
To header_troops.py, using WRECK, I get the following error:

Code:
Loading module... FAILED.
MODULE `troops` ERROR:
Traceback (most recent call last):
  File "compile.py", line 129, in <module>
    from module_troops import *
  File "C:\Users\***\Module_system 1.158_fully_in
tegrated\module_troops.py", line 3916, in <module>
    def_attrib|str_255|level(12),wp(280),knows_ironflesh_15|knows_athletics_4|kn
ows_power_strike_10,mercenary_face_1, mercenary_face_2],
  File "C:\Users\***\Module_system 1.158_fully_in
tegrated\compiler.py", line 56, in __or__
    for key, value in other.iteritems():
AttributeError: 'long' object has no attribute 'iteritems'


COMPILATION FAILED.

I only get this error when actually using str_255 on a module_troops.py troop template. If I changed it back to str_30, all is fine. Any idea how I could higher strength/agility values with WRECK?
 
Need some assistance again. I'm attempting to implement this code into my mod. Everythings fine with the script, its the menus I'm having issues with.

Info: using Lav's modified compilier and module system (1.166) with 1.168 M&B

Here's my error:
Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... FAILED.

MODULE `game_menus` ERROR:
failed to parse element #0
  cannot convert value [] to integer


COMPILATION FAILED.

And my code
Code:
game_menus = [

("start_king",[],"A ruler of a small kingdom.",[
	  (assign,"$background_type",cb_noble),
          (assign, reg3, "$character_gender"),
	  (str_store_string,s10,"@You were raised as a Prince and were provided the best education and training the kingdom could provide."),
	 (jump_to_menu,"mnu_start_king_1"),	# redirects to custom menu
	 ]),	   
	  
	  
	  ("mnu_start_king_1",menu_text_color(0xFF000000)|mnf_disable_all_keys,	# "custom" menu, makeshift copy n paste
    "Select your character's gender.",
    "none",
    [],
    [
      ("start_male",[],"Male",
       [
         (troop_set_type,"trp_player", 0),
         (assign,"$character_gender",tf_male),
         (jump_to_menu,"mnu_start_character_1"),
        ]
       ),
      ("start_female",[],"Female",
       [
         (troop_set_type, "trp_player", 1),
         (assign, "$character_gender", tf_female),
         (jump_to_menu, "mnu_start_character_1"),
       ]
       ),
	  ("go_back",[],"Go back",
       [
	     (jump_to_menu,"mnu_start_game_0"),
       ]),
    ]
  
  ),

  (
    "start_character_1",mnf_disable_all_keys,
    "You are a...",
    "none",
    [
    (str_clear,s10),
    (str_clear,s11),
    (str_clear,s12),
    (str_clear,s13),
    (str_clear,s14),
    (str_clear,s15),
    ],
    
    [("start_noble",[],"King.",[
	  (call_script,"script_set_player_kingdom_1"),	# calls the script to set up the characters kingdom
      (assign,"$background_type",cb_noble),
      (assign, reg3, "$character_gender"),
      (str_store_string,s10,"@You came into the world a {reg3?daughter:son} of declining nobility,\
			owning only the house in which they lived. However, despite your family's hardships,\
			they gave you a good education and trained you from childhood for the rigors of aristocracy and life at court."),
	(jump_to_menu,"mnu_choose_skill"),
	]),
	]
	),

Could anyone point out my error?
 
It could be "start_male",[],"male" (and the female variant). Maybe it expects something to be there abd there just... isn't?

It could also be an errant [ or ]; double-check each bracket contains what it should. Sonething like PSPad will highlight where a bracketed segment starts and ends.
 
Mispronounced said:
Need some assistance again. I'm attempting to implement this code into my mod. Everythings fine with the script, its the menus I'm having issues with.

1) use proper indentation. You can automate it, no need to fix it manually. It helps to read the code and find mistakes
2) (recommendation) use templates to write code. See SublimeAPI on the OSP section to learn more. It will avoid mistakes in the future (and make you write code several times faster...)
3) learn to read the compiler error messages. If you want to go deeper, learn how to debug Python code (use a IDE like PyCharm Community, which is free), that way you can find the error quite fast

MODULE `game_menus` ERROR:  -> something wrong with a menu (module_game_menus.py or any of your plugin files with a menu)
failed to parse element #0            -> element 0 means the first one. So your very first menu (compilation order)
  cannot convert value [] to integer -> compiler expected a number (integer like 1, 2, 3), but you gave it a empty list "[]"

Code:
("start_king",[],"A ruler of a small kingdom.",[

Check the comments on module_game_menus.py
Code:
#  1) Game-menu id (string): used for referencing game-menus in other files.
#     The prefix menu_ is automatically added before each game-menu-id
#
#  2) Game-menu flags (int). See header_game_menus.py for a list of available flags.
#     You can also specify menu text color here, with the menu_text_color macro
#  3) Game-menu text (string).
string -> int -> string

compare with your menu above and you will see the error

("start_king",[]
 
Sorry about the crappy indentation. I didn't know about the templates, thanks. Knew what the error was, just don't know what to place as the integer.

Add an number? Adding a number does nothing, same error. In header game menus it lists some possible entires, but none seem to work when inputted

Thanks for helping me.
 
Mispronounced said:
just don't know what to place as the integer.

read the comments (module_game_menu.py description of a menu), it tells you what goes where and from which reference.

Code:
See header_game_menus.py

remember the initial menus are hardcoded (position), so you should not mess with them (disable is ok, change code is ok, just don't remove them). They are called directly from the engine.
 
Could someone explain why the most current dedicated server files for Native (which are 1.15:cool: did not need to be updated up to 1.168? That is, if you feel so inclined. I'd find it educational at least.  :wink:
 
Because from about 1.134 onwards the vast majority of changes have been adding operations and altering the application file. In the module system this merely amounts to altering the header_operations and header_triggers files.

Or so I'd assume. I don't know much about multiplayer modding.
 
Nate said:
Could someone explain why the most current dedicated server files for Native (which are 1.15:cool: did not need to be updated up to 1.168? That is, if you feel so inclined. I'd find it educational at least.  :wink:
If you want to use 1.158+ features(operations, triggers, etc.) then you surely need the latest server files aswell.
Get the Viking Conquest dedicated server files if you want the 1.168 version, unfortunately Native's files didn't get any update by TaleWorlds.
 
_Sebastian_ said:
Nate said:
Could someone explain why the most current dedicated server files for Native (which are 1.15:cool: did not need to be updated up to 1.168? That is, if you feel so inclined. I'd find it educational at least.  :wink:
If you want to use 1.158+ features(operations, triggers, etc.) then you surely need the latest server files aswell.
Get the Viking Conquest dedicated server files if you want the 1.168 version, unfortunately Native's files didn't get any update by TaleWorlds.
If someone hosts a native server using viking conquests' dedicated server files, and the joining players are using Native (and haven't purchased VC) will they still be able to utilize those new operations as long as their game tells them its 1.168 in the launcher?
 
troycall said:
If someone hosts a native server using viking conquests' dedicated server files, and the joining players are using Native (and haven't purchased VC) will they still be able to utilize those new operations as long as their game tells them its 1.168 in the launcher?
Yes, why not...
Wouldn't make any sense if it would work like you said.
 
Status
Not open for further replies.
Back
Top Bottom