Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Code:
far_plane_distance = 2500 #clip distance, was 1250 first, was 2000 second
It's the maximum distance(in meters) in which an object will render for a user. Enlarge this if you want to use bigger/better/longer border terrains for example, and have the player be able to view them. In my mod it's set to 10 000.
h9YBqzN.jpg

I think that use_phased_reload refers to musket and phased reload, basically reloading is split into 3-4 sequences and if you break reloading at the 3rd sequence, when you start reloading again it'll start form that point instead of reloading from the start.

The others I never edited.
 
Anyone knows what makes Looters spawn in bandit lairs? I looked at party templates and they're not present in any of them but they still spawn during an attack on a bandit lair. Looters have worthless loot so when they start spawning instead of actual bandits I can't help but feel cheated by the game.
 
Maluxorath said:
Anyone knows what makes Looters spawn in bandit lairs?

check the "bandit_lair" menu (module_game_menus.py), as it has code to select the scene and type of troop for each lair.

reinforcements waves are a different system. Look at the mission template (module_mission_templates.py) triggers that handles then
Code:
	   (30, 0, 0, 
	   [
	     (le, "$defender_reinforcement_stage", 1),
	   ],
	   [
...
         (else_try),
            (this_or_next|eq, ":template", "pt_looter_lair"),
            (neq, ":random_value", 0),
            (assign, ":bandit_troop", "trp_looter"),
          (try_end),
....
and
Code:
      (ti_on_agent_killed_or_wounded, 0, 0, [],
       [
....
 
I'm adding items from a firearms osp to native. I believe I got all the prerequisite steps in having the resources and textures for the osp situated. My intention is not to modify a preexisting item entry, and tutorials seem based on using preexisting item entries. The osp came with item codes for module_items.py in module system. I added the item codes after the bows/crossbow entries in module_items.py . After building the module, these osp items didn't appear in Morgh's Editor and didn't appear in items_kinds1.txt in module folder.
It appears that the module system is not building the new items.
Is this true? How do I fix this?
Thanks
 
andbev said:
Is this true? How do I fix this?

check your module_info.py, as it has the folder where your new .txt files will go to.

open that folder and check if the files were created after compilation (build_module.bat). You can see the date of last modified for each file like scripts.txt. If not, something is wrong either with your path or you lack permission to change files (Windows).

if in doubt post your new code here and the log from compilation.
 
kalarhan said:
open that folder and check if the files were created after compilation (build_module.bat). You can see the date of last modified for each file like scripts.txt. If not, something is wrong either with your path or you lack permission to change files (Windows).

Interesting the module folder's text file are not being updated. I scroll down in the directory containing the module and I see this dump of text files from complilation(date of edit verified) , the text files are ex: ModuleNameTextFileName.txt .
I checked my slashes in module_info.py and I don't see anything there that would cause this.
Why is this happening?
 
andbev said:
I checked my slashes in module_info.py and I don't see anything there that would cause this.

that is why you should post your code so we can also see it  :wink:, and also your log.

in this case it seems you forgot the last slash
 
kalarhan said:
you forgot the last slash
I had a feeling you would say that. I needed some form of confirmation because this probably was the reason why I had previous problems with map modding.
In other words that worked :grin:
Thanks
 
A couple of quick questions:

1. a) Is it possible to create a higher resolution texture for an existing mesh without having to export to a 3D program and without chaning its uv map?

b) If yes, how would I have to go about it? Just scaling the original texture and then improving said texture?

2. In Viking Conquest dogs and farm animals are not showing any text if you mouse over them in a scene (eg the name and the prompt to mount them). How is this effect achieved? I looked into the module system of VC but found no code which was obviously related to suppressing this text prompt you get with every horse. Could it be that the operation "agent_ai_set_interact_with_player" is responsible for that? "slot_agent_is_blocked" seems to be only used for human agents in scenes, specifically for agents who are doing custom animations like fishing, reading, wood cutting etc.

Thanks in advance for any advice.
 
DerGreif said:
2. In Viking Conquest ... "agent_ai_set_interact_with_player" ... "slot_agent_is_blocked" ...

combination of both, you can search the game code to see how they are used (include multi_scripts.py "cf_prop_spawn_agent" on your search).
 
kalarhan said:
DerGreif said:
2. In Viking Conquest ... "agent_ai_set_interact_with_player" ... "slot_agent_is_blocked" ...

combination of both, you can search the game code to see how they are used (include multi_scripts.py "cf_prop_spawn_agent" on your search).
Thank you for the quick answer!

I had already read this script. The only code which might be related to the effect I mentioned is "agent_ai_set_interact_with_player". "slot_agent_is_blocked" is used in one script regarding town walkers and in mission_templates, but seems also only related to human agents, not animals. I also see no code there which could suppress this text prompt. Therefore I will try "agent_ai_set_interact_with_player". Lav had no explanation for that either in his header operations.

If anybody else has an idea for my other question, I would be very greatful.
 
DerGreif said:
"slot_agent_is_blocked"

is used for any agent as a flag to enable/disable other features (like walkers, sound effects, etc) that you may have in the game. That can include animals that are spawned as normal agents but should not move, or any agent spawned as part of the prop script. Note how animals use the "spawn_horse" operation, so they use the correct skeleton / animations. But they are still agents.

a example: you spawn a agent and sets him with a custom animation. You don't want that agent animation/movement to be overridden by the walker trigger. The flag is there to filter him out.
 
In a menus, I want to change the time, examle after 16 years, 1 mounth, 15 days,
(
    "cocuk_buyudu",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "After 16 years, 1mounth 15 days.",
    "none",
    [(set_background_mesh, "mesh_pic_mb_warrior_1"),],
    [

("continue",[],"Continue.",
      [
 
    (val_add, ":cur_year", 16),(val_add, ":cur_month", 1),(val_add, ":cur_day", 15),
  (change_screen_map),(finish_mission),
  ]), ]
  ),
But :cur_years is a local varrieble and not work, how can I assign this?

edit:
I used look like  ----(assign, ":cur_year", 1226),  (val_add, ":cur_year", 16),--- but still not work.
 
frozenpainter said:
I used look like  ----(assign, ":cur_year", 1226),  (val_add, ":cur_year", 16),--- but still not work.

you need to use operations to get and set values within the engine.

Code:
# Time-related operations

store_current_hours        = 2270  # (store_current_hours, <destination>),
                                   # Stores number of hours that have passed since beginning of the game. Commonly used to track time when accuracy up to hours is required.
store_time_of_day          = 2271  # (store_time_of_day, <destination>),
                                   # Stores current day hour (value in 0..24 range).
store_current_day          = 2272  # (store_current_day, <destination>),
                                   # Stores number of days that have passed since beginning of the game. Commonly used to track time when high accuracy is not required.

see script "game_get_date_text" to change the displayed year. Remember that has no relation with the game time that affects things like triggers and events (like getting rent from a village every week).
 
I used at a game_menus look like:
(store_current_day, ":time_passed_2"),
    (store_add, ":time_passed_2", 5840),
error in build time_passed_2 local varrieble unreognized.
I used look like but not work.
(store_current_day, ":time_passed_2"),
(val_add, ":time_passed_2", 5840)

editAnother question
In mission templates used this, but game stop runnig.
(ti_before_mission_start, 0, ti_once,
        [],
        [
            (get_player_agent_no, ":player_agent"),
            (agent_get_position, pos0, ":player_agent"),
            (set_spawn_position, pos0),
            (spawn_agent, "$han_kavgaci"),
(assign,"$han_kavgaci",reg0),
(troop_add_item, "$han_kavgaci", "itm_staff"),
(troop_equip_items, "$han_kavgaci"),

                      (agent_set_team, reg0, 2),
                      (agent_add_relation_with_agent, ":player_agent", reg0, -100),
                      (agent_ai_set_aggressiveness, reg0, 199),
        ]),
 
frozenpainter said:
I used look like but not work.
(store_current_day, ":time_passed_2"),
(val_add, ":time_passed_2", 5840)

that will never work. You are trying to add a value to a random local variable, which has no meaning to the engine, and expecting it to somehow update the game date. Review tutorial on what variables are for: https://forums.taleworlds.com/index.php/topic,142422.0.html

like I mentioned above if you want to update the displayed date (ex: year 900 jump to year 950) you need to use the script listed (which is called by the engine)
 
Status
Not open for further replies.
Back
Top Bottom