How to...

Users who are viewing this thread

Oliver Qvist

Regular
If I join Rhodoks, then I capture a Swadia Castle with swadian villages.
I want those villages to become Rhodoks, so I can recruit Rhodoks from them.
I hate that when other factions start taking over land all over they mix their troops so you get an army with swadians, saranids, nords, rhodok.
How can I do this? I have notepad++ if I need to edit some code.
 
If you want to learn how to mod, that is  cool but long road. You can see guides, tutorials and examples on this forum and child-forum.

BUT are you playing native? You should check the released mods that expand it, many will already have this implemented (besides hundreds of new cool stuff for the game). That way all you need is to download and play the mod.
 
Yeah I'm playing native.

The past weeks I guess, I've been trying to learn C#. It's hard, and even harder it gets when you try and apply what you've learned into editing scripts for games.
When you open up all the scripts you have no idea how they have thought when they wrote it, or where all the stuff is.

I also like to do 3D modeling, and  texturing and some drawing. I'm really over my head with wanting to learn everything at the same time.
But, since I'm much better at the 3D and visual stuff I will probably specialize myself in that.

I just wanted to know if there was any quick editing that I could do to have the villages provide recruits depending on wich faction owns them.
It really ruins the game for me.
 
Something like this has already been done. Not sure if the code was released as an independent OSP, or if people are simply using that tweak kraggrim linked. Maybe it's not public at all, and you have to write your own.

 
Lav, I had a look but couldn't see it in there.

Oliver Qvist I'm guessing it would be
Code:
("update_volunteer_troops_in_village",
or
Code:
("update_npc_volunteer_troops_in_village",
in module_scripts.py that you'd need to look at. Don't know the difference between them myself. Maybe the second is to do with lords recruitment?



 
kraggrim said:
Lav, I had a look but couldn't see it in there.
Ah. A pity then.

Maybe it's time someone picked up that project.

kraggrim said:
Oliver Qvist I'm guessing it would be
Code:
("update_volunteer_troops_in_village",
or
Code:
("update_npc_volunteer_troops_in_village",
in module_scripts.py that you'd need to look at. Don't know the difference between them myself. Maybe the second is to do with lords recruitment?
Yep. You need the first one.

domipoppe said:
What about Slots?

slot_center_volunteer_troop_type  = 92
slot_center_volunteer_troop_amount= 93
I'm not sure I understand your question. These are the slots that contain information about village volunteers, if that's what you are asking.
 
Yes! Thanks for all the help!

I did TheMageLords tweak and I launched the game, since it didn't crash I presume it will work.
Just gotta play a little more and see! Awesome!

What I do wonder though is how TheMageLord can read these numbers and change them to do
what he wants. To me all I see is A LOT of numbers. Is this what you called compiled code?

Would be cool to be able to go in and understand it. Just don't know how to start.
I feel like having the Skill to code in one or multiple languages is essential for someone
who is intrested in modding or even making his own games. I want to earn those skills,
one day.
 
These numbers are just module system code converted to less readable format (but easier for engine to parse). So when you have the general idea on how module system is compiled into txt files, locating necessary sequences is relatively easy.
 
Oliver Qvist said:
What I do wonder though is how TheMageLord can read these numbers and change them to do
what he wants. To me all I see is A LOT of numbers. Is this what you called compiled code?

Game is split in two basic parts: engine and module.

Module is where you build your world, items, quests, stuff to do. That is open and players/modders can change it.

Download native source (Lav version is easier to read): http://forums.taleworlds.com/index.php/topic,324874.0.html

Then you can start here: http://forums.taleworlds.com/index.php/board,12.0.html

Just as a example -> all those numbers came from this:

Code:
#script_update_volunteer_troops_in_village
  # INPUT: arg1 = center_no
  # OUTPUT: none
  ("update_volunteer_troops_in_village",
    [
       (store_script_param, ":center_no", 1),
       (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
       (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
	   
	   
##	   (try_begin),
##		(eq, "$cheat_mode", 2),
##	    (str_store_party_name, s4, ":center_no"),
##	    (str_store_faction_name, s5, ":center_culture"),
##	    (display_message, "str_updating_volunteers_for_s4_faction_is_s5"),
##	   (try_end),
	   
       (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
       (assign, ":volunteer_troop_tier", 1),
       (store_div, ":tier_upgrades", ":player_relation", 10),
       (try_for_range, ":unused", 0, ":tier_upgrades"),
         (store_random_in_range, ":random_no", 0, 100),
         (lt, ":random_no", 10),
         (store_random_in_range, ":random_no", 0, 2),
         (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
         (try_begin),
           (le, ":upgrade_troop_no", 0),
           (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
         (try_end),
         (gt, ":upgrade_troop_no", 0),
         (val_add, ":volunteer_troop_tier", 1),
         (assign, ":volunteer_troop", ":upgrade_troop_no"),
       (try_end),
       
       (assign, ":upper_limit", 8),
       (try_begin),
         (ge, ":player_relation", 4),
         (assign, ":upper_limit", ":player_relation"),
         (val_div, ":upper_limit", 2),
         (val_add, ":upper_limit", 6),
       (else_try),
         (lt, ":player_relation", 0),
         (assign, ":upper_limit", 0),
       (try_end),

       (val_mul, ":upper_limit", 3),   
       (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
       (val_div, ":upper_limit", ":amount_random_divider"),
       
       (store_random_in_range, ":amount", 0, ":upper_limit"),
       (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
       (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
     ]),
 
Back
Top Bottom