Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
To avoid replicating the code from the "town_center" menu (setting up guards, walkers etc.), maybe start the game with the town menu, and don't jump into a town visit mission.
So in "start_phase_3" modify "continue" to do just that:

      ("continue",[], "Continue...",
      [       
        (assign, "$g_starting_town", "$current_town"),
        (call_script, "script_player_arrived"),
        (party_set_morale, "p_main_party", 100),
        (set_encountered_party, "$current_town"),
        #(call_script, "script_prepare_alley_to_fight"),
        (jump_to_menu, "mnu_town"),

      ]),

Didn't test to see if that's enough, but it's very likely.
 
Thanks, Madvader!  Works and goes straight to menu and lets me enter the town I chose from the menu.  However, when I go to the world map it places me next to a training ground many miles from the chosen city. 

Mind you, restarting games to test changes has suddenly become a lot quicker!
 
Superelastic said:
Thanks, Madvader!  Works and goes straight to menu and lets me enter the town I chose from the menu.  However, when I go to the world map it places me next to a training ground many miles from the chosen city. 

Mind you, restarting games to test changes has suddenly become a lot quicker!
Hm.. maybe add this line in the same menu above, as the final party position is normally set in the merchant quest you want to avoid:
(party_relocate_near_party, "p_main_party", "$g_starting_town", 1),
like this:
      ("continue",[], "Continue...",
      [       
        (assign, "$g_starting_town", "$current_town"),
        (call_script, "script_player_arrived"),
        (party_set_morale, "p_main_party", 100),
        (set_encountered_party, "$current_town"),
        #(call_script, "script_prepare_alley_to_fight"),
        (party_relocate_near_party, "p_main_party", "$g_starting_town", 1),
        (jump_to_menu, "mnu_town"),

      ]),
 
Using a tool (like, say, Morgh's tools or something) is it possible to make a crossbow (for instance) fire two or three bolts per mouse-click?  I've already found that the clip size can be increased, but it still remains single-shot.  I'm assuming the answer is "no" but I thought I'd ask anyway.  I'm aware some mods have shotguns and machine guns, but I suspect they're using more complicated scripts. 
 
MadVader said:
Hm.. maybe add this line in the same menu above, as the final party position is normally set in the merchant quest you want to avoid:
(party_relocate_near_party, "p_main_party", "$g_starting_town", 1),

Perfect!
 
I'm not sure I understand the sounds.txt, although I've been doing reading on it and it _seems_ like I understand what the numbers and such mean.  However, no firearm has a gunshot sound -- even though the sound appears to exist as a file, and is, apparently, set up already in the sounds.txt.  But still, no sound, and I can't figure out what's missing from the default txt.  It looks like it's there.  Any ideas? :wink:
 
Going back to my custom town mercenaries

I added that piece of code to game_menus, and when I hire them they get regenerated the next day.

The simple_triggers part calls update_merc script every 72 hrs, so how can I enforce that for game_menus?

Thanks
 
danest said:
Using a tool (like, say, Morgh's tools or something) is it possible to make a crossbow (for instance) fire two or three bolts per mouse-click?  I've already found that the clip size can be increased, but it still remains single-shot.  I'm assuming the answer is "no" but I thought I'd ask anyway.  I'm aware some mods have shotguns and machine guns, but I suspect they're using more complicated scripts.
Your suspicion is correct--any autofire needs module system scripting.

danest said:
I'm not sure I understand the sounds.txt, although I've been doing reading on it and it _seems_ like I understand what the numbers and such mean.  However, no firearm has a gunshot sound -- even though the sound appears to exist as a file, and is, apparently, set up already in the sounds.txt.  But still, no sound, and I can't figure out what's missing from the default txt.  It looks like it's there.  Any ideas? :wink:
In Warband, firearm sounds/smoke effects should be played in a ti_on_weapon_attack trigger. Be sure that your firearms look like the Native flintlock pistol in Morgh's Editor and have the trigger code in the trigger box...otherwise you'll get no sound.
 
I got the amazing highlander armor that someone made and is being used in Floris, and I am going to replace the useless Merc. Crossbowmen with the edited troops with the ihglander armor. I got the troop editor and now i need to place the armor into the module so the new mercs will have the armor. Where does the armor go?
Thank you, and sorry if i look like a noob
 
Your question is most likely to be answered if you post it in this thread: http://forums.taleworlds.com/index.php/topic,6575.0.html
 
See this tutorial: adding new items to M&B
The key steps are there--you can skip the modelling/wings 3d stuff as you aren't making things.

Essentially:
1. add the .brf files to the Resources folder
2. add the .dds files to the textures folder
3. edit the module.ini to call the resource file and so that it checks the textures folder
4. add the items to the items file (either through the module system module_items.py--preferred--or with morgh's and itemkinds1.txt) and give them stats, etc
5. reference the items in the troop file

And be sure you are editing a copy of Native at the very least--you don't want to mess up your Native module.

(merged to Q&A thread, where how-tos, etc go)
 
I've been working on my mod for awhile now and have noticed that the more I add/do, the longer the initial load time on starting a new game is. At first it was only a minute or so (bearable). However, when I added in diplomacy and a few OSPs the loading time is now almost five minutes (it certainly feels that long at least). I don't think it's the size of the map as loading a saved file is almost instant for me.

The startup scripts certainly can't be that bad, can they?

I know Brytenwalda use to have this problem as well.  They even had a "Please wait a few minutes" on their loading screen image for new games. However, their most recent versions have the game starting (almost) instantly! I know it can be hard to determine exactly what causes this without looking at my code (though I am willing to show it if need be) but -- Generally speaking when making mods, what can cause the "Start New Game" loading time be so absurdly long? Are there some inefficient codes that I need to change or something?
 
How realistic would it be that, after capturing a lord and talking to him, there would be an option to get all his lands (fiefs/castles/towns). And when it's the king, then become the king of all his kingdoms.
 
Runea said:
I've been working on my mod for awhile now and have noticed that the more I add/do, the longer the initial load time on starting a new game is. At first it was only a minute or so (bearable). However, when I added in diplomacy and a few OSPs the loading time is now almost five minutes (it certainly feels that long at least). I don't think it's the size of the map as loading a saved file is almost instant for me.

The startup scripts certainly can't be that bad, can they?

I know Brytenwalda use to have this problem as well.  They even had a "Please wait a few minutes" on their loading screen image for new games. However, their most recent versions have the game starting (almost) instantly! I know it can be hard to determine exactly what causes this without looking at my code (though I am willing to show it if need be) but -- Generally speaking when making mods, what can cause the "Start New Game" loading time be so absurdly long? Are there some inefficient codes that I need to change or something?
It's not anything in the code, it's the resources you load, like models, textures and sounds. A good way to judge how heavy is your mod, look at the size of the Resources, Textures and Sounds folders - all the crap there you probably load, even stuff you don't actually use in the game.
I suggest trimming the BRFs of stuff you don't use. Use OpenBRF to check for usage and delete parts of OSPs that you don't use (meshes, materials, textures).
(You can also try the Mod Verifier in my sig.. it checks for used and missing resources too)
 
Hello, I have a story mode in my mod with a custom character so the player has to play with the character I created, but I would like to make various story lines with different characters so when you select start game in the menu, I would like to have at least 3 possible story lines available, would this be too difficult and should I just have separate mods for separate story lines or would the other option be fairly easy?
 
Runea said:
I've been working on my mod for awhile now and have noticed that the more I add/do, the longer the initial load time on starting a new game is. At first it was only a minute or so (bearable). However, when I added in diplomacy and a few OSPs the loading time is now almost five minutes (it certainly feels that long at least). I don't think it's the size of the map as loading a saved file is almost instant for me.

The startup scripts certainly can't be that bad, can they?

I know Brytenwalda use to have this problem as well.  They even had a "Please wait a few minutes" on their loading screen image for new games. However, their most recent versions have the game starting (almost) instantly! I know it can be hard to determine exactly what causes this without looking at my code (though I am willing to show it if need be) but -- Generally speaking when making mods, what can cause the "Start New Game" loading time be so absurdly long? Are there some inefficient codes that I need to change or something?
If your mod have more factions than native look for:
Code:
	  #this should come after assignment of territorial grievances
      (try_for_range, ":unused", 0, 70),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "@{!}DEBUG -- initial war/peace check begins"),
        (try_end),
        (call_script, "script_randomly_start_war_peace_new", 0),
      (try_end),
The script_randomly_start_war_peace_new have few double loops, that can cause problems.

Change the 70 to smaller number, or simply remove the loop (the starting wars will be less random, but start will be instant).
Code:
        (call_script, "script_randomly_start_war_peace_new", 0),
 
Hello.
I wrote an accuracy change trigger for bows which should dercrease the accuracy in relation with the power draw skill.
But it wont work...
The accuracy is still the same, doesnt matter how much powerdraw the agent has.
Code:
accuracy_change = (
  ti_on_item_wielded, 0, 0, [],
  [
    (store_trigger_param_1, ":agent"),
    (store_trigger_param_2, ":item_id"),
  
    (item_get_type, ":item_type", ":item_id"),
    (try_begin),
      (eq, ":item_type", itp_type_bow),
      (store_skill_level, ":power_draw", "skl_power_draw", ":agent"),
      (ge, ":power_draw", 1),
      (val_mul, ":power_draw", 2),
      (store_sub, ":accuracy", 100, ":power_draw"),
      (agent_set_accuracy_modifier, ":agent", ":accuracy"),
    (else_try),
      (agent_set_accuracy_modifier, ":agent", 100),
    (try_end),
  ])
Does anyone know whats wrong with the code :?:
 
abdoul said:
Hello, I have a story mode in my mod with a custom character so the player has to play with the character I created, but I would like to make various story lines with different characters so when you select start game in the menu, I would like to have at least 3 possible story lines available, would this be too difficult and should I just have separate mods for separate story lines or would the other option be fairly easy?
You can include them all in one mod...if you use a global variable that you set based on the start menu and you check it whenever things should be different depending on the choice.

CTCCoco said:
I have a question, there´s a way to store local variables to a string without passing it to a global variable like reg0 or s0?
Thanks.
Nope, you need to assign the value of the local variable to a register to use it in a string.
 
Waldzios said:
If your mod have more factions than native look for:
Code:
	  #this should come after assignment of territorial grievances
      (try_for_range, ":unused", 0, 70),
        (try_begin),
          (eq, "$cheat_mode", 1),
          (display_message, "@{!}DEBUG -- initial war/peace check begins"),
        (try_end),
        (call_script, "script_randomly_start_war_peace_new", 0),
      (try_end),
The script_randomly_start_war_peace_new have few double loops, that can cause problems.

Change the 70 to smaller number, or simply remove the loop (the starting wars will be less random, but start will be instant).
Code:
        (call_script, "script_randomly_start_war_peace_new", 0),

O_O. It loaded in the blink of an eye! Thank you so much! XD
 
Status
Not open for further replies.
Back
Top Bottom