Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello,

I added a new faction(kingdom) to WFaS. I gave an old castle to this factions leader. But this city's menu is corrupted. City descriptions turned "NO STRING".

A3C99BFA61214EA05152991DB177859D80FD55B3

After click "go to the towncenter" looks like this.

5B8ED2F2984EAB679C376215BB1A31B826256ADE

I explored and explored...
I wrote new str words for new faction like this.

("ms_t_school_short_descr_fac1", "Academy"),
("ms_t_school_short_descr_fac2", "Academy"),
("ms_t_school_short_descr_fac3", "Academy"),
("ms_t_school_short_descr_fac4", "Academy"),
("ms_t_school_short_descr_fac5", "Academy"),
("ms_t_school_short_descr_fac6", "Academy"), #like this

But never changed anything.
I wrote this end of Module_Strings.py, But same. :sad:

I discovered something. I added Faction 6 what I said as new faction. Faction 5 city menu's corrupted like this (take care for "Mill" and "Infantry Commander").

660CADE288D0CCCDFD9D947907C96DACC4860FB9

After click "go to the towncenter" looks like this.

01181546DB4A88F108C4ADD42ADB9DD65E7A6ECB

Can you help? I'm not so bad but I'm newbie for Module system codding.

Newly added: I took city from faction 6 and problem continues for faction 5. :sad:
It's look like faction adding problem. But I don't know what I want.  :neutral:
 
Following this tutorial: http://forums.taleworlds.com/index.php/topic,128647.0.html works fine for Warband, but if something is changed for WFaS, then you should try searching in the module system for the existing factions to see what you have missing; or you could try to find a tutorial specific to WFaS. :smile:
 
I want to increase the likelyhood of soldiers routing, so that 100% casualties for the loser aren't the norm (something like 70% or higher is what I'm looking for). I've looked in mission_templates but cant make sense of the code, is there any way to make soldiers rout faster? (Player and enemy)
 
The Dark Robin said:
Following this tutorial: http://forums.taleworlds.com/index.php/topic,128647.0.html works fine for Warband, but if something is changed for WFaS, then you should try searching in the module system for the existing factions to see what you have missing; or you could try to find a tutorial specific to WFaS. :smile:

Thanks my friend but I know everything. :smile:

I have problem about "factionized city rumors".  This is special for WFAS.
 
Is it possible to play with the battle speed using mission cams to achieve some cool looking slow motion effect?
 
Belendor: The Light and Darkness team has done it.





So, I've done a bit more work on my bandits taking castles feature, and cleaned up the module_scripts section a bit; however, I am still lost on how to make the bandits actually attack the castle.

I'm currently using this: (as part of the simple trigger)
Code:
(party_set_flags, "$future_bandit_king", pf_default_behavior, 0),
(party_set_flags, ":bandit_party", pf_default_behavior, 0),
	   (call_script, "script_party_set_ai_state", "$future_bandit_king", spai_besieging_center, "$chosen_center_for_bandits_to_attack"),
	   (call_script, "script_party_set_ai_state", ":bandit_party", spai_besieging_center, "$chosen_center_for_bandits_to_attack"),

Here's the whole simple trigger:
Code:
(0.5,
   [
       (try_for_range, ":center", walled_centers_begin, walled_centers_end),
       (try_for_parties, ":bandit_party", "pt_looters", "pt_deserters"),
         (store_faction_of_party, ":bandit_party_faction", ":bandit_party"),
            (try_begin),
         (eq, "$future_bandit_king", 0),
          (store_distance_to_party_from_party, ":dist", ":center", ":bandit_party"),
         (lt, ":dist", 20),

          (call_script, "script_party_calculate_strength", ":bandit_party", 0),
          (assign, ":attacker_strength", reg0),
          (call_script, "script_party_calculate_strength", ":center", 0),
          (assign, ":defender_strength", reg0),
           (ge, ":attacker_strength", ":defender_strength"),

         (assign, "$chosen_center_for_bandits_to_attack", ":center"),
         (assign, "$future_bandit_king", ":bandit_party"),
      (else_try),
         (neq, "$future_bandit_king", 0),
         (store_faction_of_party, ":bandit_kings_faction", "$future_bandit_king"),
         (eq, ":bandit_party_faction", ":bandit_kings_faction"),
#       (party_set_ai_behavior, "$future_bandit_king", ai_bhvr_attack_party), #Already tried this, it didn't work
#       (party_set_ai_object, "$future_bandit_king", "$chosen_center_for_bandits_to_attack"), #Already tried this, it didn't work
#       (party_set_ai_behavior, ":bandit_party", ai_bhvr_attack_party), #Already tried this, it didn't work
#       (party_set_ai_object, ":bandit_party", "$chosen_center_for_bandits_to_attack"), #Already tried this, it didn't work
(party_set_flags, "$future_bandit_king", pf_default_behavior, 0),
(party_set_flags, ":bandit_party", pf_default_behavior, 0),
	   (call_script, "script_party_set_ai_state", "$future_bandit_king", spai_besieging_center, "$chosen_center_for_bandits_to_attack"),
	   (call_script, "script_party_set_ai_state", ":bandit_party", spai_besieging_center, "$chosen_center_for_bandits_to_attack"),
(try_end),
(try_end),
(try_end),
   ]),

As of right now I've made King Ragnar attack his own town with this code, so I know something is drastically wrong here. Thoughts?

Yes, I know about the inefficient use of globals, but I don't really think that's what's causing no bandits to ever attack castles, as well as King Ragnar besieging his own keep, with the help of a random Nord caravan. :???:
 
What is required in giving textures parallax maps? I can readily generate parallax maps, but I don't know what is required in adding them to the game's current textures. Do I have to edit a file and add in a flag, or is it as simple as adding _height after the filename?
 
The Dark Robin said:
So, I've done a bit more work on my bandits taking castles feature, and cleaned up the module_scripts section a bit; however, I am still lost on how to make the bandits actually attack the castle.
Are you still using try_for_parties to iterate through party templates when that effectively does nothing? You need to fetch the template of the :bandit_party before using it. You should also indent your code properly, not using mixed tabs and spaces.
 
I used to use try_for_range, but then I switched to try_for_parties. Is there a better operation to use? :smile:
 
I'm trying to use set_visitors in a script but nobody spawns in the scene... Although I'm not sure why not.
Here's the code
Code:
	(else_try),
		 (eq, "$scenario_num", 3),
		 (modify_visitors_at_site, "scn_scene_4"),
		 (reset_visitors),
		(try_for_range, ":walker_no", 0, 21),
		 (store_add, ":entry_no", wandering_entries_start, ":walker_no"),
		 (set_visitors, ":entry_no","trp_basic", 1),
		 (set_jump_mission, "mt_scene_4"),
		 (jump_to_scene, "scn_scene_4"),
		(try_end),
	(try_end),
	  (change_screen_mission),
 
The_dragon said:
anyone know an algorithm for generating the global amount of haze/clouds in singleplayer?
cmpxchg8b a little help please?
Both haze and cloud amount start at 0.5 (when you start a new game), then every game hour the engine does this:
Code:
cloudAmount += rand(-0.5, 0.5) * 0.1;

if (hour >= 1 && hour <= 7 && hazeAmount < 0.9)
{
	float cloudFactor = 1.0;

	if (cloudAmount > 0.4)
		cloudFactor = 1.5;

	hazeAmount += rand(-0.1, 0.9) * 0.05 * cloudFactor;
}
else if (hour >= 11 && hour <= 17 && hazeAmount > 0.1)
{
	float cloudFactor = 1.0;

	if (cloudAmount < 0.6)
		cloudFactor = 1.5;

	hazeAmount -= rand(-0.1, 0.9) * 0.05 * cloudFactor;
}

hazeAmount += (cloudAmount - 0.55) * 0.01 * rand(0.0, 1.0);
hazeAmount += rand(-0.5, 0.5) * 0.1;
hazeAmount = clamp(hazeAmount, 0.0, 1.0);
cloudAmount = clamp(cloudAmount, 0.0, 1.0);
 
All right, quite a simple question. When my agent is playing my "fix bayonet" animation and dies, it doesn't show the dieing animation, but keeps executing that animation. Same thing when dropping the required item for fixing bayonets, or changing weapon. Are there any particular flags to add for doing that, or should i add come code for recognizing the animation being played and stopping it when certain conditions are met?

Here is my animation code, i've been trying to set flags for giving priority to death or other equipped weapons, but it doesn't seem to be working.

Code:
 ["fix_bayonet", acf_enforce_all, amf_client_prediction|amf_priority_reload|amf_priority_attack|amf_priority_equip|amf_priority_cancel|amf_priority_die|amf_play, [4.0, "fix_bayonet", 0, 107,arf_stick_item_to_left_hand|arf_blend_in_5]],

Here is how i call it in my script

Code:
(eq,":attachment_to_use","itm_german_gewehr_bayonet"),
					(agent_get_position,pos1,":agent_no"),
					(agent_get_position,pos1,":agent_no"),
					(copy_position,pos56,pos1),
					(call_script,"script_multiplayer_server_play_sound_at_position","snd_ie_fix_bayonet"),
					(agent_set_animation,":agent_no","anim_fix_bayonet", 1),
					(agent_set_animation,":agent_no","anim_fix_bayonet",0),
 
Code:
  #Samol
  [trp_beowulf_npc_1, "start", [(eq, "$g_talk_troop_met", 0)],
   "Greetings, {my lord/my lady}. I am Samol, the wandering singer. I have played at the court of Sunspear, and in the Ragman's Harbor, at the Temple of Memory and in the brothels of Flea Bottom", "beowulf_talk", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk", [],
   "Continue, please.", "beowulf_talk2", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk", [],
   "I have other things to do than to listen to a singer. Farewell.", "close_window", []],
  [trp_beowulf_npc_1, "beowulf_talk2", [],
   "Oh, there is little more to tell. Every singer wanders far, and boasts of the places he has seen, the people he's met. Say, would you be interested in going on a quest?", "beowulf_talk3", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk3", [],
   "What quest?", "beowulf_talk4", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk3", [],
   "Excuse me, I have important matters that require my attention.", "close_window", []],
  [trp_beowulf_npc_1, "beowulf_talk4", [],
   "I have a treasure with me, a war mace. It was given to me for services rendered, but I do not have any use for it. It's called Coldbringer. I will give Coldbringer to you, but I want you to get something for me in exchange. A necklace and a horn.", "beowulf_talk5", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk5", [],
   "A war mace? Hmph, sure. Will any horn and necklace do or do you need something special?", "beowulf_talk6", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk5", [],
   "I have better things to do than to chase after some horn and glittery jewelry. Farewell.", "close_window", []],
  [trp_beowulf_npc_1, "beowulf_talk6", [],
   "Oh, it has to be a very special horn and necklace. I am old, but you can make the journey I cannot. You must meet an old hermit, Rodgar. I believe he has made his home in the Wolfswood, to the north of Winterfell. He knows where the horn is. Be wary though, I've heard that he's gone quite mad.", "beowulf_talk7", []],
  [trp_beowulf_npc_1|plyr, "beowulf_talk7", [],
   "Very well, I'll seek out this Rodgar.", "close_window", [(remove_troop_from_site,"trp_beowulf_npc_1","scn_town_36_castle"),(setup_quest_text, "qst_beowulf_quest"),(str_store_string, s2, "@Samol has tasked you with finding his horn and necklace. Visit Rodgar in the North."),(call_script, "script_start_quest", "qst_beowulf_quest", "$g_talk_troop"),(display_message, "@Visit the village of Hillhall."),]],
  [trp_beowulf_npc_1|plyr, "beowulf_talk7", [],
   "I am not interested.", "close_window", []],

  [trp_beowulf_npc_1, "start", [(troop_is_hero, "$g_talk_troop")],
   "Yes?", "close_window", []],

#Rodgar                                                                             
[trp_beowulf_npc_2, "start", [],
   "I see the shadows coming! In the north, a blind raven with a thousand eyes, and one! Ohhh, how he torments me! I see him through my trees! He knows me, and I fear him! But he cannot reach me here, the runes protect me! They're strong, strong, strong in the north.", "pj_beowulf_talk", []],
  [trp_beowulf_npc_2|plyr, "pj_beowulf_talk", [],
   "Are you mad?", "close_window", []],
[trp_beowulf_npc_2|plyr,"pj_beowulf_talk", [(check_quest_active,"qst_beowulf_quest")], "Are you Rodgar?",
"pj_beowulf_talk2",[(call_script, "script_end_quest", "qst_beowulf_quest"),(add_xp_as_reward,200)]],
  [trp_beowulf_npc_2, "pj_beowulf_talk2", [],
   "I am Rodgar, Rodgar, Rodgar! Maybe I'm a tree, or a raven! Sometimes, I'm an elk! Heh heh! Who are you? Do you serve the mistress of light? I feel her flames! I feel them through the trees! Those cruel flames! Ohhh, I want my cold brothers! Don't fret now, they're coming! Coming soon! They'll quench all the flames, hah!", "pj_beowulf_talk3", []],
  [trp_beowulf_npc_2|plyr, "pj_beowulf_talk3", [],
   "My name is {playername}. Samol sent me. He told me you have a special horn, and he wants it for himself.", "pj_beowulf_talk5", []],
  [trp_beowulf_npc_2, "pj_beowulf_talk5", [],
   "Hah! Yes, take the horn. No wait! It's mine! Away with you!", "pj_beowulf_talk6", []],
[trp_beowulf_npc_2|plyr,"pj_beowulf_talk6",[],
"Give me the horn!","pj_beowulf_talk8",[]],  
[trp_beowulf_npc_2,"pj_beowulf_talk8", [], "I don't have it! It was taken from me! By the son of the bloody lady! She bathes in blood, even in her death! I see her through the tree. Beneath it, she cuts the maidens throat, and she drinks the blood. Oh, the blood is so pure! Her bats are great, great bats they are! She sits in the castle of the king, the burned castle. It's so massive! Massive castle, massive castle, huge castle! She laughs at me when she sees me! Her eyes! They're terrible! They're so cold!",
"close_window",[(call_script, "script_start_quest", "qst_beowulf_quest1", "$g_talk_troop"),(setup_quest_text, "qst_beowulf_quest1"),(str_store_string, s2, "@Rodgar was plainly mad, but it was clear he no longer had the items. He raved about some huge castle, burned and filled with bats. Maybe such a castle lies to the south."),(display_message, "@Talk to Goodwife Myra in Barrowton."),]],

Been having a problem with setting up the quest text. The first one works fine, but the second appears to be referencing the wrong string. Anyone got an idea what's wrong?
 
Status
Not open for further replies.
Back
Top Bottom