Modding VC: basic tutorials and Q&A thread

Users who are viewing this thread

Unfortunately, inserting anything in any reference lists in Warband corrupts the save games this way -- the game references everything by line number. So we generally add things to the end, but then this causes problems with reference that expect all troops of a particular type to be grouped together.
 
kalarhan said:
Ryantheskinny said:
I added four companions to a personal mod and when I started it to test found they had replaced the kings of Northvegr, Danmark, Friese, and Laithland. Followed the tutorial by Malik Faris https://forums.taleworlds.com/index.php?topic=130815.0 why do you think this happened?

when talking about code we can either start a guessing game, or see the actual code. First is unreliable, takes a lot of time and usually doesnt help much. Second is the short/quick path to solve issues.

So if you show us what is going on (screenshots, video, etc) and show us your code changes, that would be easier to understand what you are trying to say and what may be wrong with your changes.

Do remember that VC is not Native, most of the code is unique/changed, which means that Native tutorials are just a reference, they cant for most part be followed step by step.

I understand, should have done that in the first place, because i would have noticed the missing comma in Module_dialog that caused this whole issue. LOL
Anyway thanks if i have any further issue i will make sure to post a sample of code and other details.

 
Guys, I've been given some general tips by kalarhan, but I would appreciate if someone can give me detailed instructions on how to achieve the following (with minimal error): Increase men per leadership point (this just affects the player right - not npc lords?) and input the new values in presentation.txt so that it actually SHOWS my party cap increased. If there's a roundabout way to increase base morale without using VC tweaks, that'd be fine too, but does base morale have a counterpart in presentation.txt? If so, how do I match it with my tweaks in script.txt?
 
Verisoxy said:
in presentation.txt?

just to make the distinction clear

Tweaks thread for .txt edits
Q&A modding thread (this one) for modsys (those .py files)

So decide which kind of modding you want to do (you shouldnt try both at the same time, as one removes the other changes). Modsys gives you the power of a dev, so you can change pretty much anything you want in the game. Txt edits are limited and have compatibility issues with new versions (the numbers change, so you need to redo all the work again), but are usually easier if you dont want to learn about coding.

Problem with .txt edits is that there are not many people around that know how to do them anymore (since game was release in 2014-2015), while modsys you can visit the Forge (modding forum) and get all the help you need with it.
 
Okay ilI am trying to make it we're at least castles and towns will have recruits based on owners faction and not the culture. I found this code on here:

try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":party_faction", ":center_no"),
(faction_get_slot, ":faction_culture", ":party_faction", slot_faction_culture),
(party_set_slot, ":center_no", slot_center_culture, ":faction_culture"),

Will this do what I am expecting?

EDIT: tried adding the above code into what looked like the right spot in module_triggers but it didn't appear to work, also ":party_faction" is not a recognized variable
 
Ryantheskinny said:
Okay ilI am trying to make it we're at least castles and towns will have recruits based on owners faction and not the culture. I found this code on here:

try_for_range, ":center_no", centers_begin, centers_end),
(store_faction_of_party, ":party_faction", ":center_no"),
(faction_get_slot, ":faction_culture", ":party_faction", slot_faction_culture),
(party_set_slot, ":center_no", slot_center_culture, ":faction_culture"),

Will this do what I am expecting?

EDIT: tried adding the above code into what looked like the right spot in module_triggers but it didn't appear to work, also ":party_faction" is not a recognized variable

are you trying to change the recruits (troops you can hire) or the general culture of a place (the guards, villagers, etc)?

the faction of a faction it is own faction. What? Faction is a generic term in the modsys, so lets change it

- a kingdom is a faction
- a culture is a faction
- a kingdom has a culture
- a kingdom is not a culture
- a culture may be used by several kingdoms

so when using those operations use need to remember that "faction" is a generic term. It is not the kingdom. It is not the culture.

Similar to:
- a dog is a animal
- a cat is a animal
- a animal can be cat, dog, cow, wolf, ...
- a cat is not a dog

you should visit the Forge Q&A thread as more people hang out in there (and your questions are on general modding, not VC per si). It will give you a higher chance of replies.
 
Okay I'll try the forge. This code was mentioned in VC tweaks thread.

Yes I am trying to change troop recruitment so that if a faction owns a center the culture of recruits changes to faction culture
 
Ryantheskinny said:
I am trying to change troop recruitment so that if a faction owns a center the culture of recruits changes to faction culture

[VC Tweaks Tool] has a tweak for villages and another for town/castles, you can use it as a template for your mod.
 
kalarhan said:
Ryantheskinny said:
I am trying to change troop recruitment so that if a faction owns a center the culture of recruits changes to faction culture

[VC Tweaks Tool] has a tweak for villages and another for town/castles, you can use it as a template for your mod.

That we're I got the code I mentioned. Now am I supposed to put that code in module_scripts.py or module_triggers.py I seem to be finding conflicting info on that.
 
Ryantheskinny said:
That we're I got the code I mentioned. Now am I supposed to put that code in module_scripts.py or module_triggers.py I seem to be finding conflicting info on that.

you can either use the tool itself, or port the code to your own modsys. If you are copying it, then apply the changes to the same files as the tool did (hence why I said it could be used as a template).

if you are unsure about coding and all that then check the initial posts for instructions, and the Forge for more tutorials.

Cheers
 
Okay, I have been making an expanded map, I notice that all the Port cities and most ferries (the ferry near Dorestadt is not connected) and landings are connected by Ford's. I assume it is used for the pathing for ships. It also looks like it is not supposed to touch the shore except for areas were you want ships to land and sail from. Is my understanding correct? Is their any other map quirks I am missing that would be useful to know?
 
Ryantheskinny said:
ferries ... connected by Ford's

that is a pathfinding trick as Warband didnt have sea travel. VC brought updates to the game engine (by TW) to better handle pathfinding on land x sea so the ships could navigate freely (not on rails).

Ferry system is not free form. It is going from A to B using a sea road. So it uses the old system to simplify navigation.

Do note that ferry system as it is has some limitations (as it turns the player into a prisoner). You need to study it and decide if you want to use it or not on your mod.
 
Ryantheskinny said:
Okay, so in reality I can ignore the Ford's connecting port Cities. Its only really needed at ferry stations. Correct?

you can ignore anything you want, just keep in mind the consequences. Like if you use normal sea travel for ferry that implies you will need to review the AI code on how they decide route + combat, and so on.

in other words: you can remove, replace or use any feature as you see fit
 
Oh mighty python saint kalarhan, I have ships getting stuck randomly in corners now and some villagers go in a loop,one example slavers and travellers leaving dorestadt they randomly went south into a dead end river channel and just stayed there, still said they where travelling towards ribe, the two cities are connected by fords and other ships seem fine like fishers.
Any ideas why that may be happening? thanks in advance

deleted the fords, everything works the same, found the port of ribe in central Europe instead of by ribe. see pics, also note odd pathfinding of lords in second pic.

5695D372DFF533E6BD31EA84457976634DE546F0

154DC0A275533249FD8CF020DCFD2ADBC06A7AB5
 
Ryantheskinny said:
I have ships getting stuck randomly in corners now and some villagers go in a loop,one example slavers and travellers leaving dorestadt they randomly went south into a dead end river channel and just stayed there, still said they where travelling towards ribe, the two cities are connected by fords and other ships seem fine like fishers.
Any ideas why that may be happening? thanks in advance

deleted the fords, everything works the same, found the port of ribe in central Europe instead of by ribe. see pics, also note odd pathfinding of lords in second pic.

1) MBScript, not Python.

If Python is the car and you are a driver trying to go from A to B, MBScript and modding is the art of driving (know traffic law, signals, rules, how to control the car, move and stop, and all that). You dont need to know how the engine works, how to assemble the car, or how to make one. You only need basic knowledge like how to fill the tank and change tires.

And the game engine would be the roads. That is the stuff inside the warband.exe (plus .dll files) that you cant see or mess with. Black box.

2) Pathfinding is a mix. On the modsys side you give a destination. Go to A. That is it. The engine is the one that picks the path (move 1 km south, now another 1 km south, now turn west, ...).

Geometry of your map is the key for pathfinding. And the proper location of your centers (the terrain they are on). Bad terrain (vertex) and it is easy for the engine to get stuck trying to go somewhere.

Sea is not different from land. There was quite a lot of trial and error and changes on the engine side to make the VC map work. It was not unusual for ships to get stuck before RE edition.

You can use the tools like the TW devs to check for issues. So if a ship gets stuck somewhere you should review your map and see if you have issues with it on that location.

There is code that forces parties to change direction if they get stuck for some time (so test it out with quick time - ctrl space).

You will see in mods in general that parties just move towards the water (not a port city), change into a boat somehow, move towards their destination, and transform back into a land party. In this case the ship/horse icon is just a visual trick. If on water you are a boat. If on land you are a horse. So they dont need to make partial decisions to move between ports.
--> some mods will use the bridge terrain to create a sea road. That is the usual rule for the old mods (first generation).
--> other mods will have free navigation

3) That applies to fords. You cant tell a party in England to go to Paris. You need to tell it to go to port A, transport it to the water near port A, then to go to port B, then to enter port B, then to tranport it to the land near port B, then to Paris. See the VC code and how they handle fords AI decision when going from Ireland to England as a example.

Example of code
Code:
  # VC auto travel system + NEW: AI landing in general
  (0.7,
    [
 
:lol: thank you kalarhan.

I'm assuming the ports generate automatically (I can't place them like a party) so Ribes port must have a different code than the other cities or I placed Ribe in a bad location and the code was unable to account for that so it placed it in Hungary... No other ports have these issues. And one ferry station also has this issue, so party placement and the rough edges probably account for the Lord's pathfinding issues.
 
Ryantheskinny said:
I'm assuming the ports generate automatically

sort of. You need to set the flags like in

Code:
      #chief sea battles buy ship barcos ciudades con puerto
      (party_set_slot,"p_town_3",slot_town_port, 1),                 ##Set Eidynburh as a port
which is then used
Code:
      # map ports and chimney smoke
      (assign, "$g_number_of_map_ports", 0),
      (assign, ":offset", 0),
      (try_for_range, ":cur_center", walled_centers_begin, walled_centers_end),
        (try_begin),#map ports
          (party_slot_eq, ":cur_center",slot_town_port, 1),
          #1. port party
          (set_spawn_radius, 0),
          (spawn_around_party, ":cur_center", "pt_port"),
to add the port icon

and navigation like from ferries can be overriden like in
Code:
        (try_for_range, ":jetty_no", "p_jetty_5", "p_wales_spawn_point"), #VC-3494
          (store_distance_to_party_from_party, ":distance", ":target_party", ":jetty_no"),
          (lt, ":distance", ":score_to_beat"),
          (assign, reg0, ":jetty_no"),
          (assign, ":score_to_beat", ":distance"),
        (try_end),
 
Back
Top Bottom