Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
In edit mode, ai mesh,  I cant use face mode, edit mode look like:
HBy298.jpg
How can I fix this?
 
Hi guys, I have a question;

Can someone tell me how I can fix the horse archers in native(diplomacy+pbod)?

https://forums.taleworlds.com/index.php/topic,366006.0.html
There is this script to do just that. But I don't know where I have to use it exactly and how to.
So I would appreciate it if you guys could help a noob such as me, out.:smile:
 
Avareee said:
Hi guys, I have a question;

Can someone tell me how I can fix the horse archers in native(diplomacy+pbod)?

https://forums.taleworlds.com/index.php/topic,366006.0.html
There is this script to do just that. But I don't know where I have to use it exactly and how to.
So I would appreciate it if you guys could help a noob such as me, out.:smile:

The functions used in that script were introduced in 1.163 or whatever. IIRC diplomacy+pbod requires 1.153 or so.
 
aleeque said:
Avareee said:
Hi guys, I have a question;

Can someone tell me how I can fix the horse archers in native(diplomacy+pbod)?

https://forums.taleworlds.com/index.php/topic,366006.0.html
There is this script to do just that. But I don't know where I have to use it exactly and how to.
So I would appreciate it if you guys could help a noob such as me, out.:smile:

The functions used in that script were introduced in 1.163 or whatever. IIRC diplomacy+pbod requires 1.153 or so.

Ah, yes. I came to realize lol. Module.bat wasn't accepting the commands. Now thats why.

Thank you:smile:

EDIT: Yes I'm on 1143 version used that to make pbod and stuff work. Do you know if I could get something like pbod(I hate ai decisions) or diplomacy on the newest version? I was away from warband for years now and just aren't up to date
 
MadGuarang said:
HI All!

In my mod player can give orders to scouts and patrols of his own faction. (Yes, I made patrols, scouts and mercenaries to spawn again , but it is not the matter here).

So I give them orders like Patrol around town X and it works fine. However when I tell them to attack stronger enemy they always run away, changing their minds.

If I ask them to escort me it is the same, they see bigger army and come back after *I* deal with it.

So these descriptions from Lav's say:
Code:
                                             # Retrieves what position is currently used as object for AI behavior.
get_party_ai_current_behavior         = 2293  # (get_party_ai_current_behavior, <destination>, <party_id>),
                                              # Retrieves current AI behavior pattern when it was overridden by current situation (fleeing from enemy when en route to destination).
get_party_ai_current_object           = 2294  # (get_party_ai_current_object, <destination>, <party_id>),
                                              # Retrieves what party has caused temporary behavior switch.

that any ai army change its behaviour 'because something is happened' for example they met stronger army and decided to flee instead of fighting for me.

I have tried to mess with 'helpfulness' and 'courage', 'aggressivnes' but that doesn't help.

Is there any way, to turn off their AI and FORCE them to to my biddings?
Agents have this 'scripted mode' but is there something like that for parties?

1. You can override AI behavior with flag

pf_default_behavior = 1

2. When you attack an enemy party the script gather all nearby friendly parties leaded by NPC lords. You need to manualy create a script to gather other parties on the map.

I have tried to create some behavior but not very interested now. https://forums.taleworlds.com/index.php/topic,381765.0.html
 
elcapo29 said:
So I tried to change the background of the main screen and I lost the text, start a new game, etc..
Is there a good tutorial for changing the starting screne?

you can change the position and size of the buttons/text using the game_variables.txt file definitions. You dont need to follow Native layout.

You can also use the presentation "game_start" to add dynamic content like a custom text, etc. VC, as a example, uses it to display the game version.
 
Guys in a menu, if I click menu and 12 hours is past display a message.
I want to reset current hours when I click this menu, can you help me?
("tunel_tamamlandi",[],"attack by tunnel with men",[(store_current_hours, "$tunel_saat"),
          (try_begin),
            (ge, "$tunel_saat",  12),
(display_message, "@tunel is ready, you are attack"),(assign, "$tunel_saat",0), #reset for current hours
(else_try),
(display_message, "@tunel is not ready"),
(try_end),


]),
I added this for reset hours but not work. 
(assign, "$tunel_saat",0),
 
Your problem is to assign the global to 0. It uses string messages to verify global values and other variables, @kalarhan always says it, he's not wrong, it helps a lot. :grin: I also advise you to move the global reset to another menu, for example the one that accesses the scene of the ...Tunnel?
Something quick...
("tunel_tamamlandi", [],
"Attack by tunnel with men.",
[
(store_add, ":end_hour", "$tunel_saat", 12),
(store_current_hours, ":cur_time"),
(try_begin),
(ge, ":cur_time", ":end_hour"),

(store_current_hours, "$tunel_saat"), #assign global
(try_begin),
(ge, "$cheat_mode", 1), #debug

(assign, reg0, ":cur_time"),
(assign, reg1, ":end_hour"),
(assign, reg2, "$tunel_saat"),
(display_message, "@{!}DEBUG -- cur_time=({reg0} >= {reg1})end_hour(tunel_saat {reg2} + 12)^Tunel is ready."),
(else_try),
(display_message, "@Tunel is ready, you can start the attack."),
(try_end),
(else_try),
(try_begin),
(ge, "$cheat_mode", 1), #debug

(assign, reg0, ":cur_time"),
(assign, reg1, ":end_hour"),
(assign, reg2, "$tunel_saat"),
(display_message, "@{!}DEBUG -- cur_time=({reg0} >= {reg1})end_hour(tunel_saat {reg2} + 12)^Tunel is not ready."),
(else_try),
(store_sub, reg3, ":end_hour", ":cur_time"),
(store_sub, reg4, reg3, 1),
(display_message, "@Tunel is not ready. You need to wait {reg3} {reg4?hours:hour}."),
(try_end),
(try_end),
]
),
 
I add a new mission templates, for siege battle, I added this for new wawe coming.
common_siege_defender_reinforcement_check,
      common_siege_defender_reinforcement_archer_reposition,
      common_siege_attacker_reinforcement_check,
But just defender reinforcement coming when defender number decreased, but attacker reinfrocement not coming why?
edit: All attackers dead but still new attackers wawe not coming.
(
    "tunel_kale",mtf_battle_mode,-1,
    "Default town visit",
    [
    (1, mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,9,[]),  #player and army
    (10, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (11, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (15, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (40, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (41, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (42, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (43, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (44, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (62, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
    (63, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]), #enemy
 
kalarhan said:
frozenpainter said:
I add a new mission templates, for siege battle, I added this for new wawe coming.

check the global values, in special your init values.
I added 2 new triggers for reinforcement, attackers reinforcement not come but defender reinforcement come 4 times in 10 seconds,
player is attackers and team_1, defenders enemy team_2, other problem is: when battle started, number of defenders growt then 15 but reinforcement coming, why?
Code:
tunel_attackers_reinforce = (
  1, 0, 5,
  [
    (store_normalized_team_count,":num_attackers",1),
    (lt,":num_attackers",15)
    ],
  [
    (add_reinforcements_to_entry, 1, 8),
    ])	
tunel_defenders_reinforce = (
  1, 0, 5,
  [
    (store_normalized_team_count,":num_attackers_2",0),
    (lt,":num_attackers_2",15)
    ],
  [
    (add_reinforcements_to_entry, 1, 8),
    ])
(
    "tunel_kale",mtf_battle_mode,-1,
    "Default town visit",
    [
    (1, mtef_attackers|mtef_team_1,af_override_horse,aif_start_alarmed,9,[]),
    (10, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (11, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (15, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (40, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (41, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (42, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (43, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (44, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (62, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
    (63, mtef_defenders|mtef_team_0,af_override_horse,aif_start_alarmed,1,[]),
 
frozenpainter said:
    (add_reinforcements_to_entry, 1, :cool:,

both triggers using the same spawn record

Code:
add_reinforcements_to_entry              = 1930  # (add_reinforcements_to_entry, <mission_template_spawn_record>, <wave_size>),
                                                 # For battle missions, adds reinforcement wave to the specified spawn record (not the entry point). Additional parameter determines relative wave size. Agents in reinforcement wave are taken from all parties of the side that the entry point belongs to due to mtef_team_* flags.

Code:
#  5) List of spawn records (list): Each spawn record is a tuple that contains the following fields:
#    5.1) entry-no: Troops spawned from this spawn record will use this entry

remember that spawn record != entry point
 
I'm trying to learn arrays and while I know what I need to do with them, I can't completely figure them out. I want to create an array that stores items for troops like a virtual inventory and have that inventory apply itself every time the game is loaded. I've read the dynamic arrays post and this is most definitely what I want to use but I can't figure out or find an example of how I would create an item array for troops. Any help would be greatly appreciated. Also, I'm open to examples of how to use other types of arrays, like slots and whatever else there may be. Thanks.
 
Hi!
I am developer of PARADIGM WORLDS https://www.moddb.com/mods/paradigm-worlds

I have a huge issue, and as for last 4 month tried to locate my problem I have failed many times. From almost perfect running mod my work changed into a festival of unknown bug, or whole set of bugs. My coding ability is very limited, and I don't know really what to do at this point.

PROBLEM: World map stutter. Around 2-3 weeks (in-game) it begins to stutter, first just a little, but with every day it is worse and worse. My 1.00 version of mod was stutter-free, but all next versions (up to 1.20)  seem to have this stutter problem. I sacrificed around lots of time (4 month+)  trying to locate the issue, but I have failed.

1. Did anyone have such an issue - MAP STUTTER? What can be a reason for that?
2. Between 1.00 and 1.20 there were lots of changes but I wonder if that stutter does have anything with WEATHER effects. In Warband this fog / haze is disabled and I brought it back, is it possible that TW turned it off because it was causing troubles?
3. Is there any tool for monitoring game engine / debugging / performance  so at least I could see what I am dealing with?


There are many people counting on me, so I cannot just close project and tell them that I failed. Of course it is also important to me. When you spend over 2 years of your life and you see how your project is developing into smth really interesting it is very painful to see it falling down now.  Any help very much appreciated. I can upload code or anything that could be needed.

Please at least point me at some direction...

UPDATE: Just to clarify, stuttering problem happens only on world map,  battles, even large 250+ work great.
 
MadGuarang said:
Hi!
I am developer of PARADIGM WORLDS https://www.moddb.com/mods/paradigm-worlds

I have a huge issue, and as for last 4 month tried to locate my problem I have failed many times. From almost perfect running mod my work changed into a festival of unknown bug, or whole set of bugs. My coding ability is very limited, and I don't know really what to do at this point.

PROBLEM: World map stutter. Around 2-3 weeks (in-game) it begins to stutter, first just a little, but with every day it is worse and worse. My 1.00 version of mod was stutter-free, but all next versions (up to 1.20)  seem to have this stutter problem. I sacrificed around lots of time (4 month+)  trying to locate the issue, but I have failed.

1. Did anyone have such an issue - MAP STUTTER? What can be a reason for that?
2. Between 1.00 and 1.20 there were lots of changes but I wonder if that stutter does have anything with WEATHER effects. In Warband this fog / haze is disabled and I brought it back, is it possible that TW turned it off because it was causing troubles?
3. Is there any tool for monitoring game engine / debugging / performance  so at least I could see what I am dealing with?


There are many people counting on me, so I cannot just close project and tell them that I failed. Of course it is also important to me. When you spend over 2 years of your life and you see how your project is developing into smth really interesting it is very painful to see it falling down now.  Any help very much appreciated. I can upload code or anything that could be needed.

Please at least point me at some direction...

UPDATE: Just to clarify, stuttering problem happens only on world map,  battles, even large 250+ work great.

It surely has to do something with number of parties on the world map and unoptimized triggers.
What's the average savegame size of your mod?
 
It surely has to do something with number of parties on the world map and unoptimized triggers.
What's the average savegame size of your mod?

Garedyr - You probably do not remember, but you were the first person that introduced me into a warband coding, and cannibalism kit was my first code I have applied to my mod. You're 1st on my credit list :smile:

1. Average save is around 7-10 MB.   
2. Yes, I have a lot of parties on my map, but same I did in previous stutter-free version. I also reduced amount of parties just to see would that help and I still had that issue.
3. Triggers - I have added some triggers for town's improvement's but they are mostly 7*24 or 30*24.    Is there any way to track how do they affect game performance?  Then again my issue is that 1.00 with more parties on world map worked a lot better, than less parties in 1.20 of mod version.

I am opened for any suggestions, really!
 
Iron Sight said:
I'm trying to learn arrays and while I know what I need to do with them, I can't completely figure them out. I want to create an array that stores items for troops like a virtual inventory and have that inventory apply itself every time the game is loaded. I've read the dynamic arrays post and this is most definitely what I want to use but I can't figure out or find an example of how I would create an item array for troops. Any help would be greatly appreciated. Also, I'm open to examples of how to use other types of arrays, like slots and whatever else there may be. Thanks.

first review this tutorial, in special the SLOT section https://forums.taleworlds.com/index.php/topic,142422.0.html

the system is 0-based. Entities can have a array of data (the slots), like a TROOP. What you can do is use a fake troop (not a actual character or soldier in the game) as a storage, and its slots to save the values you need.

example from VC:
Code:
### These are used as arrays in the scripts. 
  ["temp_array_a","{!}temp_array_a","{!}temp_array_a",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[],def_attrib|level(18),wp(60),knows_inventory_management_10, 0],
  ["temp_array_b","{!}temp_array_b","{!}temp_array_b",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[],def_attrib|level(18),wp(60),knows_inventory_management_10, 0],
  ["temp_array_c","{!}temp_array_c","{!}temp_array_c",tf_hero|tf_inactive, 0,reserved,  fac_neutral,[],def_attrib|level(18),wp(60),knows_inventory_management_10, 0],

keep in mind that inventory/items are not a singular value. You have item_ID, quantity (when it is a ammo) and IMOD to save, so you will need to work with those 3 values for each item.

 
Status
Not open for further replies.
Back
Top Bottom