Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
vitali-attila said:
DruGs said:
vitali-attila said:
Add this
Code:
        #Add a fixed amount of money and xp to player after he has captured a settlement
        (call_script, "script_troop_add_gold", "trp_player", 5000),
	(add_xp_as_reward, 500), 
     
after this line
Code:
        (call_script, "script_change_troop_renown", "trp_player", 5),
You can put any amount instead of 5000 and 500.
Of course, make this changes in a separate module, not directly in Native!
I hope this code will be improved by experienced modders.
wow, amazing :smile:! thank you guys for answering :smile: hoping more experienced modders also will answer to this. that would be awesome.
and as i mentioned in my last post: its about getting to loot + experience and money after every siege battle, because you dont in native.

By the way I forgot to mention that the code above works only when you capture a settlement. Though only the message of receiving money appears on the screen. But in script_add_gold there is nothing written about messaging, so it must be automatically.
Does anyone know why there how to make the message of xp received show up on the screen?

The code for the loot screen after defending a town/castle should be the same. Again I have found where to put it and again with a fixed amount of gold and xp.
So after this lines in module_game_menus.py
Code:
              (display_message, "@The enemy has been forced to retreat. The assault is over, but the siege continues."),
              (assign, "$g_battle_simulation_cancel_for_party", "$g_encountered_party"),
add this code
Code:
              (call_script, "script_troop_add_gold", "trp_player", 1000),
              (add_xp_as_reward, 300),
Again, you can put any numbers instead of 1000 and 300. :smile: I should check the code for the looting screen I posted in the previous message.

hmm, think ive might ive found something out about the mission templates. At the end of every different type of battle i found these
"common_battle_victory_display, common_battle_inventory, common_battle_order_panel, common_battle_order_panel_tick" and so on. However the siege setup is alot more complex it seems:S
Cant really make sense of it, so its most likely a way better option what you did :razz: thank you :smile:!
---------------------------------------------------------------------------------------------------------------------------------------
edited:
i checked out different stuff and found the code:

(call_script, "script_party_give_xp_and_gold", "p_temp_party"), <--- i haven't tested it or anything, but could that be the script for just giving xp and gold after a battle ? :razz:

also, thought about 2 different codes that could be about getting up the loot menu.

(jump_to_menu, "mnu_battle_debrief"), <-- dont really think its this one, however i found a weird siege code.
(jump_to_menu, "$g_siege_final_menu"), <-- could be this one ? .. i can prob check later on.. will most likely lol myself, however worth a try.
 
jacobhinds said:
Click "combo" on the bottom of the screen while selecting more than one thing. There's also an "export combined mesh" option from the rightclick menu.

Thanks. But that's not quite what I was looking for. If I select body armor and a helmet, the helmet just sits on the ground under the body armor. Not above it like where the helmet would be.

EDIT: Solved it myself. Went to: selected > mount on bone. Then selected all my desired parts and "exported all meshes". exporting combined mesh makes them all 1 object  when you import them.
 
I'm using ti_on_item_init. Is there a way of retrieving the agent id from this trigger or the item?

edit: Ignore me, my version of header_triggers.py and the one I found on the internet to cross-reference didn't have the parameters labelled. I'm making a script that adds correctly coloured skin meshes to clothes if you're interested.
 
Is it possible to edit the hitboxes for horses and people? for example make them bigger. I noticed this option was provided in OpenBrf but didn't know of a way to make the changes permanent.
 
1434178200-mb36.jpg

I tried adding a new skin in module_skins, like this:

("manface_rugged",0xffb0aab5,["hair_blonde"],[0xff171313, 0xff007080c]),
#    ("manface_young_4",0xffe0e8e8,["hair_blonde"],[0xff2f180e, 0xff171313, 0xff007080c]),
    ("manface_african",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]),
    ("americ",0xff807c8a,["hair_blonde"],[0xff120808, 0xff007080c]),

How come it does that in game? For every skin, not only the one I've added in.
 
Code:
hit_the_road_jack = (
    0, 0, 0, [(key_clicked, key_z)],
    [
     (try_for_agents, ":agent_no"),
        (agent_get_troop_id, ":troop_no", ":agent_no"),
        (eq, ":troop_no", "trp_player"),
        (agent_set_animation, ":agent_no", "anim_time_to_hit"),
     (try_end),
        ])

Code:
["time_to_hit", acf_left_cut|acf_rot_vertical_sword|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_play|amf_continue_to_next,
   [0.61, "attacks_single_lefttoright", 11, 29, blend_in_release], 
 ],

I've added these codes to apply the animation that I want to my character whenever Z is pressed. However, I get this error when I do that:

incorrect skeleton type for anim 512

How to fix it?
 
TheVideoGameInn said:
LOD problem here, my custom skin shows up as white from far away?

1434188943-mb38.jpg
1434188947-mb39.jpg
Hi. I had such problem when playing one of the mods. But there not only the heads, almost everything was just white: terrain, weapons etc. They told me it's my graphic card's problem and advised to choose DirectX7 instead of DirectX9 in the main menu options, and everything became normal. Hope this helps.
 
Well, when I have LOD problems, I check if the model(mesh) uses the same texture as the lods and if the latter have a texture in the texture files. Best thing to do, copy the facegen meshes and material brf files into your mod's Resource folder and check them for incosistencies. For example, mesh called 'face1' might use the material and texture called manface_asian1, but the lods of said mesh might use the material and texture 'manface_arabian', which doesn't exist in the facegen_materials.brf file or in the texture folder. Or in the brf as a texture reference. Most lod problems, besides card issues are due to silly little things like that.
 
Hello. I have a weird problem. I searched a lot but didn't find anything similar to this on the forum.
The problem is that I replaced some troops in the custom battle with new ones. I changed their names, characteristics and descriptions, only the ids(quick_battle_troop_1 etc) stayed the same.
However, although these new troops are shown in the game, but their names and descriptions still are from the native troops, despite the fact that I changed them!
For example, there was initially in module_troops.py:
Code:
["quick_battle_troop_1", "Reiter","Reiters", tf_hero,0,0,fac_kingdom_1,......
["quick_battle_troop_2", "Hussar","Hussars", tf_hero,.....
["quick_battle_troop_3", "Boyar","Boyars", tf_hero,0,0,fac_kingdom_1,.....
.....
["quick_battle_troop_11", "Halberdier","Halberdiers", tf_hero,0,0,fac_kingdom_1,

I replaced the code with:
Code:
["quick_battle_troop_1", "Hussar","Hussars", tf_hero,0,0,fac_kingdom_1,......
["quick_battle_troop_2", "Boyar","Boyars", tf_hero,0,.....
["quick_battle_troop_3", "Mirza Chambul","Mirza Chambul", tf_hero,0,0,fac_kingdom_1,....
.....
["quick_battle_troop_18", "Winged Hussar","Winged Hussars", tf_hero,0,0,fac_kingdom_1,...
I did the same for the strings in module_strings.py - they were replaced - but the game shows still the old strings.

There were initially 11 troops, I made 18 of them. And the troops from 12 to 18 have the correct names(obviously :smile: ).

Interesting note: when I change the id of quick_battle_troop_1 to quick_battle_troop_101 or any other name, it starts working as needed. It seems like the strings for the native ids are reserved and hidden or something like this.

Please help me make the game show the correct strings. I'm sure I just made a mistake somewhere in the code.
P.S. I'm modifying WFaS.


 
jacobhinds said:
The custom battle troop descriptions are based on troop order, not IDs. You could name the strings absolutely anything, but as long as they're in the same order as the troops they will work.
I agree with you. But the first and last ids are also used in module_constants.py and module_strings.py so they should be the same in all 3 files. Change quick_battle_troop_1 to e.g. quick_battle_troop_01 only in module_troops.py and you'll get an error when compiling the files.
About strings again. I checked it on Warband as well. I changed in module_troops.py this:
Code:
["quick_battle_troop_1","Rodrigo de Braganca","Rodrigo de Braganca", tf_hero,0,0,fac_kingdom_1,
to this:
Code:
["quick_battle_troop_1","Vitali Brezhnev","Rodrigo de Braganca", tf_hero,0,0,fac_kingdom_1,
But the name of the troop still remained Rodrigo de Braganca.
Check it yourself, please. Maybe only I do have such problem?

Yeah, and I have the same problem for the strings in the menu "mnu_choose_skill".
It was initially this:
Code:
("choose_skill",mnf_disable_all_keys,"You spot a battle-ready men in the distance.", "none"
I changed it to:
Code:
("choose_skill", mnf_disable_all_keys,"{s13}", "none",
But the text "You spot a battle-ready..." remained, despite the fact that I changed it and s13 has nothing in common with the old string.
 
Is there any way to get the amount of XP that a stack has in the party? I want to be able to move stacks around while retaining their XP values.
 
From what I found searching on these forums, no, and only stacks of the player party even have any associated xp - but this may be obsolete info of course.

Now, my question: is it known how AI decides if it should attack or run away from another AI party (including considering the possibility that other nearby parties will join in on the battle), and if it is possible to affect this in some way for specific target parties?
 
Anyone know how to set relations between lords? I don't mean how much they like each other, but family ties. How would I go about making a lord the king's son/brother?
 
Alex_NG said:
From what I found searching on these forums, no, and only stacks of the player party even have any associated xp - but this may be obsolete info of course.

Now, my question: is it known how AI decides if it should attack or run away from another AI party (including considering the possibility that other nearby parties will join in on the battle), and if it is possible to affect this in some way for specific target parties?

The bit about only player party stacks having XP is interesting, are you sure? AI parties regularly have a trigger applied to increase their XP, so how do they keep track of it?

Sorry I can't answer your question.

TheVideoGameInn said:
Anyone know how to set relations between lords? I don't mean how much they like each other, but family ties. How would I go about making a lord the king's son/brother?

you'll have to set it up in script_initialize_aristocracy
 
Status
Not open for further replies.
Back
Top Bottom