align secondary scene_prop with original (multiplayer)

Users who are viewing this thread

Hello friends,
I have a code to damage objects, it is an explosive box that when exploding, breaks some walls and instead a broken wall appears, but I have a problem ... when replacing the original wall, the broken wall does not stay in the same place ....
In openBRF I have the walls (broken and original) in exactly the same place.
What is missing from the code to work well?
7p6nd2gxlwahupc6g.jpg

This is the code:
Code:
("explosive_box",sokf_moveable|sokf_show_hit_point_bar|sokf_destructible,"caja_explosiva","bo_caja_torre",
[  (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_no"),
      (scene_prop_set_hit_points, ":instance_no", 1),
    ]),

    (ti_on_scene_prop_destroy,
    [
          (this_or_next|multiplayer_is_server),
          (neg|game_in_multiplayer_mode),
          (play_sound, "snd_grenade3"),
          (store_trigger_param_1, ":instance_no"),
          (prop_instance_get_position, pos1, ":instance_no"),

          (particle_system_burst, "psys_explosion_smoke", pos1, 100),
          (particle_system_burst, "psys_explosion_smoke2", pos1, 100),
          (particle_system_burst, "psys_explosion_flash", pos1, 200),
          (particle_system_burst, "psys_particula_polvora1", pos1, 15),
          (particle_system_burst, "psys_particula_polvora2", pos1, 15),
          (particle_system_burst, "psys_particula_polvora3", pos1, 20),

      (position_set_z, pos2, -1200),
      (prop_instance_animate_to_position, ":instance_no", 2, 2),

      (try_for_agents,":target"),
      (agent_get_position, pos3, ":target"),
      (store_agent_hit_points, ":hp", ":target", 1),
      (get_distance_between_positions, ":dist", pos1, pos3),
      (try_begin),
        (le, ":dist", 400),
        (assign, ":dmg", 300),
        (agent_is_alive, ":target"),
        (val_sub, ":dmg", ":dist"),
        (val_sub, ":hp", ":dmg"),
        (agent_set_hit_points, ":target", ":hp", 1),
        (agent_deliver_damage_to_agent, ":target", ":target", ":dmg", 1),
      (try_end),
      (try_end),

(store_random_in_range, ":desc_prop", muros_inicio, muros_fin),
(assign, ":dist_to_explode", 7),

(scene_prop_get_num_instances, ":num_spr_to_destroy", ":desc_prop"),
   (try_for_range, ":prop_to_destroy", 0, ":num_spr_to_destroy"),
      (scene_prop_get_instance, ":prop_to_destroy_id", ":desc_prop", ":prop_to_destroy"),
      (prop_instance_get_position, pos4, ":prop_to_destroy_id"),
      (prop_instance_get_position, pos5, ":instance_no"),
      (get_distance_between_positions_in_meters, ":distance", pos4, pos5),
      (assign, reg1, ":distance"),
   (try_begin),
      (is_between, ":distance", 0, ":dist_to_explode"),
      (play_sound, "snd_grenade3"),

      (try_begin),
        (eq,":desc_prop","spr_ado_muro_madera_1"),
        (assign,":prop_to_spawn","spr_ado_muro_madera_1b"),
      (else_try),
        (eq,":desc_prop","spr_ado_muro_madera_2"),
        (assign,":prop_to_spawn","spr_ado_muro_madera_2b"),
      (else_try),
        (eq,":desc_prop","spr_ado_muro_madera_3"),
        (assign,":prop_to_spawn","spr_ado_muro_madera_3b"),
      (try_end),
      (copy_position, pos2, pos1),
      (spawn_scene_prop, ":prop_to_spawn"),
      (particle_system_burst, "psys_war_smoke_tall", pos2, 5),
      (particle_system_burst, "psys_explosion_smoke", pos2, 100),
      (particle_system_burst, "psys_explosion_smoke2", pos2, 100),
      (particle_system_burst, "psys_particula_polvora1", pos2, 15),
      (particle_system_burst, "psys_particula_polvora2", pos2, 15),
      (particle_system_burst, "psys_particula_polvora3", pos2, 20),
      (position_set_z, pos6, -1200),
      (prop_instance_animate_to_position, ":prop_to_destroy_id", pos6, 1),
   (try_end),
   (try_end),
   ]),

    (ti_on_scene_prop_hit,
    [
      (play_sound, "snd_dummy_hit"),
      (particle_system_burst, "psys_dummy_smoke", pos1, 3),
      (particle_system_burst, "psys_dummy_straw", pos1, 10),
    ]),
  ]),
 
Back
Top Bottom