Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
as0017 said:
Is there another software to make bumpmap ? I use photoshop with Nvidia plugin, and I make some bumpmap from texture. But they don't looklike the bumpmap textures in commonres/texture. They look better, and have good effective.

Nobody have solution ?
 
as0017 said:
as0017 said:
Is there another software to make bumpmap ? I use photoshop with Nvidia plugin, and I make some bumpmap from texture. But they don't looklike the bumpmap textures in commonres/texture. They look better, and have good effective.

Nobody have solution ?
crazybump or xnormal do the trick
 
Hey guys, i have a question about a script (Singleplayer) :
Is there a script (or is it possible to make one) for an armor/ weapon that spawns a new troop (at a random or specific spawn point) after the wearer of the armor died? 
I've someone knows such a script(or knows how to make it), would it be possible to post it here?
I need this script for trying to make a sort of a death-match style singleplayer mode (and later maybe for making exploring-scenes for the player with re-spawning monsters and bandits)
Anyone can help me?
Bye, Alrik
______________________________________
sorry for my (maybe) wrong English 
 
Hey could someone answer me this, is there a limit on how much sounds you can have in mount and blade.
 
Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.

Removing the override horse flag isn't working since there isn't a way to filter for only cavalry on one of the spawn points.  WFaS does have a script that is called from oim_on_horse_dismount, but everything was commented out and noted as buggy.  I was using replace_agent_items_assault as a template:
Code:
("replace_agent_items_assault",
    [
	(store_script_param, ":agent_no", 1),
	(get_player_agent_no, ":player_agent"), 
	(agent_get_troop_id, ":troop_id", ":agent_no"), 
	(try_begin),
		(agent_is_human, ":agent_no"), 
		(agent_is_active, ":agent_no"), 
		(neq, ":agent_no", ":player_agent"),
		(is_between, ":troop_id", regular_troops_begin, regular_troops_end), 
		(assign, ":has_item", -1),
		(assign, ":replace_item", -1),
		(try_begin),
			(agent_has_item_equipped, ":agent_no", "itm_kopyo"),
			(assign, ":has_item","itm_kopyo"),
			(assign, ":replace_item", "itm_sablya_pure_c"),
		(try_end),
		(try_begin),
			(gt, ":replace_item", 0),
			(agent_unequip_item, ":agent_no", ":has_item"),
			(agent_equip_item, ":agent_no", ":replace_item"),
		(try_end),

Instead of listing each item individually I'm using try_for_range for horses:
Code:
## Dismount Unless Cavalry
            (store_script_param, ":agent_no", 1),
            (try_begin),
                  (agent_is_active, ":agent_no"),
                  #(this_or_next|troop_is_mounted, ":agent_no"),
                  #(             troop_is_guarantee_horse, ":agent_no"),
                  (troop_get_class, ":agent_class", ":agent_no"),
                  #(neq, ":agent_class", 2), # class 2 = cavalry
                  (try_for_range, ":horse", horses_begin, horses_end),
                        (troop_has_item_equipped, ":agent_no", ":horse"),
                        (agent_unequip_item, ":agent_no", ":horse"),
                  (try_end),
                  (try_for_range, ":horse", oim_horses_begin, oim_horses_end),
                        (troop_has_item_equipped, ":agent_no", ":horse"),
                        (agent_unequip_item, ":agent_no", ":horse"),
                  (try_end),
            (try_end),
## End Dismount Only Cavalry

As you can see I've commented out some of the lines just for testing basic functionality, but I still have troops spawning with horses.  I have a feeling that I'm missing something easy like grabbing the value of a slot on the :horse item, but all my searching through the code has come up with nothing. 

Grepping for horses_begin only returns a few results and none of them are helpful.  Also tried searching for try_for_range.*_begin.*_end but nothing too helpful there either.

The code compiles just fine for me, it just doesn't work.  I've tried setting the trigger from the default ti_on_agent_dismount to ti_on_agent_spawn, but no luck.  Recent posts in here indicate that before_mission_start wouldn't work for me either.

Any ideas on what it is that I'm missing?
 
xPearse said:
Hey could someone answer me this, is there a limit on how much sounds you can have in mount and blade.
The hard coded limit is probably quite high, but you'll run into a RAM-based limit much sooner. Loading up sounds will quickly spend the RAM assigned for the game and cause RGL errors. See the recent discussion Hm. I think M&B Warband's music system can't handle a certain amount music added and xeno's info in the Tutorial section [Info] Optimization Announcement: Sound and your Mods.

And don't cross-post a new thread when you've already asked here. Your impatience isn't going to win you any points or make anyone more likely to help you. Folks respond here of their free time...you might want to refresh yourself on How to ask for help.

Saint John Knight said:
Someone knows how to change weather and time of the day on multiplayer maps?
See Arch3r OS: Random weather for multiplayer gamemodes (fixed) or the FAQ in the first post of Nordous' Sceners Guild

Alrik der Goblin said:
Hey guys, i have a question about a script (Singleplayer) :
Is there a script (or is it possible to make one) for an armor/ weapon that spawns a new troop (at a random or specific spawn point) after the wearer of the armor died? 
I've someone knows such a script(or knows how to make it), would it be possible to post it here?
I need this script for trying to make a sort of a death-match style singleplayer mode (and later maybe for making exploring-scenes for the player with re-spawning monsters and bandits)
Anyone can help me?
Bye, Alrik
______________________________________
sorry for my (maybe) wrong English 

The mission template trigger ti_on_agent_killed_or_wounded will fire every time an agent is killed or wounded.
So you'd want to do something like this:
Code:
(ti_on_agent_killed_or_wounded, 0, 0, [],
  [
   (store_trigger_param_1, ":dead_agent"),
   #do stuff, like get what the agent is wearing, get its position, set the spawn position to that position, and spawn the items
  ]),

bobross419 said:
Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.

Removing the override horse flag isn't working since there isn't a way to filter for only cavalry on one of the spawn points.  WFaS does have a script that is called from oim_on_horse_dismount, but everything was commented out and noted as buggy.
...
The code compiles just fine for me, it just doesn't work.  I've tried setting the trigger from the default ti_on_agent_dismount to ti_on_agent_spawn, but no luck.  Recent posts in here indicate that before_mission_start wouldn't work for me either.

Any ideas on what it is that I'm missing?
A number of things here. Good points on removing the flag...though you will need to do so if you want horses to appear at all. However, once an agent has spawned a horse, the spawned horse is no longer 'just' an item and is now an agent in its own right. You cannot "unequip" and agent, so this method is definitely not going to work.

"ti_on_agent_dismount" only fires when an agent dismounts--either the horse dies or it gets off its horse--and you cannot force an agent to dismount, so that isn't a particularly useful trigger. Most likely the oim_ script you mention is tied to this trigger, so it too is not particularly useful (though I haven't looked at it)

Really the only thing you can try is to edit the troop template of the non-cavalry class troop and be sure there isn't a horse equipped (though, for these non-cav troops that sometimes get horses, I'm really not sure how that works in the first place). You can do a try_for_range through the troop stacks at ti_before_mission_start and remove horses from the appropriate troops. You probably want to mark those troops with a troop slot so you can add their horses back after the battle. You can capture battle end with a simple trigger (and setting a variable to make it fire) or by adding code where you see (finish_mission) or  (set_trigger_result, 1), in the mission template triggers as those end the battle.
 
bobross419 said:
Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.
The problem with your code is that horses are not equipment once inside a scene, they are individual agents. It becomes more difficult to work with at that level. The easiest way is either via troop inventory manipulation (in the breach menu) and restoration in the victory menu, or use a loop in the mission template calling team_give_order with rordr_dismount for all classes except grc_cavalry. The player can easily circumvent this by setting his troop classes from the party menu to all cavalry or just tell them to mount again, but it's much safer than playing with the inventory.
 
Caba`drin said:
bobross419 said:
Trying to allow only Cavalry troop class to be able to ride horses in WFaS sieges when entering through the gate or a wall breach.

Removing the override horse flag isn't working since there isn't a way to filter for only cavalry on one of the spawn points.  WFaS does have a script that is called from oim_on_horse_dismount, but everything was commented out and noted as buggy.
...
The code compiles just fine for me, it just doesn't work.  I've tried setting the trigger from the default ti_on_agent_dismount to ti_on_agent_spawn, but no luck.  Recent posts in here indicate that before_mission_start wouldn't work for me either.

Any ideas on what it is that I'm missing?
A number of things here. Good points on removing the flag...though you will need to do so if you want horses to appear at all. However, once an agent has spawned a horse, the spawned horse is no longer 'just' an item and is now an agent in its own right. You cannot "unequip" and agent, so this method is definitely not going to work.

"ti_on_agent_dismount" only fires when an agent dismounts--either the horse dies or it gets off its horse--and you cannot force an agent to dismount, so that isn't a particularly useful trigger. Most likely the oim_ script you mention is tied to this trigger, so it too is not particularly useful (though I haven't looked at it)

Really the only thing you can try is to edit the troop template of the non-cavalry class troop and be sure there isn't a horse equipped (though, for these non-cav troops that sometimes get horses, I'm really not sure how that works in the first place). You can do a try_for_range through the troop stacks at ti_before_mission_start and remove horses from the appropriate troops. You probably want to mark those troops with a troop slot so you can add their horses back after the battle. You can capture battle end with a simple trigger (and setting a variable to make it fire) or by adding code where you see (finish_mission) or  (set_trigger_result, 1), in the mission template triggers as those end the battle.

Unfortunately, that all makes sense.  Will definitely tinker around with this later.  Thanks caba and Somebody.
 
Ok so from what I read in both tpics there is a hard coded limit of around 256 (I have 383 in my sounds txt) and using wav makes it easier to load or is better. Ok so do you think I should convert my sound files and change them to 16-bit 22kHz mono WAV and then see what happens.
 
Hey everyone,

Anyone have an idea what this error code could be point towards?

Code:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
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
Traceback (most recent call last):
  File "process_troops.py", line 107, in <module>
    save_troops()
  File "process_troops.py", line 34, in save_troops
    file.write("\ntrp_%s %s %s %s %d %d %d %d %d %d\n  "%(convert_to_identifier(
troop[0]),replace_spaces(troop[1]),replace_spaces(troop[2]), replace_spaces(str(
troop[13])), troop[3],troop[4],troop[5], troop[6], troop[14], troop[15]))
  File "D:\NMC Source Files\process_common.py", line 30, in replace_spaces
    return string.replace(string.replace(s0,"\t","_")," ","_")
  File "D:\ApplicationsPython27\lib\string.py", line 519, in replace
    return s.replace(old, new, maxreplace)
AttributeError: 'int' object has no attribute 'replace'
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...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: g_jq_Back_to_shop
WARNING: Global variable never used: jq_nr
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

The warning, I know about. But the error isn't one I can figure out for the life of me.

Thanks.

<3

CR
 
celestialred said:
Anyone have an idea what this error code could be point towards?
Check the syntax in your module_troops.py file. Apparently one of your troop tuples has a number where the MS expects to see a string. In troops, this is either name or plural name I think.
 
I have two problems  :roll:

Why this:

Code:
(store_skill_level, reg0, skl_power_draw, ":player_no"),
	 (display_message, "@PRUEBADESKILL1ANTERIOR22:{reg0}"),
	 (troop_raise_skill, ":player_no", skl_power_draw, -reg0),
	 (store_skill_level, reg0, skl_power_draw, ":player_no"),
	 (display_message, "@PRUEBADESKILL1AHORA22:{reg0}"),
or this:

Code:
(store_proficiency_level, reg0, ":player_no", wpt_one_handed_weapon),
	 (display_message, "@PRUEBADESKILL1ANTERIOR:{reg0}"),
	 (troop_raise_proficiency, ":player_no", wpt_one_handed_weapon, -reg0),
	 (store_proficiency_level, reg0, ":player_no", wpt_one_handed_weapon),
	 (display_message, "@PRUEBADESKILL1AHORA:{reg0}"),

doesn't work? I just want to subtract to set it to 0, both for proficiency, skill and attribute. Somebody can help me, please?

__________

The other problem is one potion (as throwing weapon) that I need to implement to the game, but this is what you really see in-game:

4ACCC710FB5CFEAB6365CD700817ECDC7642777D

Somebody can help me, please?
 
Vornne said:
CTCCoco said:
Code:
	 (troop_raise_skill, ":player_no", skl_power_draw, -reg0),
You can't negate an identifier like reg0, only actual number constants; you would need to use (val_mul, reg0, -1) and then plain reg0.

Oh, so if I use (val_mul, reg0, -1), it will be like "-reg0" in the function?

Ok, thanks! Let's try.

EDIT: I see maths here. I'm a retard at maths, sorry lol (I'm studying history lol).
 
Hello i'm having some troubles understanding the native script get_closest3_distance_of_enemies_at_pos1, the problem is that at the first lines there is this :

Code:
(assign, ":min_distance_1", 100000),
(assign, ":min_distance_2", 100000),
(assign, ":min_distance_3", 100000),

Then some lines below is this :

Code:
        (try_begin),
          (lt, ":cur_dist", ":min_distance_1"), 
          (assign, ":min_distance_3", ":min_distance_2"), 
          (assign, ":min_distance_2", ":min_distance_1"), 
          (assign, ":min_distance_1", ":cur_dist"), 
        (else_try),
          (lt, ":cur_dist", ":min_distance_2"), 
          (assign, ":min_distance_3", ":min_distance_2"),
          (assign, ":min_distance_2", ":cur_dist"), 
        (else_try),
          (lt, ":cur_dist", ":min_distance_3"), 
          (assign, ":min_distance_3", ":cur_dist"), 
        (try_end),
      (try_end),

I don't understand why there is an else_try when we know that min_distance_1 and min_distance_2 and min_distance_3 have the same value, will that second part make the script randomly choose one of the else_try,

EDIT: i tried executing it mentally and it looks like a loop
 
You missed the (try_for_agents,":cur_agent"), part:
Code:
     (try_for_agents,":cur_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_is_human, ":cur_agent"),
        (agent_get_team, ":agent_team", ":cur_agent"),
        (teams_are_enemies, ":agent_team", ":team_no"),
       
        (agent_get_position, pos2, ":cur_agent"),
        (get_distance_between_positions,":cur_dist",pos2,pos1),
        (try_begin),
          (lt, ":cur_dist", ":min_distance_1"),
          (assign, ":min_distance_3", ":min_distance_2"),
          (assign, ":min_distance_2", ":min_distance_1"),
          (assign, ":min_distance_1", ":cur_dist"),
        (else_try),
          (lt, ":cur_dist", ":min_distance_2"),
          (assign, ":min_distance_3", ":min_distance_2"),
          (assign, ":min_distance_2", ":cur_dist"),
        (else_try),
          (lt, ":cur_dist", ":min_distance_3"),
          (assign, ":min_distance_3", ":cur_dist"),
        (try_end),
      (try_end),
It's simple loop finding 3 lowest values:
there are 5 agents at distances 5,10,15,1,7;

before loop the values are:
min_distance_1= 100000
min_distance_2= 100000
min_distance_3= 100000

1st run of try_for_agents loop:
cur_dist= 5
min_distance_1= 5
min_distance_2= 100000
min_distance_3= 100000

2nd run of try_for_agents loop:
cur_dist= 10
min_distance_1= 5
min_distance_2= 10
min_distance_3= 100000

3rd run of try_for_agents loop:
cur_dist= 15
min_distance_1= 5
min_distance_2= 10
min_distance_3= 15

4th run of try_for_agents loop:
cur_dist= 1
min_distance_1= 1
min_distance_2= 5
min_distance_3= 10

5th run of try_for_agents loop:
cur_dist= 7
min_distance_1= 1
min_distance_2= 5
min_distance_3= 7
 
thank's it made it clearer in my mind,so if i understand correctly, the first block will run for the first agent, the second block for the second agent and so on ?? but it is supposed to take only 3 and you said 5 agents :razz:
 
Status
Not open for further replies.
Back
Top Bottom