["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), imodbits_missile,
[
(ti_on_missile_hit,
[
#pos1 - Missile hit position
#param_1 - Shooter agent
(try_begin),
(multiplayer_is_server),
(store_trigger_param_1, ":shooter"),
(particle_system_burst, "psys_torch_fire", pos1, 100),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":max"),
(player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"),
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(lt, ":dist", 150),
(store_agent_hit_points, ":hp", ":agent", 1),
(val_sub, ":hp", 10),
(val_max, ":hp", 0),
(agent_set_hit_points, ":agent", ":hp", 1),
(try_begin),
(eq, ":hp", 0),
(agent_deliver_damage_to_agent, ":shooter", ":agent"),
(try_end),
(try_end),
(try_end),
(try_end),
]),
]],
("torch_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
500, 0.3, 0.2, 0.03, 5.0, 0.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
(0.5, 0., (1, 0), #alpha keys
(0.5, 1.0), (1, 0.9), #red keys
(0.5, 0.7),(1, 0.3), #green keys
(0.5, 0.2), (1, 0.0), #blue keys
(0, 0.9), (0.4, 0.9), #scale keys
(0.2, 0.2, 0.5), #emit box size
(0, 0, 0.4), #emit velocity
0.0, #emit dir randomness
200, #rotation speed
0.5 #rotation damping
)
Any ideas on how to convert the code to make a choking gas arrow. I would like to have the code make a bigger radius of damage and to deliver damage in the area repetitively if the player is within the area of effect.cdvader said:Deathrun's exploding arrows item.
Code:["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), imodbits_missile, [ (ti_on_missile_hit, [ #pos1 - Missile hit position #param_1 - Shooter agent (try_begin), (multiplayer_is_server), (store_trigger_param_1, ":shooter"), (particle_system_burst, "psys_torch_fire", pos1, 100), (get_max_players, ":max"), (try_for_range, ":i", 1, ":max"), (player_is_active, ":i"), (player_get_agent_id, ":agent", ":i"), (ge, ":agent", 0), (agent_is_alive, ":agent"), (agent_get_position, pos2, ":agent"), (position_move_z, pos2, 50), (get_distance_between_positions, ":dist", pos1, pos2), (try_begin), (lt, ":dist", 150), (store_agent_hit_points, ":hp", ":agent", 1), (val_sub, ":hp", 10), (val_max, ":hp", 0), (agent_set_hit_points, ":agent", ":hp", 1), (try_begin), (eq, ":hp", 0), (agent_deliver_damage_to_agent, ":shooter", ":agent"), (try_end), (try_end), (try_end), (try_end), ]), ]],
I haven't tested yet.. perhaps I should.Kbcamaster said:Nice script cdvader, grabbing it already, thanks.
Do you know if in Warband the item meshes will be able to emit particle effects again?
#cdvader begin
["medic_pack", "Medic Pack", [("throwing_stone", 0)], itp_type_thrown|itp_primary, itcf_throw_knife, 0, weight(3.5)|spd_rtng(102)|shoot_speed(25)|thrust_damage(0, blunt)|max_ammo(1)|weapon_length(0), imodbits_thrown,
[
(ti_on_missile_hit,
[
(multiplayer_is_server),
(assign, ":fail", 0),
(try_begin),
(position_get_distance_to_terrain, ":dist", pos1),
(gt, ":dist", 100),
(assign, ":fail", 1),
(try_end),
(eq, ":fail", 0),
(position_set_z_to_ground_level, pos1),
(particle_system_burst, "psys_gourd_smoke", pos1, 100),
(set_spawn_position, pos1),
(spawn_scene_prop, "spr_medic_pack", 0),
(scene_prop_get_num_instances, ":max", "spr_medic_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
(party_get_slot, ":active", "p_medic_active", ":instance"),
(neq, ":active", 1),
(party_set_slot, "p_medic", ":instance", 20),
(party_set_slot, "p_medic_active", ":instance", 1),
(party_set_slot, "p_medic_locked", ":instance", 0),
(try_end),
]),
]],
["ammo_pack", "Ammo Pack", [("throwing_stone", 0)], itp_type_thrown|itp_primary, itcf_throw_knife, 0, weight(3.5)|spd_rtng(102)|shoot_speed(25)|thrust_damage(0, blunt)|max_ammo(1)|weapon_length(0), imodbits_thrown,
[
(ti_on_missile_hit,
[
(multiplayer_is_server),
(assign, ":fail", 0),
(try_begin),
(position_get_distance_to_terrain, ":dist", pos1),
(gt, ":dist", 100),
(assign, ":fail", 1),
(try_end),
(eq, ":fail", 0),
(position_set_z_to_ground_level, pos1),
(particle_system_burst, "psys_gourd_smoke", pos1, 100),
(set_spawn_position, pos1),
(spawn_scene_prop, "spr_ammo_pack", 0),
(scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
(party_get_slot, ":active", "p_ammo_active", ":instance"),
(neq, ":active", 1),
(party_set_slot, "p_ammo", ":instance", 20),
(party_set_slot, "p_ammo_active", ":instance", 1),
(party_set_slot, "p_ammo_locked", ":instance", 0),
(try_end),
]),
]],
#cdvader end
#cdvader begin
medic_1 = (
0.75, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_medic_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
(party_get_slot, ":time", "p_medic", ":instance"),
(gt, ":time", 0),
(val_sub, ":time", 1),
(party_set_slot, "p_medic", ":instance", ":time"),
(try_end),
])
ammo_1 = (
0.75, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
(party_get_slot, ":time", "p_ammo", ":instance"),
(gt, ":time", 0),
(val_sub, ":time", 1),
(party_set_slot, "p_ammo", ":instance", ":time"),
(try_end),
])
medic_2 = (
1, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_medic_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_medic_pack", ":prop"),
(prop_instance_get_position, pos1, ":instance"),
(try_begin),
(party_get_slot, ":time", "p_medic", ":instance"),
(le, ":time", 0),
(party_get_slot, ":lock", "p_medic_locked", ":instance"),
(neq, ":lock", 1),
(particle_system_burst, "psys_gourd_smoke", pos1, 100),
(position_move_z, pos1, -750),
(prop_instance_set_position, ":instance", pos1),
(party_set_slot, "p_medic_locked", ":instance", 1),
#(replace_scene_props, ":instance", "spr_empty"), #Not sure if works.
(try_end),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":max"),
(player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"),
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(lt, ":dist", 300),
(store_agent_hit_points, ":hp", ":agent", 1),
(val_add, ":hp", 3),
(agent_set_hit_points, ":agent", ":hp", 1),
(try_end),
(try_end),
(try_end),
])
ammo_2 = (
1, 0, 0, [],
[
(multiplayer_is_server),
(scene_prop_get_num_instances, ":max", "spr_ammo_pack"),
(try_for_range, ":prop", 0, ":max"),
(scene_prop_get_instance, ":instance", "spr_ammo_pack", ":prop"),
(prop_instance_get_position, pos1, ":instance"),
(try_begin),
(party_get_slot, ":time", "p_ammo", ":instance"),
(le, ":time", 0),
(party_get_slot, ":lock", "p_ammo_locked", ":instance"),
(neq, ":lock", 1),
(particle_system_burst, "psys_gourd_smoke", pos1, 100),
(position_move_z, pos1, -750),
(prop_instance_set_position, ":instance", pos1),
(party_set_slot, "p_ammo_locked", ":instance", 1),
#(replace_scene_props, ":instance", "spr_empty"), #Not sure if works.
(try_end),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":max"),
(player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"),
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(lt, ":dist", 300),
(agent_refill_ammo, ":agent"),
(try_end),
(try_end),
(try_end),
])
#cdvader end
#cdvader begin
("medic", "medic", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
("medic_active", "medic_active", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
("medic_locked", "medic_locked", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
("ammo", "ammo", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
("ammo_active", "ammo_active", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
("ammo_locked", "ammo_locked", pf_disabled|pf_is_static, no_menu, pt_none, fac_commoners, 0, ai_bhvr_hold, 0, (0., 0), [(trp_looter, 15, 0)]),
#cdvader end
tbox said:cdvader said:Deathrun's exploding arrows item.
[qoute]
["dr_e_arrows", "Explosive Arrows", [("arrow",0), ("flying_missile",ixmesh_flying_ammo), ("quiver", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_back, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(4, pierce)|max_ammo(20), imodbits_missile,
[
(ti_on_missile_hit, [(play_sound, "snd_man_yell"),
#pos1 - Missile hit position
#param_1 - Shooter agent
(try_begin),
(multiplayer_is_server),
(store_trigger_param_1, ":shooter"),
(particle_system_burst, "psys_torch_fire", pos1, 100),
(get_max_players, ":max"),
(try_for_range, ":i", 1, ":max"),
(player_is_active, ":i"),
(player_get_agent_id, ":agent", ":i"),
(ge, ":agent", 0),
(agent_is_alive, ":agent"),
(agent_get_position, pos2, ":agent"),
(position_move_z, pos2, 50),
(get_distance_between_positions, ":dist", pos1, pos2),
(try_begin),
(lt, ":dist", 150),
(store_agent_hit_points, ":hp", ":agent", 1),
(val_sub, ":hp", 10),
(val_max, ":hp", 0),
(agent_set_hit_points, ":agent", ":hp", 1),
(try_begin),
(eq, ":hp", 0),
(agent_deliver_damage_to_agent, ":shooter", ":agent"),
(try_end),
(try_end),
(try_end),
(try_end),
]),
]],
See the area at the top right after (it_on_missle_hit) for adding sound to explosive arrows. As you can see for this demonstration I use sound man yell.
Create a new scene prop called "medic_pack" in module_scene_propstbox said:ERROR: Illegal Identifier:spr_medic_pack
Ohs.. I wanted it so baaaad in 1.011 I wanna cry.cdvader said:Code:... (spawn_scene_prop, "spr_medic_pack", 0), ...
Given what I have to do now to get dynamic scene props your rant is peanutscdvader said:GetAssista, it still doesn't work perfectly.
You can spawn a new scene prop, but it still doesn't save it to reg0. That's why I had to do that simple, yet annoying workaround (p_medic_active).