本帖最后由 我只玩MID 于 2021-11-25 14:55 编辑
玩过潘德的预言的都知道,白鹿堡是自立的不二之选,对于玩家而言,易攻易守。这让很多人(我)新档自立都是选在白鹿堡,让整局游戏都枯燥了不少。
这次的分享主要是让各个城镇的场景变得随机化,相同的城每个档的场景都不一样,包括攻守城。这里只写了城镇场景的随机化,不过城堡和村子也都大同小异。
首先得增加两个简单的脚本:- ##初始化城镇场景
- ("initialization_town_scene",
- [
- (store_script_param, ":party_id", 1),
- (store_script_param, ":number_id", 2),
-
- (party_set_slot,":party_id", slot_party_type, spt_town),
-
- (assign, ":offset", -1),
- (val_add, ":offset", ":number_id"),
-
- (store_add, ":cur_object_no", "scn_town_1_center", ":offset"),
- (party_set_slot,":party_id", slot_town_center, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_castle", ":offset"),
- (party_set_slot,":party_id", slot_town_castle, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_prison", ":offset"),
- (party_set_slot,":party_id", slot_town_prison, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_walls", ":offset"),
- (party_set_slot,":party_id", slot_town_walls, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_tavern", ":offset"),
- (party_set_slot,":party_id", slot_town_tavern, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_store", ":offset"),
- (party_set_slot,":party_id", slot_town_store, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_arena", ":offset"),
- (party_set_slot,":party_id", slot_town_arena, ":cur_object_no"),
- (store_add, ":cur_object_no", "scn_town_1_alley", ":offset"),
- (party_set_slot,":party_id", slot_town_alley, ":cur_object_no"),
-
- (party_set_slot,":party_id", slot_town_reinforcement_party_template, "pt_center_reinforcements"),
- ]),
-
- ##随机一个可行的场景
- ("random_town_scene",
- [
- (store_script_param, ":party_id", 1),
-
- (store_faction_of_party, ":party_faction", ":party_id"),
- (faction_get_slot, ":faction_culture", ":party_faction", slot_faction_culture),
-
- (store_random_in_range, ":rand", 1, 23),
- (assign, ":rand_town", ":rand"),
- (val_sub, ":rand_town", 1),
- (val_add, ":rand_town", "p_town_1"),
- (assign, ":pass_check", 0),
-
- ##11##
- (try_begin),
- (eq, ":faction_culture", fac_culture_3),
- (try_begin),
- (this_or_next|is_between, ":rand_town", "p_town_17", "p_town_19"),
- (this_or_next|eq, ":rand_town", "p_town_10"),
- (eq, ":rand_town", "p_town_14"),
- (assign, ":pass_check", 1),
- (try_end),
- (else_try),
- (try_begin),
- (this_or_next|is_between, ":rand_town", "p_town_3", "p_town_9"),
- (this_or_next|eq, ":rand_town", "p_town_13"),
- (is_between, ":rand_town", "p_town_15", "p_town_17"),
- (assign, ":pass_check", 1),
- (try_end),
- (try_end),
- ##11##
-
- (try_begin),
- (eq, ":pass_check", 1),
- (assign, reg0, ":rand"),
- (else_try),
- (call_script, "script_random_town_scene",":party_id"),
- (try_end),
- ]),
复制代码 很好理解,第一个脚本是重新设置城镇的一些场景slot,第二个则是给各个城镇随机一个契合的场景(不至于大地图上草原地形,场景里确是雪地)但这里只是用库吉特文化演示了一下。
添加完这两个脚本后,在新增一个触发器:
- (0, 0, ti_once, [],
- [
- (try_for_range, ":town_no", towns_begin, towns_end),
- (call_script, "script_random_town_scene", ":town_no"),
- (call_script, "script_initialization_town_scene", ":town_no", reg0),
- (try_end),
-
- ]),
复制代码 随机脚本的核心是##11##区域,按照自己的实际情况来写。
都是简单的语句组成,没什么学习价值,但好像没有mod做过类似的功能,所以发出来给大伙提供个思路。
|