Wulfila said:Wulfila said:Hi Leute!
Ich komme gleich zu meinem Problem:
Ich will in meinem Mod die Funktion einfügen, dass ich über den Ozean reisen kann, dass heißt sobald ich als Spieler das Wasser "berühre" wechselt mein Player-Icon in ein Schiff Icon.
Dazu habe ich den Code von Ruthven eingefügthttp://forums.taleworlds.com/index.php/topic,69810.0.html
Das hat alles ganz gut geklappt und mein Player Icon swicht sozusagen hin und her (je nachdem wo ich mich gerade befinde).
Mein einziges Problem ist, dass die Wasser-Textur (wenn ich es einmal so nennen darf) starr ist, d.h. der Wassereffekt (Wellenschlagen) funktioniert nicht.
Ich habe das komplette Forum durchwühlt aber nichts dazu gefunden. Funktionieren muss es aber weil es bei 1257AD auch klappt.
Daher meine Frage: Wie kann ich das Problem lösen?
Meine ursprüngliche Fragestellung (siehe Zitat oben) habe ich nun gelöst.
Nun habe ich das nächste Problem, mein Player-Icon wechselt nicht mehr in ein Schiff-Icon. Bevor ich mein "Wasser"-Problem hatte funktionierte es noch.
Ich zeig mal kurz den Code welchen ich verwende:
module_triggers.py
## SEA BATTLES BEGIN
(0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),(assign,reg1,":terrain", 7)], # rt_steppe is an example for the name of your new water terrain
[(try_begin),
(troop_get_inventory_slot, ":cur_horse", "trp_player", , #horse slot
(assign, ":new_icon", -1),
(try_begin),
(eq,reg1,5),
(assign, ":new_icon", "icon_ship"),
#(display_message,"@water"),
(else_try),
(eq, "$g_player_icon_state", pis_normal),
(try_begin),
(ge, ":cur_horse", 0),
(assign, ":new_icon", "icon_player_horseman"),
#(display_message,"@no water, horse"),
(else_try),
(assign, ":new_icon", "icon_player"),
#(display_message,"@no water, no horse"),
(try_end),
(else_try),
(eq, "$g_player_icon_state", pis_camping), # All of this is thanks to Lumos bein' generous, and not being as much of a lazy arse as I am
(assign, ":new_icon", "icon_camp"),
(try_end),
(party_set_icon,"p_main_party", ":new_icon"),
]),
# (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
# (neq,":terrain",5),], #Oh shi- ALL HAIL HYPNOTOAD
# [(party_set_icon,"p_main_party", "icon_player"),
# (display_message,"@Not water"),
# ]),
(0.1, 0, 0.0, [],
[(try_for_parties, ":cur_party"),
(party_get_current_terrain, ":terrain", ":cur_party"),
(eq, ":terrain", 7),
(party_get_template_id, ":cur_template", ":cur_party"),
(this_or_next|eq, ":cur_template", "pt_kingdom_hero_party"),
(this_or_next|eq, ":cur_template", "pt_kingdom_caravan_party"),
(this_or_next|eq, ":cur_template", "pt_manhunters"),
(this_or_next|eq, ":cur_template", "pt_village_farmers"),
(this_or_next|eq, ":cur_template", "pt_deserters"),
(this_or_next|eq, ":cur_template", "pt_looters"),
(this_or_next|eq, ":cur_template", "pt_forest_bandits"),
(this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
(this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
(eq, ":cur_template", "pt_sea_raiders"),
(party_set_icon, ":cur_party", "icon_ship"),
(else_try),
(neq,":terrain",7),
(party_get_template_id, ":cur_template", ":cur_party"),
(eq, ":cur_template", "pt_kingdom_hero_party"),
(party_set_icon,":cur_party","icon_flagbearer_a"),
(else_try),
(eq, ":cur_template", "pt_kingdom_caravan_party"),
(party_set_icon,":cur_party","icon_mule"),
(else_try),
(eq, ":cur_template", "pt_deserters"),
(party_set_icon,":cur_party","icon_vaegir_knight"),
(else_try),
(eq, ":cur_template", "pt_manhunters"),
(party_set_icon,":cur_party","icon_gray_knight"),
(else_try),
(eq, ":cur_template", "pt_village_farmers"),
(party_set_icon,":cur_party","icon_peasant"),
(else_try),
(this_or_next|eq, ":cur_template", "pt_looters"),
(this_or_next|eq, ":cur_template", "pt_forest_bandits"),
(this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
(this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
(eq, ":cur_template", "pt_sea_raiders"),
(party_set_icon,":cur_party","icon_axeman"),
(else_try),
(eq, ":cur_template", "pt_cattle_herd"),
(party_set_icon,":cur_party","icon_cattle"),
(try_end),]),
## SEA BATTLES END
#Give centers to factions first, to ensure more equal distributions
(call_script, "script_give_center_to_faction_aux", "p_town_1", "fac_kingdom_4"),
(call_script, "script_give_center_to_faction_aux", "p_town_2", "fac_kingdom_4"), [...]
#Now give towns to great lords
(call_script, "script_give_center_to_lord", "p_town_1", "trp_kingdom_4_lord", 0),
(call_script, "script_give_center_to_lord", "p_town_2", "trp_knight_4_1", 0), [...]
# Give family castles to certain nobles.
(call_script, "script_give_center_to_lord", "p_castle_29", "trp_knight_2_10", 0), #Nelag_Castle
(call_script, "script_give_center_to_lord", "p_castle_30", "trp_knight_3_4", 0), #Asugan_Castle
(call_script, "script_give_center_to_lord", "p_castle_35", "trp_knight_1_3", 0), #Haringoth_Castle
(call_script, "script_assign_lords_to_empty_centers"),
("kingdom_6_reinforcements_c", "{!}kingdom_6_reinforcements_c", 0, 0, fac_commoners, 0, [(trp_sarranid_horseman,3,5)]),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
(else_try),
(faction_slot_eq, ":faction_no", slot_faction_culture, "fac_culture_your_culture"),
(faction_set_slot, ":faction_no", slot_faction_deserter_troop, "trp_your_faction_deserter"),
(faction_set_slot, ":faction_no", slot_faction_guard_troop, "trp_your_faction_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_messenger_troop, "trp_your_faction_messenger"),
(faction_set_slot, ":faction_no", slot_faction_prison_guard_troop, "trp_your_faction_prison_guard"),
(faction_set_slot, ":faction_no", slot_faction_castle_guard_troop, "trp_your_faction_castle_guard"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_a, "pt_your_kingdom_reinforcements_a"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_b, "pt_your_kingdom_reinforcements_b"),
(faction_set_slot, ":faction_no", slot_faction_reinforcements_c, "pt_your_kingdom_reinforcements_c"),