Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
kalarhan 说:
HarryPham123 说:
hi there so i have try to add Formation

I would use the VC version instead (same author), just remember to give credit. Download VC modules and should be easy to find the mission_template triggers and which scripts you need to use.

Besides being a superior version it also uses new engine operations, which reduce the performance hit of the feature (less lag)

if i use vc version where can i find it ??
 
When I set certain skills for certain troops in module system the expected values are not correct in the compiled module.

For example, troop X has 3 Power Strike and 3 Power Draw in code, but in game it shows as 4 Power Strike and 4 Power Draw. However troop Y has the same stats and there is no difference between code and game character sheet. They are using only knows_common besides that so as far as I know that shouldn't affect it and removing it has no effect on this problem.

Some troops are affected and some are not, and the skills with unexpected values seem to be completely random.

I looked online for answers and the best I could find is a claim that the game engine randomises stats (to a degree) at initialisation of a new game for each troop.

Whether this is true or not, I have not noticed it before, so my question is, what is the solution to this? I do not want any randomisation of stats, I prefer each troop has exactly what I give it in code.
 
Eschaton 说:
When I set certain skills for certain troops in module system the expected values are not correct in the compiled module.

For example, troop X has 3 Power Strike and 3 Power Draw in code, but in game it shows as 4 Power Strike and 4 Power Draw. However troop Y has the same stats and there is no difference between code and game character sheet. They are using only knows_common besides that so as far as I know that shouldn't affect it and removing it has no effect on this problem.

Some troops are affected and some are not, and the skills with unexpected values seem to be completely random.

I looked online for answers and the best I could find is a claim that the game engine randomises stats (to a degree) at initialisation of a new game for each troop.

Whether this is true or not, I have not noticed it before, so my question is, what is the solution to this? I do not want any randomisation of stats, I prefer each troop has exactly what I give it in code.

I THINK, if you really want to get around this, is give troops 10 in skills that are useless to them, like Inventory Management or Trade.

As I understand it, the game will randomise skill points to a degree, based on level, if it deems there are 'spare' skill points remaining. The higher level a troop is, the more skill points there will be for the game to randomly allocate.

However, if you max out skills like Inventory Management, that's 10 skill points it has to put into the troop, and less potential 'spare' skill points it has to spend afterwards, if any at all; troops will have a minimum score in each skill you set, which may mean there are no 'spare' skill points to spend after the fact.

Hopefully this makes sense, it's very late where I am.
 
@Cait If that's the case it would explain why so many troops I've seen seem to have random skills like inv management etc :smile:.  Seems like a weird mechanic to include in the first place though.

Btw what is your avatar from?
 
TheCaitularity 说:
As I understand it, the game will randomise skill points to a degree, based on level, if it deems there are 'spare' skill points remaining. The higher level a troop is, the more skill points there will be for the game to randomly allocate.

What you said makes perfect sense, and it also solved my problem and now I'm aware of this mechanic for the future. Thanks!
 
Hey guys! So, I'm trying to get Caba's Skirmish Script working for TLD (Warband Version), but I ran into a few problems. I wasn't able to get the original script working due to a problem with slot_agent_start_running_away, so I borrowed a modified version from Motomataru. However, I'm not entirely sure what to do with the instructions. Here is the Skirmish Code by Caba: https://forums.taleworlds.com/index.php?topic=137970.0 This is the original message from Motomataru.
motomataru 说:
So there's a script that actually makes them run or stop. It may be called script_order_skirmish_skirmish. I have this for Caribbean, inside an agent loop:

插入代码块:
      agent_get_slot, ":closest_enemy", ":agent", slot_agent_nearest_enemy_agent
      neq, ":closest_enemy", -1
      agent_get_position, pos0, ":closest_enemy"
      get_distance_between_positions, ":closest_dist", pos0, pos1
插入代码块:
    try_begin
      lt, ":closest_dist", skirmish_min_distance # #one enemy particularly close
      agent_slot_eq, ":agent", slot_agent_skirmish_run_away, 0
      agent_start_running_away, ":agent"
      agent_set_slot, ":agent", slot_agent_skirmish_run_away, 1
    else_try
      ge, ":closest_dist", skirmish_max_distance # #If distance from enemy is (too) large, resume previous order
      agent_slot_eq, ":agent", slot_agent_skirmish_run_away, 1
      agent_stop_running_away, ":agent"
      agent_set_slot, ":agent", slot_agent_skirmish_run_away, 0
      agent_force_rethink, ":agent"
    try_end # #Distance to enemy
Instead of agent_start_running_away, one might have:
插入代码块:
  (call_script, "script_point_y_toward_position", pos0, pos1), #point closest enemy position at agent's position
  (position_move_y, pos0, ":skirmish_dist_in_cm"),
  (agent_set_scripted_destination_no_attack, ":agent", pos0),
Note this works only for mission templates which have the data collection script_store_battlegroup_data running.

Then you have to make sure you don't run off the map, etc.
I assumed he meant that I can just replace Caba's script_order_skirmish_skirmish code with this one, so I added the necessary slots into module_constants, added parentheses and commas in the right places, and then put it all together, giving me this:
插入代码块:
("order_skirmish_skirmish", [ 
(agent_get_slot, ":closest_enemy", ":agent", slot_agent_nearest_enemy_agent),
      (neq, ":closest_enemy", -1),
      (agent_get_position, pos0, ":closest_enemy"),
      (get_distance_between_positions, ":closest_dist", pos0, pos1),
 (try_begin),
      (lt, ":closest_dist", skirmish_min_distance # #one enemy particularly close),
      (agent_slot_eq, ":agent", slot_agent_skirmish_run_away, 0),
      (call_script, "script_point_y_toward_position", pos0, pos1), #point closest enemy position at agent's position
      (position_move_y, pos0, ":skirmish_dist_in_cm"),
      (agent_set_scripted_destination_no_attack, ":agent", pos0),
      (agent_set_slot, ":agent", slot_agent_skirmish_run_away, 1),
      (else_try),
      (ge, ":closest_dist", skirmish_max_distance), # #If distance from enemy is (too) large, resume previous order
      (agent_slot_eq, ":agent", slot_agent_skirmish_run_away, 1),
      (agent_stop_running_away, ":agent"),
      (agent_set_slot, ":agent", slot_agent_skirmish_run_away, 0),
      (agent_force_rethink, ":agent"),
   (try_end), # #Distance to enemy
 ]),
However, when I compiled the mod, these errors showed up.
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations for Warband...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data for Warband...
Exporting scripts...
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
WARNING: Script can fail at operation #1. Use cf_ at the beginning of its name:
order_skirmish_skirmish
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :skirmish_dist_in_cm in script 'order
_skirmish_skirmish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
ERROR: Usage of unassigned local variable: :agent in script 'order_skirmish_skir
mish'
## ignore this ## WARNING: Local variable never used: agent_no, at: change_formation in script 'ch
ange_formation'
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Exporting postfx_params for Warband...
Checking global variable usages...
WARNING: Global variable never used: cbadvantage
WARNING: Global variable never used: g_last_defeated_bandits_town
WARNING: Global variable never used: faction_good
WARNING: Global variable never used: faction_evil
item count: 914/915 ... ok.
map icons: 251/256 ... ok.
______________________________

Script processing has ended.
Press any key to restart. . .
I'm really very new to scripting, and I don't know python at all, I'm just experimenting here. What am I doing wrong here? And also, what does Moto mean about having "script_store_battlegroup_data" running, and how can I make it run?
 
CrazyOldTeenager 说:
Hey guys! So, I'm trying to get Caba's Skirmish Script working for TLD (Warband Version), but I ran into a few problems.

not gonna work, @moto was giving you snippets of the code, not the entire thingy, so you can adapt your own (from Cabal). That will require some know how on coding as you assumed, and testing, testing, testing

are you even using "script_store_battlegroup_data" ?
 
I'm aware that it's not the full code, I'm assuming that this would just replace the "script_order_skirmish_skirmish" section. I tried to get Caba's original code working, and I succeeded in getting the code set up with with all necessary slots added and with no errors on compilation, but it seems TLD has some trouble with the "slot_agent_start_running_away" constant, so it didn't work ingame.

As for "script_store_battlegroup_data", I'm actually not quite sure what that is.  :mrgreen:
 
CrazyOldTeenager 说:
As for "script_store_battlegroup_data", I'm actually not quite sure what that is.  :mrgreen:

are you using the OSP from 2010?

If you don't know about that script it means you are using old code. Engine was updated for games like VC, and new scripts were created to reduce lag. That one is a example.

You may get what you need from VC code (compare Cabal's, VC and your own version). You may need help from someone with coding experience, which you should have on your team (unless things changed).

Ah and not sure if you want keep it compatible with M&B, not just Warband, which would means all this talk is about stuff you can't use.
 
Eschaton 说:
TheCaitularity 说:
As I understand it, the game will randomise skill points to a degree, based on level, if it deems there are 'spare' skill points remaining. The higher level a troop is, the more skill points there will be for the game to randomly allocate.

What you said makes perfect sense, and it also solved my problem and now I'm aware of this mechanic for the future. Thanks!

Hooray! \o/

kraggrim 说:
@Cait If that's the case it would explain why so many troops I've seen seem to have random skills like inv management etc :smile:.  Seems like a weird mechanic to include in the first place though.

Btw what is your avatar from?

I guess it's to add some variance with the troops in combat - some mounted troops would be slightly faster, or be able to take one more hit, stuff like that. I'm glad it's there, but it's not obvious either while playing or modding.

My avatar was made by a friend of mine, kind of on a whim, aaages ago. Funnily enough, she originally did it in green on a white background, I inversed it and found I liked that colour scheme a lot more.
 
Ive been looking for some animations, but no matter how much i look for them, i cant find where they are. I know that animations of Warband should be in CommonRes, and ive been going through all ani_ and uni_ files, but still havent found what im looking for

So i would need to find

greatsword defense animations
flintlock pistol animations
bow animations

Thanks to a suggestion i tried searching with OpenBrf search, and found still nothing.
 
just look for them in module_animations.py, from there its much easier to find the one youre looking for
 
hello everyone i have a question i hope you can answer! I currently work on mac and am quite new to coding. I've run into a error in creating a new faction lord where i receive the error of:

./process_troops.py
Traceback (most recent call last):
  File "./process_troops.py", line 4, in <module>
    from module_troops import *
  File "/Users/Persom/Downloads/mb_warband_module_system_1165/Module_system 1.165/module_troops.py", line 971
SyntaxError: Non-ASCII character '\xe2' in file /Users/Person/Downloads/mb_warband_module_system_1165/Module_system 1.165/module_troops.py on line 971, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

so i look online for help and see that i should use # coding: utf-8. I put it in at the top of my script but now the one part i added. That part being my lord now receives this error:

./process_troops.py
Traceback (most recent call last):
  File "./process_troops.py", line 4, in <module>
    from module_troops import *
  File "/Users/Person/Downloads/mb_warband_module_system_1165/Module_system 1.165/module_troops.py", line 972
    ["kingdom_7_lord",  “Torbin Peirce”,  “Peirce”,  tf_hero, 0,reserved,  fac_kingdom_7,[itm_warhorse_sarranid,    itm_mamluke_mail,          itm_sarranid_boots_c,      itm_sarranid_mail_coif,  itm_mail_mittens,      itm_sarranid_cavalry_sword,    itm_tab_shield_small_round_c],        knight_attrib_4,wp(220),knight_skills_5|knows_trainer_5, 0x0000000000000001124000000020000000000000001c00800000000000000000, vaegir_face_younger_1],
                        ^
SyntaxError: invalid syntax

any tips or help on this issue are appreciated thanks!!!! :mrgreen:
 
SteelForge 说:
creating a new faction lord where i receive the error of:

I mentioned googling for the specific error earlier. Look at this> "kingdom_7_lord",  Torbin Peirce

you have the wrong " symbol on the name there. Either you typed it wrong, or its a problem of copy+paste. Fix that.

also mentioned you need to copy actual code, using code tag, after you read the error message and tried to fix stuff. We can't see your code, so we can't guess what may be wrong there on most cases.
 
Is it possible to add weapons to an NW map fx a pike rack. To use in trainning and such? U can find the model in mapping tool under itemskind but they arnt useable :v
 
状态
不接受进一步回复。
后退
顶部 底部