OSP Code Combat [WSE] Flail

Users who are viewing this thread

Only if you're an expert. There are many new modders here.
If you want to use the + format like I showed above, add another pair of braces to your standalone triggers so they will compile:
flail_trigger = [
(0, 0, 0,
[(neg|multiplayer_is_dedicated_server),],
    [
(try_for_agents, ":agent_no"),
(agent_is_active, ":agent_no"),
(agent_is_alive, ":agent_no"),
(agent_slot_eq, ":agent_no", slot_agent_flail_using, 1),
(agent_get_wielded_item, ":wielded_weapon", ":agent_no", 0),
(try_begin),
(this_or_next|eq, ":wielded_weapon", "itm_flail1_blunt"),
(this_or_next|eq, ":wielded_weapon", "itm_flail2_blunt"),
(eq, ":wielded_weapon", "itm_flailsteel_blunt"),
(agent_get_wielded_item_slot_no, ":slot_no", ":agent_no"),
(val_add, ":slot_no", bmm_item_1),
(agent_get_animation, ":upper_anim", ":agent_no", 1),
(try_begin),
(this_or_next|eq, ":upper_anim", "anim_release_slashright_onehanded"),
#(this_or_next|eq, ":upper_anim", "anim_release_slashright_onehanded_continue"),
#(this_or_next|eq, ":upper_anim", "anim_release_slashleft_onehanded_continue"),
(this_or_next|eq, ":upper_anim", "anim_release_slashleft_onehanded"),
(this_or_next|eq, ":upper_anim", "anim_release_overswing_onehanded"),
(this_or_next|eq, ":upper_anim", "anim_release_slash_horseback_right"),
(eq, ":upper_anim", "anim_release_slash_horseback_left"),

(agent_get_animation_progress, ":animation_progress", ":agent_no", 1),
(store_mul, ":vertex_animation_time", 55, ":animation_progress"),
(val_div, ":vertex_animation_time", 100),
(val_add, ":vertex_animation_time", 10),
(agent_body_meta_mesh_set_vertex_keys_time_point, ":agent_no", ":slot_no", ":vertex_animation_time"),
(else_try),
(agent_body_meta_mesh_set_vertex_keys_time_point, ":agent_no", ":slot_no", 65),
(agent_set_slot, ":agent_no", slot_agent_flail_using, 0),
(try_end),
(else_try),
(agent_set_slot, ":agent_no", slot_agent_flail_using, 0),
(try_end),
(try_end),
]),
]
flail_wielding_trigger = [
(ti_on_item_wielded, 0, 0,
[(neg|multiplayer_is_dedicated_server),],
    [
(store_trigger_param_1, ":agent_no"),
        (store_trigger_param_2, ":item_no"),
#(eq, ":item_no", "itm_flail"),
(this_or_next|eq, ":item_no", "itm_flail1_blunt"),
(this_or_next|eq, ":item_no", "itm_flail2_blunt"),
(eq, ":item_no", "itm_flailsteel_blunt"),
#(agent_get_bone_position,pos1,":agent_no",hb_item_r, 1),##this was used for 1st flail pack -multiplayer
#(play_sound_at_position, "snd_draw_flail", pos1),
(agent_play_sound, ":agent_no", "snd_draw_flail"),
]),
]
 
I have no WSE,but I also managed to make a flail 11 months ago.I made the chain and star into scene props with vertex animation,while handle is an item.Then attach the chain to handle's end with the operations added in WB 1.161.With some code's help the chain and star can animate accrode to the user's animation,like swinging,waving,or stady.
 
Really interested in this. Thanks for sharing!

_Forgive_ said:
I have no WSE,but I also managed to make a flail 11 months ago.I made the chain and star into scene props with vertex animation,while handle is an item.Then attach the chain to handle's end with the operations added in WB 1.161.With some code's help the chain and star can animate accrode to the user's animation,like swinging,waving,or stady.
Can you explain which operation to use for that? I was wondering how that works
 
Bad Idea said:
Really interested in this. Thanks for sharing!

_Forgive_ said:
I have no WSE,but I also managed to make a flail 11 months ago.I made the chain and star into scene props with vertex animation,while handle is an item.Then attach the chain to handle's end with the operations added in WB 1.161.With some code's help the chain and star can animate accrode to the user's animation,like swinging,waving,or stady.
Can you explain which operation to use for that? I was wondering how that works


The new operation,"agent_get_bone_position",I use it to get the position of agent's weapon bone,which is also the position of the weapon itself.Move the position forward for about 40 units(the length of the handle,where the chain should be attached to),and set the chain&star prop into this position.The chain&star prop has some vertex animations,I can play these animations depends on the attacking,walking or standing of agent.By the way,without the new OPs "prop_instance_deform_in_range","prop_instance_deform_in_cycle_loop","prop_instance_get_current_deform_progress" and "prop_instance_get_current_deform_frame",I can never make the prop animate as my wish.
So basicly,the real weapon is the handle,while the chain and star are just scene prop attached to the right position.
This script is set in a (0,0,0)trigger.

My work is not perfect,because the OP "agent_get_bone_position" can hardly get the exact position of bones,especially when the bone is moving fast.As a result,when my agent is riding like wind,the chain&star prop drops behind.Such effect is not obviously,but still makes me feel pity..

If you please leave your e-mail address to me,I'll send you a demo video and my PY code.I don't mind share it,since I believe your work is far more better than mine :grin:
 
I added this for SP but doesn't work, just for MP?
GzrW42.jpg

Added lead_charge mt
flail_wielding_trigger,
flail_trigger,
 
I use wse 4.3,
Maybe this part is wrong paste?
    (str_store_agent_name, s0, ":value"),
            (try_end),
            (display_message, "str_your_duel_with_s0_is_cancelled"),
          (try_end),
  #add to CLIENT EVENTS to script "game_receive_network_message"
(else_try),
    (eq,":event_type", action_react_to_flail_attack),
(store_script_param,":attacker_agent_no",4),
(try_begin),
(agent_is_active, ":attacker_agent_no"),
(agent_is_alive, ":attacker_agent_no"),
(agent_get_wielded_item_slot_no, ":slot_no", ":attacker_agent_no"),
(val_add, ":slot_no", bmm_item_1),
(agent_body_meta_mesh_set_vertex_keys_time_point, ":attacker_agent_no", ":slot_no", 10),
(agent_set_slot, ":attacker_agent_no", slot_agent_flail_using, 1),
(agent_play_sound, ":attacker_agent_no", "snd_draw_flail"),
(try_end),
          (try_begin),
            (get_player_agent_no, ":player_agent"),
            (agent_is_active, ":player_agent"),
            (agent_set_slot, ":player_agent", slot_agent_in_duel_with, -1),
            (agent_clear_relations_with_agents, ":player_agent"),
          (try_end),
        (else_try),
          (eq, ":event_type", multiplayer_event_show_server_message),
          (display_message, "str_server_s0", 0xFFFF6666),
        (try_end),
    ]),

  # script_cf_multiplayer_evaluate_poll
  # Input: none
  # Output: none (can fail)
  ("cf_multiplayer_evaluate_poll",
 
Make sure that the triggers in item_kinds are only active when you are running the flail mod.
I get errors like that when I play without the WSE exe running.
I have item_kinds for WSE and item_kinds without WSE:
["flail1_blunt", "Cavalry_Flail", [("mace_pear",0), ("flail_scab", ixmesh_carry)], itp_bln, itc_bln, 815,
Code:
weight(3.7)|difficulty(9)|spd_rtng(76)|weapon_length(102)|swing_damage(30,blunt)|thrust_damage(0,blunt), imodbits_mace, 
 [(ti_on_weapon_attack,
  #(play_sound,"snd_chain"),
  [(store_trigger_param_1, ":attacker_agent_no"),
    # (try_begin),
    #         (multiplayer_is_server),
    #   (get_max_players, ":num_players"),
    #         (try_for_range, ":current_player_no", 1, ":num_players"),
    #             (player_is_active, ":current_player_no"),
    #     (multiplayer_send_int_to_player, ":current_player_no", action_react_to_flail_attack, ":attacker_agent_no"),
    #         (try_end),
    #  (else_try),
    #       (agent_get_wielded_item_slot_no, ":slot_no", ":attacker_agent_no"),
    #       (val_add, ":slot_no", bmm_item_1),
    #       (agent_body_meta_mesh_set_vertex_keys_time_point, ":attacker_agent_no", ":slot_no", 10),
    #       (agent_set_slot, ":attacker_agent_no", 'slot_agent_flail_using', 1),
          (agent_play_sound, ":attacker_agent_no", "snd_draw_flail"),
     # (try_end),
 
Back
Top Bottom