Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
Namakan 说:
Does it matter in what order you place the "options" in module.ini?
I believe not.

MadGuarang 说:
In the module_skins there are some options to describe a race.
I try to make new race of aliens, but have some problems in understanding this passage:
("orc_face",0xffc0c8c8,["hair_blonde"],[0xffffffff,0xff171313, 0xff007080c]),
Here's what the top of module_skins has to say on the subject:
插入代码块:
#  Each skin record contains the following fields:
#  1) Skin id: used for referencing skins.
#  2) Skin flags. Not used yet. Should be 0.
#  3) Body mesh.
#  4) Calf mesh (left one).
#  5) Hand mesh (left one).
#  6) Head mesh.
#  7) Face keys (list)
#  8) List of hair meshes.
#  9) List of beard meshes.
# 10) List of hair textures.
# 11) List of beard textures.
# 12) List of face textures.
# 13) List of voices.
# 14) Skeleton name
# 15) Scale (doesn't fully work yet)
# 16) Blood particles 1 (do not add this if you wish to use the default particles)
# 17) Blood particles 2 (do not add this if you wish to use the default particles)
# 17) Face key constraints (do not add this if you do not wish to use it)
Here's an example of an extra race (that works), note that the old "undead" entry in module_skins is missing some fields it needs to work properly:
插入代码块:
  ("skeleton", 0,
    # "invalid_item", undead_face_keys,
	"skeleton_fixed", "skeleton_fixed_calf_l", "barf_skeleton_handL",
    "barf_skull", undead_face_keys,
    [], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    # ["man_hair_s","man_hair_m","man_hair_n","man_hair_o", "man_hair_y10", "man_hair_y12","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_t","man_hair_y6","man_hair_y3","man_hair_y7","man_hair_y9","man_hair_y11","man_hair_u","man_hair_y","man_hair_y2","man_hair_y4"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    [], #beard meshes ,"beard_q"
    # ["beard_e","beard_d","beard_k","beard_l","beard_i","beard_j","beard_z","beard_m","beard_n","beard_y","beard_p","beard_o",   "beard_v", "beard_f", "beard_b", "beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_h","beard_g",], #beard meshes ,"beard_q"
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"], #beard_materials
	# [("eagle",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
    [("barf_skull",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
	# ("manface_young_2",0xffcbe0e0,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19]),
     # ("manface_midage",0xffdfefe1,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c]),
     # ("manface_young",0xffd0e0e0,["hair_blonde"],[0xff83301a, 0xff502a19, 0xff19100c, 0xff0c0d19]),     
    # # ("manface_old",0xffd0d0d0,["hair_white","hair_brunette","hair_red","hair_blonde"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     # ("manface_young_3",0xffdceded,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
     # ("manface_7",0xffc0c8c8,["hair_blonde"],[0xff171313, 0xff007080c]),
     # ("manface_midage_2",0xfde4c8d8,["hair_blonde"],[0xff502a19, 0xff19100c, 0xff0c0d19]),
     # ("manface_rugged",0xffb0aab5,["hair_blonde"],[0xff171313, 0xff007080c]),
    # # ("manface_young_4",0xffe0e8e8,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
     # ("manface_asian1",0xffe3e8e1,["hair_blonde"],[0xff171313, 0xff007080c]),
     # ("manface_asian2",0xffe3e8e1,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_asian3",0xffbbb6ae,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_mideast1",0xffaeb0a6,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_mideast2",0xffd0c8c1,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_mideast3",0xffe0e8e8,["hair_blonde"],[0xff171313, 0xff007080c]),
     # ("manface_black1",0xff87655c,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_black2",0xff5a342d,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_black3",0xff634d3e,["hair_blonde"],[0xff171313, 0xff007080c]),
	 # ("manface_white1",0xffe0e8e8,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c]),
	 # ("manface_white2",0xffe0e8e8,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff632e18, 0xff502a19, 0xff19100c, 0xff0c0d19]),
	 # ("manface_white3",0xffe0e8e8,["hair_blonde"],[0xff83301a, 0xff502a19, 0xff19100c, 0xff0c0d19]),
     # ("manface_african",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]),     
#     ("manface_old_2",0xffd5d5c5,["hair_white"],[0xffffcded, 0xffbbcded, 0xff99eebb]),
     ], #man_face_textures,
    [(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_stun,"snd_man_stun"),(voice_victory,"snd_man_victory")], #voice sounds
    "skel_human", 1.0,
    psys_game_blood,psys_game_blood_2,
	[[1.6, comp_greater_than, (1.0,eye_to_eye_dist), (1.0,temple_width)], #constraints: ex: 1.7 > (face_width + temple_width)
     [0.6, comp_less_than, (1.0,eye_to_eye_dist), (1.0,temple_width)],  
	 [1.5, comp_greater_than, (1.0,face_ratio), (1.0,mouth_width)],  # face ratio and mouth to nose distance
	 [0.6, comp_greater_than, (-1.0,nose_width), (1.0,mouth_width)],  # nose height and mouth to nose distance
	 [-1.0, comp_less_than, (-1.0,nose_width), (1.0,mouth_width)],  # nose height and mouth to nose distance
     ]
  ),
Basically, always copy the default skin and adapt it to suit your needs. It's rather easy, really.

Deutch1 说:
Hi, I was wondering if I could increase the speed of the animations to help improve blocking I tried just increasing the speed of the weapon but it isn't making it any harder
You can increase the speed of the animations by changing the relevant value in module_animations. That might or might not do what you want, experiment with it. (The top of module_animations will tell you which value is the duration of a specific animation sequence, if you don't already know it.)

gdwitt 说:
Sorry for the repeat, but I'll try once more:
<snippity snip>
Are orders interfering? A forced command to use blunt weapons will force soldiers without blunt weapons to switch to unarmed.
Giving the same weapon several times doesn't "fix" the problem, but it increases the chance the troop will spawn with that weapon. There was a long discussion about this at some point several years ago, might want to look for that. IIRC, it culminated in the "guarantee all weapons" script, which does fix the problem and should be easily findable somewhere around here. (I do think there was some performance cost associated with using it, but that's life.)

CutContent 说:
How do I make it so that a mission trigger affects multiple agents instead of just one or all at the same time?
You could try setting an agent slot for all agents you want your trigger to look at, and then use a try_for_agents and check against the slot value.
 
anigman96 说:
I am making a map in Thorgrim's map editor and I am having trouble placing bridges on rivers. When I place them above the water and try to cross them in game, the player icon just goes around the river and not across the bridge.
You need to apply the bridge-terrain at the bridges position.
 
afaik the only place you can reference materials is inside a brf to use it in a mesh, but maybe it can also be used in one of those "new" operations
 
Thanks Lumos for the answer.
I have one more question. Brytenwalda runs on WSE and non-WSE formats.
When I play non-WSE, I get opcode messages in combat referring to the failed script calls to WSE operations.
Is there a way I can hide these messages so they don't disturb the players?
We have several cheat_mode levels for debug messages that seem to work to hide all the campaign map messages.
It's the mission_templates where it's disturbing the players.
 
Somebody 说:
Don't put WSE operations in the non-WSE version?
Or simply check whether WSE is running or not and then apply the WSE stuff... or not.
插入代码块:
is_vanilla_warband           = 1004 #(is_vanilla_warband), #Fails only when WSE is running
 
So how I have to do to mod my game using module system and wse loader to use pbod 0.96??


1-I installed warband and updated it to 1.153

2- downloaded module system 1.153 and make some tries to verify that all works fine  (merged diploamcy 4.3,  freelancer 1.51 and other stuffs)

3- downloaded pbod 0.96 beta and installed it on my game to have access to source code..

4- copied all brf and dds to from pbod to respective folders

5- modified module.ini to load custo resources and added the wse stribgs at the end of the file.

6- downloaded wse 3.2.0. to have both wse laoder and source code

7- put wse folder into my module folder and enanched my module header files with addons from wse loader sdk

-8  complied but i have a buch of errros..

插入代码块:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
process_operations.py", line 6, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_global_variables.py", line 5, in <module>
    from module_triggers import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_triggers.py", line 2, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_strings.py", line 4, in <module>
    from module_strings import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_strings.py", line 4506, in <module>
    modmerge(var_set)
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
modmerger.py", line 297, in modmerge
    modmerge__(modcomp_name,var_dict)
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
modmerger.py", line 237, in modmerge__
    _temp = __import__( src_module_name ,{} , {}, [mergefn_name],-1)
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
pbod_strings.py", line 6, in <module>
    from module_constants import keys_list, all_keys_list
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_constants.py", line 2260, in <module>
    exec code
  File "<string>", line 1, in <module>
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
freelancer_constants.py", line 32, in <module>
    from header_operations import neq, eq
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 3, in <module>
    from module_map_icons import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_map_icons.py", line 2, in <module>
    from module_constants import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_constants.py", line 2260, in <module>
    exec code
  File "<string>", line 1, in <module>
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
freelancer_constants.py", line 32, in <module>
    from header_operations import neq, eq
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting faction data...
Traceback (most recent call last):
  File "process_items.py", line 4, in <module>
    from module_items import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_items.py", line 1, in <module>
    from module_constants import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_constants.py", line 2260, in <module>
    exec code
  File "<string>", line 1, in <module>
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
freelancer_constants.py", line 32, in <module>
    from header_operations import neq, eq
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_scenes.py", line 2, in <module>
    from module_scenes import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_scenes.py", line 2, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 4, in <module>
    from module_scene_props import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_scene_props.py", line 4, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 5, in <module>
    from module_tableau_materials import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_tableau_materials.py", line 3, in <module>
    from header_mission_templates import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_mission_templates.py", line 8, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 4, in <module>
    from module_presentations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_presentations.py", line 3, in <module>
    from header_mission_templates import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_mission_templates.py", line 8, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 2, in <module>
    from header_game_menus import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_game_menus.py", line 8, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting quest data...
Traceback (most recent call last):
  File "process_info_pages.py", line 4, in <module>
    from module_info_pages import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_info_pages.py", line 8, in <module>
    from module_constants import DPLMC_DIPLOMACY_VERSION_STRING
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_constants.py", line 2260, in <module>
    exec code
  File "<string>", line 1, in <module>
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
freelancer_constants.py", line 32, in <module>
    from header_operations import neq, eq
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_scripts.py", line 4, in <module>
    from module_scripts import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_scripts.py", line 3, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 5, in <module>
    from module_mission_templates import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_mission_templates.py", line 2, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_game_menus.py", line 1, in <module>
    from header_game_menus import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_game_menus.py", line 8, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_simple_triggers.py", line 2, in <module>
    from module_simple_triggers import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_simple_triggers.py", line 2, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 5, in <module>
    from module_triggers import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
module_triggers.py", line 2, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
process_operations.py", line 6, in <module>
    from header_operations import *
  File "C:\Games\Mount&Blade Warband1153\Modules\NativeTEST\Module_system 1.153\
header_operations.py", line 1626, in <module>
    lhs_operations += [
NameError: name 'lhs_operations' is not defined
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
So, sorry, but I have another question. I am attempting to make an item that can't be dropped. I for sure thought this code was going to work:

插入代码块:
(ti_on_item_dropped, 0, 0, [(multiplayer_is_server),],
[
        (store_trigger_param_1,":agent_no"),
	(store_trigger_param_2,":item"),		 
		
	(agent_is_active,":agent_no"),
	(agent_is_alive,":agent_no"),
	(agent_is_human,":agent_no"),
	(try_begin),
		(eq,":item","itm_club"), 
			
		#(agent_unequip_item, ":agent_no", ":item"),
		(agent_equip_item, ":agent_no", ":item"),
		(replace_scene_items_with_scene_props, ":item", "spr_empty"), #Doesn't work?		
	(try_end),
])

But there are two problems:
1) When equipping the item, it doesn't put it back in the same slot that it was in before it was dropped, which I would really like it to be. I tried to add in (agent_unequip_item, ":agent_no", ":item"), but that did nothing and of course adding the designated slot to (agent_equip_item, ":agent_no", ":item"), (such as (agent_equip_item, ":agent_no", ":item",1),) did nothing either.
2) As you can see in the comment, (replace_scene_items_with_scene_props, ":item", "spr_empty"), seems not to work at all. It just doesn't do anything whatsoever when, it should delete the scene item it created when the item was dropped.
 
@NordChampion snippet from header_triggers:
ti_on_item_dropped      = -54.0 #can only be used in module_mission_templates triggers
# Trigger Param 1: agent id
# Trigger Param 2: item id
# Trigger Param 3: scene prop id

Use that to remove the scene item using replace_prop_instance operation.
 
The_dragon 说:
@NordChampion snippet from header_triggers:
ti_on_item_dropped      = -54.0 #can only be used in module_mission_templates triggers
# Trigger Param 1: agent id
# Trigger Param 2: item id
# Trigger Param 3: scene prop id

Use that to remove the scene item using replace_prop_instance operation.

Hmm, still didn't work. Is removing the scene prop not a server side action? That's the only reason I can think of that it is not working.
 
The_dragon 说:
Use that to remove the scene item using replace_prop_instance operation.
"replace_prop_instance" only works on "ti_before_mission_start".
If you want to remove the dropped item, then use (scene_prop_set_prune_time, <scene_prop_id>, <value>),
Nord Champion 说:
When equipping the item, it doesn't put it back in the same slot that it was in before it was dropped, which I would really like it to be.
The engine allways tries to fill the first slots, so it assorts the items everytime you drop something... unless the dropped item was applied to the last filled slot.
 
Try it out and tell us. :razz:
Even if it doesn't, and you want to "script" world cam movement using an invisible party, you should be able to set up a party with an invisible map icon and give it pf_hide_label and whatnot.
 
_Sebastian_ 说:
The_dragon 说:
Use that to remove the scene item using replace_prop_instance operation.
"replace_prop_instance" only works on "ti_before_mission_start".
If you want to remove the dropped item, then use (scene_prop_set_prune_time, <scene_prop_id>, <value>),
Nord Champion 说:
When equipping the item, it doesn't put it back in the same slot that it was in before it was dropped, which I would really like it to be.
The engine allways tries to fill the first slots, so it assorts the items everytime you drop something... unless the dropped item was applied to the last filled slot.

Thanks, that worked!
 
How can I get the player's class when in multiplayer? Can I use player_id to find this out?

Edit, figured it out. You can use player_get_troop_id in multiplayer.
 
状态
不接受进一步回复。
后退
顶部 底部