Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
dlwnsdn4 said:
can i use python and notepad on Elinux system? and also playable?

you can play and do modding on Linux, but with the caveat that Ubuntu is the official supported distribution (+ Steam OS). Try to use another one and it is up to you to make it work. Also, using a embedded Linux to play the game makes no sense, unless you want somehow to play it on your microwaves  :mrgreen:

If you want to use Linux on a Windows machine: dual boot, VM or the new Win10 built in.

You will have issues like not having Edit Mode, tools that were created for win32, etc, which means you will have to use wine (your problem to make them work too).

Python (modsys) won't have any issues.

oh thank you... i think buying windows system computer is better..
 
Trader4444 said:
and if do I want simply that a game proceeded post mortem hero, how to me to it to come?
or is it possible simply thus to take a necessary code, then kompile a file and insert back in native?
Mods, such as Diplomacy, Floris, etc already have a Deathcam included, so that after the player hero dies, the fight will continue.
You can use such a mod as your base to include your own mods, or copy the necessary code for "DeathCam" from that module system and insert it back into your native module system.
 
Fire_and_Blood said:
Is the towns menu limited in the amount of options that can be displayed?

game menu is a hardcoded presentation.

if you have too many options for a menu, simple break it in a chain of menus (like how you go for the stores options). One menu calling the next. As a alternative you can create your own using a presentation (like VC did). You can also move things around by editing game_variables.txt

Remember that humans have issues handling more than 6 things at the same time, so you should avoid menus with too many options  :mrgreen:
 
How does one run a presentation after a script?

Tried the following in game_menus, but it just jumps straight to the world map.
Code:
("fb_cheat_build_village",[], "Build new village here",
    [ 
    (call_script, "script_build_village", -1),
    (start_presentation, "prsnt_name_fief", reg1),
    (change_screen_return),
     ]
  ),
 
I want to make so the player can only recruit from a village if he is the lord of said village, this is related to this script right?

Code:
   #script_cf_village_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_village_recruit_volunteers_cond",
    [
     (neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
     (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
     (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
     (store_faction_of_party, ":village_faction", "$current_town"),
     (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
     (store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
     (ge, ":center_relation", 0),
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":village_faction", "$players_kingdom"),
     (this_or_next|ge, ":village_faction_relation", 0),
     (this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
     (eq, "$players_kingdom", 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),
    ]),

What do I need to change/add here for it to work like I want?
 
You want to add the following condition
#script_cf_village_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_village_recruit_volunteers_cond",
    [
    (party_get_slot, ":town_lord", "$current_town", slot_town_lord),
    (eq, ":town_lord", "trp_player"),

    (neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
    (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
    (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
    (store_faction_of_party, ":village_faction", "$current_town"),
    (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
    (store_relation, ":village_faction_relation", ":village_faction", "fac_player_faction"),
    (ge, ":center_relation", 0),
    (this_or_next|ge, ":center_relation", 5),
    (this_or_next|eq, ":village_faction", "$players_kingdom"),
    (this_or_next|ge, ":village_faction_relation", 0),
    (this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
    (eq, "$players_kingdom", 0),
    (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
    (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (ge, ":free_capacity", 1),
    ]),
 
Fire_and_Blood said:
How does one run a presentation after a script?

Tried the following in game_menus, but it just jumps straight to the world map.
Code:
("fb_cheat_build_village",[], "Build new village here",
    [ 
    (call_script, "script_build_village", -1),
    (start_presentation, "prsnt_name_fief", reg1),
    (change_screen_return),
     ]
  ),

you don't need the change_screen command, and the start_presentation has only one parameter (the presentation ID)
Code:
start_presentation                                =  900  # (start_presentation, <presentation_id>),
                                                          # Starts the specified presentation.

Also "How does one run a presentation after a script?" is the wrong question, as what you can do and how varies depending if you are on a dialog, a presentation, the world map, inside a scene, using a menu, using a engine script hook, etc. The other part "from a game menu" is the way to think about this sort of a problem.
 
Fire_and_Blood said:
Trader4444 said:
and if do I want simply that a game proceeded post mortem hero, how to me to it to come?
or is it possible simply thus to take a necessary code, then kompile a file and insert back in native?
Mods, such as Diplomacy, Floris, etc already have a Deathcam included, so that after the player hero dies, the fight will continue.
You can use such a mod as your base to include your own mods, or copy the necessary code for "DeathCam" from that module system and insert it back into your native module system.

I have code, the problem is how to insert it, so that it all works. In other words make tweak in current game.



EmielRegis? said:
please, is it possible in other words? I can not correctly translate into Russian
Sorry myself cant correctly translate there wordes to polish

:smile:
 
Fire_and_Blood said:
"Imported xx global variables for save-game compatibility." How can I delete them and start fresh, with only the variables actually used?

just delete the variables.txt from your modsys folder and a new one will be created. Savegame compatibility is kept by adding new variables at the end of the file (as their position is saved in the savegame file).
 
Thank you. That worked.

Is there a way to retrieve a flag from a party, in order to check, whether a certain flag is set for a party? In header_operations, there seems to be only "party_set_flags".
 
Fire_and_Blood said:
Is there a way to retrieve a flag from a party, in order to check, whether a certain flag is set for a party? In header_operations, there seems to be only "party_set_flags".

if you don't have a get operation, then you can use a slot to store that value (a copy of the flag) and check it from the slot. For flags that come from module_parties.py or module_party_templates.py you would need to also use slots at game_start (initial value).

a old example was to set a copy of item stats like weight using slots. That was later replaced by a direct operation call.
 
Fire_and_Blood said:
Thank you. That worked.

Is there a way to retrieve a flag from a party, in order to check, whether a certain flag is set for a party? In header_operations, there seems to be only "party_set_flags".

Code:
party_has_flag                  = 3902 #(party_has_flag, <party_no>, <flag>), #Fails if <party_no> doesn't have <flag>
 
Efe Karacar said:
Code:
party_has_flag                  = 3902 #(party_has_flag, <party_no>, <flag>), #Fails if <party_no> doesn't have <flag>

note: that would require WSE



we got a Pastebin button now
pastebin.gif
, see @Janus post https://forums.taleworlds.com/index.php/topic,371523.0.html

Example from his post:
 
Fire_and_Blood said:
When writing a dialogue menu. How does one insert breaks, so the text starts from a new line? Trying to make it display a list.

Use "^^" to break line.

Reference for a line
Code:
# Ruler
# "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"


Native example to keep the code easy to read
Code:
  [anyone, "minstrel_courtship_poem_teach_3", [
  (eq, "$poem_selected", courtship_poem_mystic),
  ],  
   "Very well -- repeat after me:^\
   You are the first and the last^\
   the outer and the inner^\
   When I drink from the cup of love^\
   I escape the tread of time^\
   A moment in solitude with you^\
   Would have no beginning and no end", 
   "minstrel_courtship_poem_teach_4", []],
Note the "\" that breaks the Python line without breaking the string (in-game line). Python sees just one line "Very well -- repeat after me:^ You are the first and the last^  the outer and the inner^...".
Also note the use of spaces "  " to control the aligment

Code:
  [anyone, "fighter_talk_train_parry",
   [
     (get_player_agent_no, ":player_agent"),
     (agent_has_item_equipped, ":player_agent", "itm_practice_sword"), #TODO: add other melee weapons
     ],
   "Unlike a shield, blocking with a weapon can only stop attacks coming from one direction.\
 For example if you block up, you'll deflect overhead attacks, but you can still be hit by side swings or thrust attacks.\
 ^^(You must press and hold down the right mouse button to block.)", "fighter_talk_train_parry_2", [ ]],



Fire_and_Blood said:
Trying to make it display a list.
Avoid using "#" on your String as a special character, it can make using the automatic indentation a bit tricky. Just in case you are looking for a character for the list.
 
Status
Not open for further replies.
Back
Top Bottom