Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
What's the purpose of the scene_prop_get_instance operation? I see it around a lot, and I think I need it for a thing I'm scripting. But what does it do and how is it used?
 
Shredzorz said:
What's the purpose of the scene_prop_get_instance operation? I see it around a lot, and I think I need it for a thing I'm scripting. But what does it do and how is it used?
It gets a unique scene prop "instance id" for a certain scene prop kind, indexed from 0 to the total number of them; this is a common way to loop over all scene props of a kind (the entries in module_scene_props):
Code:
(scene_prop_get_num_instances, ":num_instances", "spr_my_scene_prop"),
(try_for_range, ":instance_no", 0, ":num_instances"),
  (scene_prop_get_instance, ":instance_id", "spr_my_scene_prop", ":instance_no"),
  ...
(try_end),
I use "instance_id" for global scene prop identifiers, and "instance_no" for the number from only that kind of scene prop. You can also use it like this, to get the first scene prop of that kind if placed - it's actually a "can fail" operation, even though it doesn't appear to be:
Code:
(try_begin),
  (scene_prop_get_instance, ":instance_id", "spr_my_scene_prop", 0),
  ...
(try_end),
The prop_instance_get_scene_prop_kind operation can be used to convert back the other way. scene_item_get_instance and scene_spawned_item_get_instance work similarly: when items are spawned or dropped on the ground, they have use a type of scene prop with an instance id that can be used with scene prop operations; the ti_on_item_[picked_up|dropped] mission template triggers pass it as a parameter.
 
Vornne said:
Shredzorz said:
What's the purpose of the scene_prop_get_instance operation? I see it around a lot, and I think I need it for a thing I'm scripting. But what does it do and how is it used?
It gets a unique scene prop "instance id" for a certain scene prop kind, indexed from 0 to the total number of them; this is a common way to loop over all scene props of a kind (the entries in module_scene_props):
Code:
(scene_prop_get_num_instances, ":num_instances", "spr_my_scene_prop"),
(try_for_range, ":instance_no", 0, ":num_instances"),
  (scene_prop_get_instance, ":instance_id", "spr_my_scene_prop", ":instance_no"),
  ...
(try_end),
I use "instance_id" for global scene prop identifiers, and "instance_no" for the number from only that kind of scene prop. You can also use it like this, to get the first scene prop of that kind if placed - it's actually a "can fail" operation, even though it doesn't appear to be:
Code:
(try_begin),
  (scene_prop_get_instance, ":instance_id", "spr_my_scene_prop", 0),
  ...
(try_end),
The prop_instance_get_scene_prop_kind operation can be used to convert back the other way. scene_item_get_instance and scene_spawned_item_get_instance work similarly: when items are spawned or dropped on the ground, they have use a type of scene prop with an instance id that can be used with scene prop operations; the ti_on_item_[picked_up|dropped] mission template triggers pass it as a parameter.
Thanks. I had to read your post a few times, but I can finally make sense of all of it now. That operation will certainly help out a lot.
 
Hello,

I made countless OSP armor textures for warband and some were appreciated, but now I can't have the results I want.
My armors never shine ingame and sometimes doesn't appear at all leaving troops with transparent armors.
I use new OpenBRF version (0.0.6 I believe) and do not master him when I had less troubles with 0.04.
I don't understand proper use of alpha channels and maybe is there an important point.
I'm working with Gimp for textures with DDS and normals plugins.

There's what I do :

1/ Open existing texture and modify it
2/ Save texture under BX3/DXT5 with mipmaps
3/ Make normalmap with 4 sample / scale 20 / don't touch anything else. Save it BX3/DXT5 with mipmaps
4/ Make specular and save it with BX3/DXT5 with mipmaps
5/ Open BRF : put mesh, material and textures in the same BRF
6/ Under material tab, I set proper textures, use specular_shader_skin_bump_high for shader, spec RGB 15/15/15 coef 16, Flags 720 (blend/blend add/blend multiply, enable shaders... nothing all), view RGB
7/ Under texture tab, I touch nothing (flag AA000) view RGG

At this point, if I look mesh tab, I see the model in black if I activate bump and specular together. With specular only, baby shines...
But when I save all and put the new item ingame : no shining and transparent armors sometimes.
And now, I'm having runtimes errors with some BRF when lauching game !

Beside, I read something about recompute normals when importing a mesh.
But I don't know how to export a mesh and I I would, I don't know if armor meshes are static, rigged or vertex animated...
Help needed on this point too.

Please help.
I'm lost

Thanks for the answers. Without, I'll stop modding.
 
How would I go about creating a new particle system effect that actually looks good?
I have some models for a muzzle flash (World War 3), but I can't seem to make the particle system work. :sad:

I'm working on new effects for explosions, smoke bursts, weapons, etc.

Can someone point me to an in-depth tutorial on how to make one? Or teach me enough to where I can do it myself?
 
So I made a new item, called keihas and added it to the game with Morgh's text editor.

Now when I try to run game it gives me a runtime error. Module.ini:s things are in right order and names are all okay, but here's the ini anyway:

Code:
load_resource = test
load_resource = textures_face_gen
load_resource = shaders
load_mod_resource = keihastex
load_resource = textures
load_mod_resource = keihasmate
load_resource = materials
load_resource = materials_face_gen
load_mod_resource = narf's_plate_armour_pack_WB
load_mod_resource = Narf's_Transitional_Armour_Pack
load_mod_resource = keihasmesh
load_resource = uimeshes
load_resource = meshes_face_gen
load_resource = helpers
load_resource = map_tree_meshes
load_resource = map_icon_meshes
load_resource = particle_meshes
load_resource = skeletons
load_resource = tree_meshes
load_resource = xtree_meshes
load_resource = grass_meshes
load_resource = plant_meshes
load_resource = body_meshes
load_resource = object_meshes
load_resource = object_bodies


load_resource = goods_meshes
load_resource = item_meshes1
load_resource = horse_a

load_resource = arabian_horses
load_resource = arabian_castle

load_resource = food
load_resource = beards
load_resource = armors_b
load_resource = armors_c
load_resource = armors_d
load_resource = armors_e
load_resource = armors_f
load_resource = armors_g
load_resource = armors_h

load_resource = armors_i

load_resource = boots_b
load_resource = boots_c
load_resource = helmets

load_resource = helmets_b
load_resource = village_houses
load_resource = village_houses_a
load_resource = village_houses_b
load_resource = hair
load_resource = deneme

load_resource = interiors_a
load_resource = interiors_b
load_resource = interiors_c
load_resource = arena
load_resource = map_icons_b
load_resource = castle_a
load_resource = dungeon
load_resource = stone_houses
load_resource = snowy_houses
load_resource = snowy_castle
load_resource = helmets_d
load_resource = helmets_e
load_resource = helmets_f

load_resource = castle_b
load_resource = square_keep
load_resource = anim_b
load_resource = shields
load_resource = shields_b
load_resource = weapon_meshes_c
load_resource = xtree_meshes_b
load_resource = map_icons_c
load_resource = pictures
load_resource = user_interface_b
load_resource = user_interface_c

load_resource = scene_encounter_spot
load_resource = interior_thirsty_lion
load_resource = scene_small_tavern

load_resource = weapon_meshes1
load_resource = weapon_meshes_b

load_resource = houses1
load_resource = wall_meshes1

load_resource = town_houses
load_resource = doors
load_resource = churches
	

load_resource = town_houses_b
load_resource = castle_c
load_resource = castle_d
load_resource = castle_e
load_resource = castle_f
load_resource = castle_g
load_resource = castle_h
load_resource = castle_i

load_resource = gatehouse
load_resource = viking_houses


load_resource = fake_houses
load_resource = town_houses_c
load_resource = banners
load_resource = map_flags
load_resource = map_flags_b
load_resource = map_flags_c
load_resource = map_flags_d

#load_resource = costumes_a
load_resource = particles_2
load_resource = prisons
load_resource = prisons_b
load_resource = interiors_d
load_resource = costumes_b
load_resource = costumes_c
load_resource = arena_costumes
load_resource = boots_a
load_resource = terrain_borders
load_resource = terrain_borders_b
load_resource = skyboxes
load_resource = object_b
load_resource = tree_e_meshes
load_resource = destroy
load_resource = xtree_meshes_c
load_resource = grass_meshes_b



load_resource = interiors_steppe

load_resource = grooming_horse
load_resource = town_houses_d


load_resource = horses_b
load_resource = ani_horse_mounted
load_resource = deneme2
load_resource = horse_skeleton

load_resource = steppe_fake_houses
load_resource = weapon_meshes_d

load_resource = tableau_shields
load_resource = heraldic_armors

load_resource = spear
load_resource = weapons_e
load_resource = weapons_f
load_resource = instruments
load_resource = sarranid_armors

load_resource = custom_banner

load_resource = simple_primitives

load_resource = ani_man_walk
load_resource = ani_twohanded
load_resource = ani_onehanded
load_resource = ani_death
load_resource = ani_stand_guardsman

load_resource = ani_human_mounted
load_resource = ani_lady_stand
load_resource = ani_poses
load_resource = ani_stand_shopkeeper
load_resource = ani_man_cheer
load_resource = ani_stand_onhorse
load_resource = ani_throw_stone
load_resource = ani_strikes
load_resource = ani_equip_arms
load_resource = ani_run_p
load_resource = ani_run_forward_left_right
load_resource = uni_strikes3
load_resource = ani_walk_sideways
load_resource = ani_run_sideways
load_resource = ani_stand

load_resource = ani_crouch_down
load_resource = ani_low_walk
load_resource = ani_turn_man
load_resource = ani_attacks_single
load_resource = ani_lancer
load_resource = ani_attacks
load_resource = ani_kicks
load_resource = ani_parry_attack
load_resource = ani_walk_backward
load_resource = ani_run_lookingsides
load_resource = ani_defends
load_resource = ani_walk_lookingsides
load_resource = ani_jump
load_resource = ani_wedding
load_resource = arabian_props


#animations
load_resource = uni_jump
load_resource = uni_stances
load_resource = uni_equip
load_resource = uni_strike
load_resource = uni_throws
load_resource = uni_fistswing
load_resource = uni_lord_stand
load_resource = uni_defence
load_resource = uni_sideways

load_resource = dart

load_resource = armors_new_a
load_resource = armors_new_b
load_resource = armors_new_heraldic
load_resource = armors_new_arena

load_resource = crossbows
load_resource = arabian_armors
load_resource = rock
load_resource = costumes_d
load_resource = nordic_helmets
load_resource = sarranid_helmets
load_resource = sarranid_armor
load_resource = raw_materials
load_resource = khergit_lady_dress
load_resource = vaegir_helmets
load_resource = gauntlets_new
load_resource = sarranid_lady_dress
load_resource = sarranid_boots
load_resource = bride_dress
load_resource = full_plate_armor
load_resource = weapon_meshes_e
load_resource = fur_armors_a
load_resource = ui_server_filter
load_resource = warhorse_new
load_resource = ship
load_resource = arabian_houses
load_resource = object_c
load_resource = tree_f
load_resource = interiors_arabian
load_resource = arabian_village
load_resource = valleyProps
load_resource = workshops

load_resource = barrier_primitives
load_resource = town_houses_e

load_mod_resource = pack
load_module_resource = thick_surcoats
load_module_resource = thick_clothing
load_module_resource = thick_helms
load_module_resource = thick_brigandines
load_module_resource = thick_armors
load_module_resource = plumed_helms
load_module_resource = gauntlets_newb
load_module_resource = thick_armors_f
load_module_resource = thick_armors_g
load_module_resource = thick_armors_h
load_module_resource = thick_helmets_f
load_module_resource = thick_helmets
load_module_resource = thick_full_plate_armor
load_module_resource = thick_horses_b
load_module_resource = thick_sarranid_robe
load_module_resource = thick_armors_new_a
load_module_resource = thick_armors_b
load_module_resource = thick_helmets2
load_module_resource = thick_vaegir_khergit_sarranid
load_module_resource = thick_shields
load_module_resource = thick_sarranid_helmets
load_mod_resource = Njunja_items

Keihastex is brf with the texture, keihasmesh brf with the mesh and keihasmate brf with the material. rgl log stops at the keihasmesh, but
I have checked the filenames and they're correct.
 
hi,
well, i did some maps and added they to administrator panel, but, is there an way to add they to poll? i searched but didint find anything,
tanks.

(when you put change map, add a new option: change map to ''MyMap'')
 
Specialist said:
How would I go about creating a new particle system effect that actually looks good?
I have some models for a muzzle flash (World War 3), but I can't seem to make the particle system work. :sad:

I'm working on new effects for explosions, smoke bursts, weapons, etc.

Can someone point me to an in-depth tutorial on how to make one? Or teach me enough to where I can do it myself?
 
Anyone know the code location for changing the clothing in the Fire and Sword character creation screen in single player?

EDIT: Found it, line 76 in the module_game_menu's
 
I try to Implement Duel Kits to My Mod, When I compile, Its said about "Tuples Error" on Mission Templates.
I'm not very understand about tuples because when I look again to my mission templates, It's good I think, No error.

Could anyone explain to me, What is mean of "tuples"?  :oops:
 
13exa said:
I try to Implement Duel Kits to My Mod, When I compile, Its said about "Tuples Error" on Mission Templates.
I'm not very understand about tuples because when I look again to my mission templates, It's good I think, No error.

Could anyone explain to me, What is mean of "tuples"?  :oops:

I don't code in Mount and Blade, so I don't know if this is similar to the module source....

Looks like an Array to me...

http://www.tutorialspoint.com/python/python_tuples.htm

Some more information about the source and syntax....

http://forums.taleworlds.com/index.php/topic,142422.0.html
 
13exa said:
Could anyone explain to me, What is mean of "tuples"?  :oops:
A tuple is a set of data fields surrounded by normal brackets.

Every operation or structure definition in Module System is a tuple.

Take module_scripts.py for example:

scripts = [
  ("script_name",
    [
      (operation, ":param1", ":param2"),
      (another_operation, ":param1", ":param2", ":param3"),
    ]
  ),
  ("another_script_name",
    [
      (operation, ":param1", ":param2"),
      (another_operation, ":param1", ":param2", ":param3"),
    ]
  ),
]

What we have here is the array (square brackets, "scripts=[]") which contains two tuples (surrounded by normal brackets). Each of those tuples is a script definition. Each script in turn contains one string value (name of the script) and an array of operations. Each operation is once again a tuple, with first data value being the operation name, and the rest are operation parameters.

So we have tuples inside array inside tuple inside another array. Simple eh? Especially when compared to more complex files like module_presentations. :smile:
 
If I want to open a presentation in Multiplayer when usnig a scene prop, what will i have to do to get it working on a dedicated server? Simply using "(start_presentation, "prsnt_dungeon_warrior_menu")," Does not work, on a dedicated nothing seems to happen. Also, in another menu, when you spawn a weapon with clicking on a menu point, you simply can't pick it up on a dedicated.
 
Patta said:
If I want to open a presentation in Multiplayer when usnig a scene prop, what will i have to do to get it working on a dedicated server? Simply using "(start_presentation, "prsnt_dungeon_warrior_menu")," Does not work, on a dedicated nothing seems to happen. Also, in another menu, when you spawn a weapon with clicking on a menu point, you simply can't pick it up on a dedicated.
As is common with most multiplayer problems, you need to send a network message to the server or client, depending on which the operations are running: the scene prop use trigger only runs on servers, so you need to send a network message to the player client to open a presentation, and presentations only run on clients, so the weapon menu needs to send a message to the server requesting an item be spawned (make sure to check things mainly on the server rather than clients, where players can't "hack" it by changing module .txt files).
 
OK, thought it would be something like that, now that I know Warband a bit better :wink: Thx.


Edit: Now i have something else:

    (multiplayer_get_my_player,":my_player"),
(ge,":my_player",0),
(player_get_team_no,  ":player_team", ":my_player"),
(team_get_faction, ":player_faction", ":player_team"),

This is a part of a code from my presentation. But i always get "invalid faction ID: 268 (at least I think it was 26:cool:" in that presentation. The player does not seem to be the problem, so maybe getting the team number of that player is the problem? I was in team 1 when i tested it, and i was spawned if that does anything.

edit2: OK; i think i have it now... it was this here:
(neq|faction_slot_eq,slot_dungeon_1_begin,":cur_troop"),

I now realised that something is missing... :wink: So, testing it out now.
 
Status
Not open for further replies.
Back
Top Bottom