*slaps forehead* sorry everyone, i wasn't thinking. that should work well enough, all I'll have to do is cut off the family trees.
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.
(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"),
(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),
]),
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.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.
(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),
Both haze and cloud amount start at 0.5 (when you start a new game), then every game hour the engine does this:The_dragon said:anyone know an algorithm for generating the global amount of haze/clouds in singleplayer?
cmpxchg8b a little help please?
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);
["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]],
(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),
#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."),]],