- 好友
- 0
- 在线时间
- 7 小时
- 最后登录
- 2025-9-1
扈从
 
- UID
- 3084588
- 第纳尔
- 68
- 精华
- 0
- 互助
- 3
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 1
- 注册时间
- 2019-6-29
 鲜花( 8)  鸡蛋( 0)
|
本帖最后由 咸鱼圣代 于 2025-5-4 13:42 编辑
灵感来自 星球大战征服 - 新秩序 当中的kham_lightsaber_deflection,其源码已在制作者建立的discord群组中放出
效果就是正面打过来的任何飞行物都会等于没打,然后随机方向创建一个飞行物出去模拟玩家弹开了它的感觉。
不过声音效果不触发,我也不知道怎么回事。
2025.5.4
今天交流了一下,感谢夜幕(1403AD作者)提供的方法,在使用
agent_play_sound = 1750 # (agent_play_sound, <agent_id>, <sound_id>),
# Makes the agent emit the specified sound. Gets synchronized by game engine automatically if called on server. Works appearantly the same way as with particle effects, it's getting cut off at a specific distance, up4research.
之后声音顺利触发了
我不是专门搞战场触发器的,所以有些东西我也不是很清楚怎么做到的,但反正改了一些触发条件和判定,在我自己玩的模组里面也能顺利触发了,也不跳红字。
注释是我自己写的
(ti_on_agent_hit, 0.000000, 0.000000,
[
(store_trigger_param, ":agent_no", 1),
(get_player_agent_no, ":player_agent_no"),
(eq, ":agent_no", ":player_agent_no"),#Deflecting is for player only.
(store_trigger_param, ":missile_item_no", 5),
(gt, ":missile_item_no", 0),#Proceed only if a missile is hitting the player.
(agent_get_wielded_item, ":player_right_hand_equipment", ":agent_no", 0),#Make sure player is wielding melee weapon.
(this_or_next|item_has_property, ":player_right_hand_equipment", itp_type_one_handed_wpn),
(this_or_next|item_has_property, ":player_right_hand_equipment", itp_type_two_handed_wpn),
(item_has_property, ":player_right_hand_equipment", itp_type_polearm),
(agent_get_wielded_item, ":player_left_hand_equipment", ":agent_no", 1),#And player is not holding a shield.
(eq, ":player_left_hand_equipment", -1),
(agent_get_defend_action, ":defending", ":agent_no"),#Get player's current defending state.
(gt, ":defending", 0),#If player is parrying or blocking.
(position_move_y, pos0, -1000),#This and the following are supposed to make sure the incoming projectile is coming from player's front, though I don't understand it all.
(agent_get_look_position, pos22, ":agent_no"),
(position_transform_position_to_local, pos2, pos22, pos0),#Checking if Y position is meeting the requirement.
(position_get_y, ":y", pos2),
(ge, ":y", 0),#Proceed if yes.
(assign, reg0, ":attacker_weapon"),
],
[
(assign, ":attacker_weapon", reg0),#Getting the attacker's weapon from trigger condition.
(store_trigger_param, ":agent_no", 1),#Get basic data.
(store_trigger_param, ":damage_value", 3),
(store_trigger_param, ":missile_item_no", 5),#Data collecting finished.
(get_player_agent_no, ":player_agent_no"),#Again checking the agent that's about to perform a deflection is player, but it's checked above, why here again?
(eq, ":agent_no", ":player_agent_no"),
(item_get_missile_speed, ":velocity", ":attacker_weapon"),#Getting velocity of attacker's weapon.
(agent_get_look_position, pos22, ":agent_no"),#Get player's looking position to pos22, where the player is facing.
(position_move_y, pos22, 100, 0),#Moving pos22 100 forward for spawning the deflected projectile later.
(try_begin),#Further tweaking pos22 based on player's riding something or not.
(agent_get_horse, ":mount", ":agent_no"),#If player has a mount, moving pos22 240 more forward,
(neq, ":mount", -1),
(position_move_z, pos22, 240, 0),
(else_try),#If no mount, then 150 more forward.
(position_move_z, pos22, 150, 0),
(try_end),
(store_random_in_range, ":rand_x", 80, 200),#This is probably for spawned flying objects trajectory randomizing initialization.
(store_random_in_range, ":rand_z", 80, 280),
(agent_get_defend_action, ":defending", ":agent_no"),#Again getting players defending state.
(gt, ":defending", 0),
(try_begin),
(assign, ":damage_value", 0),#Incoming projectile will be neutralized.
(val_sub, ":velocity", 100),#Make the spawned deflected projectile 100 slower in speed.
(val_sub, ":rand_x", 200),#Making some extra tweaking for flying direction.
(val_min, ":rand_x", 0),
(val_sub, ":rand_z", 280),
(val_min, ":rand_z", 0),#Tweaking end.
(position_rotate_x, pos22, ":rand_x"),#Finally applying the calculation result of projectile's trajectory.
(position_rotate_z, pos22, ":rand_z"),
(set_fixed_point_multiplier, 1),#What is this?
(add_missile, ":agent_no", pos22, ":velocity", ":attacker_weapon", 0, ":missile_item_no", 0),#Spawning another projectile based on the deflected one at random direction.
(agent_set_animation, ":agent_no", "anim_projectile_deflection", 1),#Playing the deflecting animation.
#(play_sound, "snd_hit_wood_wood"),
(agent_play_sound, ":agent_no", "snd_hit_wood_wood"),
(try_end),
(set_trigger_result, ":damage_value"),#Setting damage player is about to recieve.
(assign, reg0, ":attacker_weapon"),
]),
动作的话,用的都是战团本身里面就有的素材,我是改txt的,所以我只放我调过的txt码,在brf里面应该都搜得到。
projectile_deflection 0 33554448 4
0.600000 parry_attack_thrust_onehanded 12 30 9 0 0.000000 0.000000 0.000000 0.000000
0.600000 parry_attack_slashleft_onehanded 5 24 9 0 0.000000 0.000000 0.000000 0.000000
0.600000 parry_attack_slashright_onehanded 3 20 9 0 0.000000 0.000000 0.000000 0.000000
0.600000 defend_up_onehanded 10 20 9 0 0.000000 0.000000 0.000000 0.000000
战场触发器的txt:
-28.000000 0.000000 0.000000 20 2070 2 1224979098644774912 1 1700 1 1224979098644774913 31 2 1224979098644774912 1224979098644774913 2070 2 1224979098644774914 5 32 2 1224979098644774914 0 1726 3 1224979098644774915 1224979098644774912 0 1073744547 2 1224979098644774915 2 1073744547 2 1224979098644774915 3 2723 2 1224979098644774915 4 2133 2 72057594037927999 1224979098644774915 1726 3 1224979098644774916 1224979098644774912 1 31 2 1224979098644774916 -1 1764 2 1224979098644774917 1224979098644774912 32 2 1224979098644774917 0 721 2 0 -1000 1709 2 22 1224979098644774912 717 3 2 22 0 727 2 1224979098644774918 2 30 2 1224979098644774918 0 2133 2 72057594037927936 1224979098644774919 36 2133 2 1224979098644774912 72057594037927936 2070 2 1224979098644774913 1 2070 2 1224979098644774914 3 2070 2 1224979098644774915 5 1700 1 1224979098644774916 31 2 1224979098644774913 1224979098644774916 2709 2 1224979098644774917 1224979098644774912 1709 2 22 1224979098644774913 721 3 22 100 0 4 0 1714 2 1224979098644774918 1224979098644774913 2147483679 2 1224979098644774918 -1 722 3 22 240 0 5 0 722 3 22 150 0 3 0 2136 3 1224979098644774919 80 200 2136 3 1224979098644774920 80 280 1764 2 1224979098644774921 1224979098644774913 32 2 1224979098644774921 0 4 0 2133 2 1224979098644774914 0 2106 2 1224979098644774917 100 2106 2 1224979098644774919 200 2110 2 1224979098644774919 0 2106 2 1224979098644774920 280 2110 2 1224979098644774920 0 723 2 22 1224979098644774919 725 2 22 1224979098644774920 2124 1 1 1829 7 1224979098644774913 22 1224979098644774917 1224979098644774912 0 1224979098644774915 0 1740 3 1224979098644774913 1801439850948199070 1 600 1 1152921504606847072 3 0 2075 1 1224979098644774914 2133 2 72057594037927936 1224979098644774912
我猜应该是全模组通用的,我没有添加任何不存在于战团本体中的数据。
|
|