Author Topic: Modding VC: basic tutorials and Q&A thread  (Read 59850 times)

0 Members and 1 Guest are viewing this topic.

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #15 on: March 14, 2016, 02:55:58 PM »
Alright modders, this should be enough to start exploring the VC code  :mrgreen:

If anyone has more questions on how to do things (exclusive to VC features), or if you need help with a specific issue, feel free to post your questions here.

Cheers!

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #16 on: March 25, 2016, 12:04:53 AM »
Hey everyone, I've noticed that I always use the same banners when I'm playing VC and was wondering if anyone had an easy way to allow players to access vanilla banners in VC so there is more variety fpr the player. Not necessarily historically accurate but I need a change of pace.

TLDR: How to mod banners in the game?

The screenshoot thread has 3 posts talking about this subject:
If you're going to mod devices, you should be aware that we split them out in VC to avoid that banner-painted-on-a-shield look from Native. It would have been great to have the banner texture and folds "effect" just overlay the clean shield design, but we didn't get that far. Anyway, the file naming convention is:

ethnic_[12].dds  scene prop banners
ethnic_[12]a.dds  clean version for shields
ethnic_[12]b.dds  flag versions

If one completely changes the device, one needs to update all three to match...

Kingdom banners follow a similar scheme, but not the convention.


Is it as simple as that? I tried re-centering the blue ship banner used in reiksmarshal's second screenshot and in game it then showed half of a different banner.

create a layer for the templates. You can see them on vikings_2a.dds. They are the reference for your shield center and sizes.

I changed the position of the raven and inverted just for fun. I am terrible with image editing, but I was able to install gimp-dds, edit it and export back to the game in a couple minutes. Someone with a artist background can create new stuff for sure  :)

(click to show/hide)

Tutorial in the Forge: http://forums.taleworlds.com/index.php/topic,295488.0.html
Banner OSP pack (sample): http://forums.taleworlds.com/index.php/topic,279661.0.html
(click to show/hide)

Have fun modding! And don't forget to share it with us  :iamamoron:

you can download a DDS plugin (or Nvidia free software) and edit the textures. It is quite easy to do it. Then you post it on a thread as a sub-mod for other players  :)

You can replace banners too and combine resources from other OSP, plenty of banners to choose in the Forge subforums!

Create one with your avatar, that would be a scary looking shield!  :twisted:

Is it as simple as that? I tried re-centering the blue ship banner used in reiksmarshal's second screenshot and in game it then showed half of a different banner.

Edit: Oops, just noticed my modified texture ended up looking like this after I saved it:
(click to show/hide)
No wonder it looked off!

Edit 2:Ok I had to save it as no mip-maps, now it works fine.  I'd upload a picture but my internet is being weird. Should just be a simple cut/paste/fill job on photoshop/gimp (with the DDS plugin) reiksmarshal.

You will need to either replace the game banners with vanilla (replace them over a old one) or add new banners to the game (which is possible with the modules).
« Last Edit: March 25, 2016, 12:07:26 AM by kalarhan »

Bearomir

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Q&A : modding VC
« Reply #17 on: March 26, 2016, 10:52:56 AM »
I like how there's a bunch of comments in Spanish, it's rare to see a spanish speaking developers.

mike56

  • Master Knight
  • *
  • Caballeros de Calradia admin
    • View Profile
    • Caballeros de Calradia
  • Faction: Nord
  • MP nick: CdC_mikeboix
  • WBNWWF&SM&BVC
Re: Q&A : modding VC
« Reply #18 on: March 26, 2016, 03:10:08 PM »
I like how there's a bunch of comments in Spanish, it's rare to see a spanish speaking developers.

Most of the Viking Conquest team are from Spain  :)


Bearomir

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Q&A : modding VC
« Reply #19 on: March 26, 2016, 08:40:32 PM »
I like how there's a bunch of comments in Spanish, it's rare to see a spanish speaking developers.

Most of the Viking Conquest team are from Spain  :)
Oh no way, that's pretty cool.
Han hecho un buen trabajo, buen mod!

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #20 on: March 26, 2016, 08:45:06 PM »
Oh no way, that's pretty cool.
Han hecho un buen trabajo, buen mod!

Hey guys, this is a thread on modding VC, not about the game or the devs  :).

You could use the thread on VCRE release (link) or create a new one to send them your love  :mrgreen:

Btw, VC is a DLC, not a mod

Bearomir

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Q&A : modding VC
« Reply #21 on: March 26, 2016, 08:52:29 PM »
Oh no way, that's pretty cool.
Han hecho un buen trabajo, buen mod!

Hey guys, this is a thread on modding VC, not about the game or the devs  :).

You could use the thread on VCRE release (link) or create a new one to send them your love  :mrgreen:

Btw, VC is a DLC, not a mod
My bad, couldn't resist.
As for modding, I was surprised that I couldn't sacrifice people at pagan places. So I looked into module system and found this when you pillage a monastery
Code: [Select]
      # ("spoils_woden",[(eq, 0, 1), (eq, "$g_player_faith", 2),],"Sacrifice some monks in honor of Odin and keep the booty.",
That whole section is commented out. I'll play with it and add that functionality back and come back with my findings. Hold my beer.
« Last Edit: March 26, 2016, 08:55:20 PM by Bearomir »

Bearomir

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Q&A : modding VC
« Reply #22 on: March 31, 2016, 05:48:44 AM »
I'm trying to start with a ship at Tunsberg (custom sail, oak, varnish & purple)

Going through the code i found this:

Quote
      (party_set_slot, "$current_town", slot_party_shipyard_ship_type, "$build_ship_type"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_prop, "$build_ship_wood"),
      (party_set_slot, "$current_town", slot_party_shipyard_ship_time, 0),
I know Tunsberg is town_5

Would this work?

Quote
(party_set_slot, "town_5", slot_party_shipyard_ship_type, "$build_ship_type"),
(party_set_slot, "town_5", slot_party_shipyard_ship_prop, "$build_ship_wood"),
(party_set_slot, "town_5", slot_party_shipyard_ship_time, 0),

As for the finish, I found this, but not sure what the actual values of the properties are
Quote
            (troop_remove_gold, "trp_player", "$ship_menu_current_ship_price"),
            (call_script, "script_decode_value", "$ship_menu_current_ship_propertys"),
            (call_script, "script_encode_values_to_reg0", reg1, "$current_ship_sail", "$current_ship_paint", reg4, reg5),
            (assign, ":ship_properties", reg0),
            (store_add, ":current_ship_propertys_slot", slot_party_player_ships_propertys_begin, "$ship_menu_state"),
            (val_sub, ":current_ship_propertys_slot", 1),
            (party_set_slot, "$current_town", ":current_ship_propertys_slot", ":ship_properties"),
I'm thinking of sticking that in game menus where the player gets initial items.

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #23 on: March 31, 2016, 01:04:38 PM »
I'm trying to start with a ship at Tunsberg (custom sail, oak, varnish & purple)

Check the dialog for "crafting" a custom ship. You could create a quest that gives you one for free (some kind of reward), or simple apply that logic and create the player fleet (party) with 1 ship (of that type and quality)

You can also check the "buy a ship" menu and follow that logic.

kraggrim

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • WBM&BWF&SNWVC
Re: Q&A : modding VC
« Reply #24 on: March 31, 2016, 01:25:24 PM »
There's also the menu segment from the storyline where you get the first ship:
(click to show/hide)
Could adapt that. Maybe stick something like it in the camp extra options menu or something else.

Or maybe you just have it run on game start and make it spawn around Tunsberg:
(click to show/hide)
Presumably you can set the wood, sail and decoration here too, though I'm not sure how.

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #25 on: March 31, 2016, 01:41:51 PM »
Presumably you can set the wood, sail and decoration here too, though I'm not sure how.

When in doubt check the slots in module_constants.py
(click to show/hide)

Bearomir

  • Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Q&A : modding VC
« Reply #26 on: March 31, 2016, 08:46:46 PM »
I'm trying to start with a ship at Tunsberg (custom sail, oak, varnish & purple)

Check the dialog for "crafting" a custom ship. You could create a quest that gives you one for free (some kind of reward), or simple apply that logic and create the player fleet (party) with 1 ship (of that type and quality)

You can also check the "buy a ship" menu and follow that logic.
That's exactly where I got it from. I was planning on just "spawning" it on Tunsberg as if I had bought it and talk to the shipwright to launch it. But I want it to be there by default. I see your comment now and makes things more clear. I had no idea you could choose the dragon head, that's very, very interesting.

kraggrim

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • WBM&BWF&SNWVC
Re: Q&A : modding VC
« Reply #27 on: April 02, 2016, 03:44:09 PM »
I want archers able to form ranks in VC which files I need to edit and how?

I'd guess it will be in the generic triggers (used in multiple mission templates, "extended_battle_menu" is an example) found at the top of the module_mission_templates.py file. Presumably there is something there that is either an exception for archers or only lists non-archers.

Edit: There are also various scripts that deal with formations, for example script_cf_battlegroup_valid_formation, script_cf_valid_formation_member , script_player_attempt_formation, script_player_formation_end, script_player_order_formations. The constraint could be contained in one of these.
« Last Edit: April 02, 2016, 07:02:00 PM by kraggrim »

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Q&A : modding VC
« Reply #28 on: April 02, 2016, 07:25:59 PM »
Edit: There are also various scripts that deal with formations, for example script_cf_battlegroup_valid_formation, script_cf_valid_formation_member , script_player_attempt_formation, script_player_formation_end, script_player_order_formations. The constraint could be contained in one of these.

I discussed that in the early questions. When in doubt a good starting place is to use the game strings (texts, speechs, alerts, messages) as a reference

Code: [Select]
Division 2 Archers is an archer division and cannot form ranks.search the game code for "division and cannot form" and you will be directed to the script player_attempt_formation, which handles the validation (should this group be allowed to use this formation?).

Reading the code you will see that it calls a cf_ script to answer that basic question:
 (call_script, "script_cf_battlegroup_valid_formation", "$fplayer_team_no", ":fdivision", ":fformation"),

(if anyone reading this doesn't know what cf_ means: you need to read the basic guides in the Forge, linked in the start of this thread. That is a very important concept)

You can then modify the rules there.

Code: [Select]
        (eq, ":sd_type", sdt_archer),
        (assign, ":size_minimum", formation_min_foot_troops),
        (try_begin),
          # (this_or_next|eq, ":fformation", formation_ranks), uncheck for proper
          # ranks
          (eq, ":fformation", formation_default),
          (assign, ":valid_type", 1),
        (try_end),

Archers are only allowed to used default formation (which is not enabled). Not ranks, shieldwall, wedge, square.

Why? Archers in Warband shoot the enemy in front of them. They don't shoot high in the air to hit a area. If you form ranks/multiple rows you will end up with many archers doing nothing (they can't shoot without killing the friendly in front of them)



Edit: keep in mind that enabling ranks to archers makes no sense. The formation is used to put "best" melee troops in the front row, and you are using archers... so that won't really work unless you create new rules/code to decide which archers should be considered "best" ....
« Last Edit: April 02, 2016, 07:35:10 PM by kalarhan »

kraggrim

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • WBM&BWF&SNWVC
Re: Q&A : modding VC
« Reply #29 on: April 02, 2016, 07:43:47 PM »
I discussed that in the early questions. When in doubt a good starting place is to use the game strings (texts, speechs, alerts, messages) as a reference
Well, if you're going to insist on being efficient about these things  :mrgreen:.

Quote
Edit: keep in mind that enabling ranks to archers makes no sense. The formation is used to put "best" melee troops in the front row, and you are using archers... so that won't really work unless you create new rules/code to decide which archers should be considered "best" ....
I'm presuming he has a bunch of the Norse veteran archers, and would like to put them in front if the enemy manages to get close to them. Only reason I can think you'd want this.